diff options
author | polaris- <nagatospam@gmail.com> | 2015-10-04 17:22:31 +0200 |
---|---|---|
committer | polaris- <nagatospam@gmail.com> | 2015-10-04 17:22:31 +0200 |
commit | 42928659e8d4ff4edffc36acabe3d9040dbc1326 (patch) | |
tree | 96434bbd4878b9a1a6944cc287463d641e56368e /src/core/gdbstub | |
parent | Toggle use_gdbstub in citra GLFW (diff) | |
download | yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar.gz yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar.bz2 yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar.lz yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar.xz yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.tar.zst yuzu-42928659e8d4ff4edffc36acabe3d9040dbc1326.zip |
Diffstat (limited to 'src/core/gdbstub')
-rw-r--r-- | src/core/gdbstub/gdbstub.cpp | 13 | ||||
-rw-r--r-- | src/core/gdbstub/gdbstub.h | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index ced1c54f5..25ce63b29 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -231,13 +231,18 @@ static void RemoveBreakpoint(BreakpointType type, PAddr addr) { } } -PAddr GetNextBreakpointFromAddress(PAddr addr, BreakpointType type) { +BreakpointAddress GetNextBreakpointFromAddress(PAddr addr, BreakpointType type) { std::map<u32, Breakpoint>& p = GetBreakpointList(type); auto next_breakpoint = p.lower_bound(addr); - u32 breakpoint = -1; + BreakpointAddress breakpoint; - if (next_breakpoint != p.end()) - breakpoint = next_breakpoint->first; + if (next_breakpoint != p.end()) { + breakpoint.address = next_breakpoint->first; + breakpoint.type = type; + } else { + breakpoint.address = 0; + breakpoint.type = BreakpointType::None; + } return breakpoint; } diff --git a/src/core/gdbstub/gdbstub.h b/src/core/gdbstub/gdbstub.h index 11ff823c3..da238f349 100644 --- a/src/core/gdbstub/gdbstub.h +++ b/src/core/gdbstub/gdbstub.h @@ -18,6 +18,11 @@ enum class BreakpointType { Access ///< Access (R/W) Breakpoint }; +struct BreakpointAddress { + PAddr address; + BreakpointType type; +}; + /// If set to false, the server will never be started and no gdbstub-related functions will be executed. extern std::atomic<bool> g_server_enabled; @@ -63,7 +68,7 @@ void HandlePacket(); * @param addr Address to search from. * @param type Type of breakpoint. */ -PAddr GetNextBreakpointFromAddress(u32 addr, GDBStub::BreakpointType type); +BreakpointAddress GetNextBreakpointFromAddress(u32 addr, GDBStub::BreakpointType type); /** * Check if a breakpoint of the specified type exists at the given address. |