summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/gdbstub/gdbstub.cpp20
-rw-r--r--src/core/gdbstub/gdbstub.h8
2 files changed, 14 insertions, 14 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp
index 75f6b8235..ac53ba752 100644
--- a/src/core/gdbstub/gdbstub.cpp
+++ b/src/core/gdbstub/gdbstub.cpp
@@ -171,7 +171,7 @@ WSADATA InitData;
171 171
172struct Breakpoint { 172struct Breakpoint {
173 bool active; 173 bool active;
174 PAddr addr; 174 VAddr addr;
175 u64 len; 175 u64 len;
176}; 176};
177 177
@@ -181,13 +181,13 @@ static std::map<u64, Breakpoint> breakpoints_write;
181 181
182struct Module { 182struct Module {
183 std::string name; 183 std::string name;
184 PAddr beg; 184 VAddr beg;
185 PAddr end; 185 VAddr end;
186}; 186};
187 187
188static std::vector<Module> modules; 188static std::vector<Module> modules;
189 189
190void RegisterModule(std::string name, PAddr beg, PAddr end, bool add_elf_ext) { 190void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext) {
191 Module module; 191 Module module;
192 if (add_elf_ext) { 192 if (add_elf_ext) {
193 Common::SplitPath(name, nullptr, &module.name, nullptr); 193 Common::SplitPath(name, nullptr, &module.name, nullptr);
@@ -441,7 +441,7 @@ static std::map<u64, Breakpoint>& GetBreakpointList(BreakpointType type) {
441 * @param type Type of breakpoint. 441 * @param type Type of breakpoint.
442 * @param addr Address of breakpoint. 442 * @param addr Address of breakpoint.
443 */ 443 */
444static void RemoveBreakpoint(BreakpointType type, PAddr addr) { 444static void RemoveBreakpoint(BreakpointType type, VAddr addr) {
445 std::map<u64, Breakpoint>& p = GetBreakpointList(type); 445 std::map<u64, Breakpoint>& p = GetBreakpointList(type);
446 446
447 auto bp = p.find(static_cast<u64>(addr)); 447 auto bp = p.find(static_cast<u64>(addr));
@@ -452,7 +452,7 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) {
452 } 452 }
453} 453}
454 454
455BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, BreakpointType type) { 455BreakpointAddress GetNextBreakpointFromAddress(VAddr addr, BreakpointType type) {
456 std::map<u64, Breakpoint>& p = GetBreakpointList(type); 456 std::map<u64, Breakpoint>& p = GetBreakpointList(type);
457 auto next_breakpoint = p.lower_bound(static_cast<u64>(addr)); 457 auto next_breakpoint = p.lower_bound(static_cast<u64>(addr));
458 BreakpointAddress breakpoint; 458 BreakpointAddress breakpoint;
@@ -468,7 +468,7 @@ BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, BreakpointType type)
468 return breakpoint; 468 return breakpoint;
469} 469}
470 470
471bool CheckBreakpoint(PAddr addr, BreakpointType type) { 471bool CheckBreakpoint(VAddr addr, BreakpointType type) {
472 if (!IsConnected()) { 472 if (!IsConnected()) {
473 return false; 473 return false;
474 } 474 }
@@ -975,7 +975,7 @@ static void Continue() {
975 * @param addr Address of breakpoint. 975 * @param addr Address of breakpoint.
976 * @param len Length of breakpoint. 976 * @param len Length of breakpoint.
977 */ 977 */
978static bool CommitBreakpoint(BreakpointType type, PAddr addr, u64 len) { 978static bool CommitBreakpoint(BreakpointType type, VAddr addr, u64 len) {
979 std::map<u64, Breakpoint>& p = GetBreakpointList(type); 979 std::map<u64, Breakpoint>& p = GetBreakpointList(type);
980 980
981 Breakpoint breakpoint; 981 Breakpoint breakpoint;
@@ -1015,7 +1015,7 @@ static void AddBreakpoint() {
1015 1015
1016 auto start_offset = command_buffer + 3; 1016 auto start_offset = command_buffer + 3;
1017 auto addr_pos = std::find(start_offset, command_buffer + command_length, ','); 1017 auto addr_pos = std::find(start_offset, command_buffer + command_length, ',');
1018 PAddr addr = HexToLong(start_offset, static_cast<u64>(addr_pos - start_offset)); 1018 VAddr addr = HexToLong(start_offset, static_cast<u64>(addr_pos - start_offset));
1019 1019
1020 start_offset = addr_pos + 1; 1020 start_offset = addr_pos + 1;
1021 u64 len = 1021 u64 len =
@@ -1064,7 +1064,7 @@ static void RemoveBreakpoint() {
1064 1064
1065 auto start_offset = command_buffer + 3; 1065 auto start_offset = command_buffer + 3;
1066 auto addr_pos = std::find(start_offset, command_buffer + command_length, ','); 1066 auto addr_pos = std::find(start_offset, command_buffer + command_length, ',');
1067 PAddr addr = HexToLong(start_offset, static_cast<u64>(addr_pos - start_offset)); 1067 VAddr addr = HexToLong(start_offset, static_cast<u64>(addr_pos - start_offset));
1068 1068
1069 if (type == BreakpointType::Access) { 1069 if (type == BreakpointType::Access) {
1070 // Access is made up of Read and Write types, so add both breakpoints 1070 // Access is made up of Read and Write types, so add both breakpoints
diff --git a/src/core/gdbstub/gdbstub.h b/src/core/gdbstub/gdbstub.h
index a6b50c26c..5a36524b2 100644
--- a/src/core/gdbstub/gdbstub.h
+++ b/src/core/gdbstub/gdbstub.h
@@ -22,7 +22,7 @@ enum class BreakpointType {
22}; 22};
23 23
24struct BreakpointAddress { 24struct BreakpointAddress {
25 PAddr address; 25 VAddr address;
26 BreakpointType type; 26 BreakpointType type;
27}; 27};
28 28
@@ -53,7 +53,7 @@ bool IsServerEnabled();
53bool IsConnected(); 53bool IsConnected();
54 54
55/// Register module. 55/// Register module.
56void RegisterModule(std::string name, PAddr beg, PAddr end, bool add_elf_ext = true); 56void RegisterModule(std::string name, VAddr beg, VAddr end, bool add_elf_ext = true);
57 57
58/** 58/**
59 * Signal to the gdbstub server that it should halt CPU execution. 59 * Signal to the gdbstub server that it should halt CPU execution.
@@ -74,7 +74,7 @@ void HandlePacket();
74 * @param addr Address to search from. 74 * @param addr Address to search from.
75 * @param type Type of breakpoint. 75 * @param type Type of breakpoint.
76 */ 76 */
77BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, GDBStub::BreakpointType type); 77BreakpointAddress GetNextBreakpointFromAddress(VAddr addr, GDBStub::BreakpointType type);
78 78
79/** 79/**
80 * Check if a breakpoint of the specified type exists at the given address. 80 * Check if a breakpoint of the specified type exists at the given address.
@@ -82,7 +82,7 @@ BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, GDBStub::BreakpointTy
82 * @param addr Address of breakpoint. 82 * @param addr Address of breakpoint.
83 * @param type Type of breakpoint. 83 * @param type Type of breakpoint.
84 */ 84 */
85bool CheckBreakpoint(PAddr addr, GDBStub::BreakpointType type); 85bool CheckBreakpoint(VAddr addr, GDBStub::BreakpointType type);
86 86
87/// If set to true, the CPU will halt at the beginning of the next CPU loop. 87/// If set to true, the CPU will halt at the beginning of the next CPU loop.
88bool GetCpuHaltFlag(); 88bool GetCpuHaltFlag();