diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/debugger/gdbstub_arch.cpp | 14 | ||||
| -rw-r--r-- | src/core/debugger/gdbstub_arch.h | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/core/debugger/gdbstub_arch.cpp b/src/core/debugger/gdbstub_arch.cpp index b13c473bb..f3dd517bd 100644 --- a/src/core/debugger/gdbstub_arch.cpp +++ b/src/core/debugger/gdbstub_arch.cpp | |||
| @@ -41,9 +41,8 @@ static void PutSIMDRegister(std::array<u32, 64>& simd_regs, size_t offset, const | |||
| 41 | 41 | ||
| 42 | // For sample XML files see the GDB source /gdb/features | 42 | // For sample XML files see the GDB source /gdb/features |
| 43 | // This XML defines what the registers are for this specific ARM device | 43 | // This XML defines what the registers are for this specific ARM device |
| 44 | std::string GDBStubA64::GetTargetXML() const { | 44 | constexpr std::string_view GDBStubA64::GetTargetXML() const { |
| 45 | constexpr static const char* target_xml = | 45 | return R"(<?xml version="1.0"?> |
| 46 | R"(<?xml version="1.0"?> | ||
| 47 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> | 46 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> |
| 48 | <target version="1.0"> | 47 | <target version="1.0"> |
| 49 | <architecture>aarch64</architecture> | 48 | <architecture>aarch64</architecture> |
| @@ -178,8 +177,6 @@ std::string GDBStubA64::GetTargetXML() const { | |||
| 178 | <reg name="fpcr" bitsize="32"/> | 177 | <reg name="fpcr" bitsize="32"/> |
| 179 | </feature> | 178 | </feature> |
| 180 | </target>)"; | 179 | </target>)"; |
| 181 | |||
| 182 | return target_xml; | ||
| 183 | } | 180 | } |
| 184 | 181 | ||
| 185 | std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const { | 182 | std::string GDBStubA64::RegRead(const Kernel::KThread* thread, size_t id) const { |
| @@ -270,9 +267,8 @@ u32 GDBStubA64::BreakpointInstruction() const { | |||
| 270 | return 0xd4200000; | 267 | return 0xd4200000; |
| 271 | } | 268 | } |
| 272 | 269 | ||
| 273 | std::string GDBStubA32::GetTargetXML() const { | 270 | constexpr std::string_view GDBStubA32::GetTargetXML() const { |
| 274 | constexpr static const char* target_xml = | 271 | return R"(<?xml version="1.0"?> |
| 275 | R"(<?xml version="1.0"?> | ||
| 276 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> | 272 | <!DOCTYPE target SYSTEM "gdb-target.dtd"> |
| 277 | <target version="1.0"> | 273 | <target version="1.0"> |
| 278 | <architecture>arm</architecture> | 274 | <architecture>arm</architecture> |
| @@ -378,8 +374,6 @@ std::string GDBStubA32::GetTargetXML() const { | |||
| 378 | <reg name="fpscr" bitsize="32" type="int" group="float" regnum="80"/> | 374 | <reg name="fpscr" bitsize="32" type="int" group="float" regnum="80"/> |
| 379 | </feature> | 375 | </feature> |
| 380 | </target>)"; | 376 | </target>)"; |
| 381 | |||
| 382 | return target_xml; | ||
| 383 | } | 377 | } |
| 384 | 378 | ||
| 385 | std::string GDBStubA32::RegRead(const Kernel::KThread* thread, size_t id) const { | 379 | std::string GDBStubA32::RegRead(const Kernel::KThread* thread, size_t id) const { |
diff --git a/src/core/debugger/gdbstub_arch.h b/src/core/debugger/gdbstub_arch.h index 2540d6456..1958fdf88 100644 --- a/src/core/debugger/gdbstub_arch.h +++ b/src/core/debugger/gdbstub_arch.h | |||
| @@ -16,7 +16,7 @@ namespace Core { | |||
| 16 | class GDBStubArch { | 16 | class GDBStubArch { |
| 17 | public: | 17 | public: |
| 18 | virtual ~GDBStubArch() = default; | 18 | virtual ~GDBStubArch() = default; |
| 19 | virtual std::string GetTargetXML() const = 0; | 19 | virtual constexpr std::string_view GetTargetXML() const = 0; |
| 20 | virtual std::string RegRead(const Kernel::KThread* thread, size_t id) const = 0; | 20 | virtual std::string RegRead(const Kernel::KThread* thread, size_t id) const = 0; |
| 21 | virtual void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const = 0; | 21 | virtual void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const = 0; |
| 22 | virtual std::string ReadRegisters(const Kernel::KThread* thread) const = 0; | 22 | virtual std::string ReadRegisters(const Kernel::KThread* thread) const = 0; |
| @@ -27,7 +27,7 @@ public: | |||
| 27 | 27 | ||
| 28 | class GDBStubA64 final : public GDBStubArch { | 28 | class GDBStubA64 final : public GDBStubArch { |
| 29 | public: | 29 | public: |
| 30 | std::string GetTargetXML() const override; | 30 | constexpr std::string_view GetTargetXML() const override; |
| 31 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; | 31 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; |
| 32 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; | 32 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; |
| 33 | std::string ReadRegisters(const Kernel::KThread* thread) const override; | 33 | std::string ReadRegisters(const Kernel::KThread* thread) const override; |
| @@ -47,7 +47,7 @@ private: | |||
| 47 | 47 | ||
| 48 | class GDBStubA32 final : public GDBStubArch { | 48 | class GDBStubA32 final : public GDBStubArch { |
| 49 | public: | 49 | public: |
| 50 | std::string GetTargetXML() const override; | 50 | constexpr std::string_view GetTargetXML() const override; |
| 51 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; | 51 | std::string RegRead(const Kernel::KThread* thread, size_t id) const override; |
| 52 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; | 52 | void RegWrite(Kernel::KThread* thread, size_t id, std::string_view value) const override; |
| 53 | std::string ReadRegisters(const Kernel::KThread* thread) const override; | 53 | std::string ReadRegisters(const Kernel::KThread* thread) const override; |