Lime3DS/src
Dimitri A acaca4188e gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to let watchpoints break into GDB. (#4651)
* gdbstub: fix IsMemoryBreak() returning false while connected to client

As a result, the only existing codepath for a memory watchpoint hit to break into GDB (InterpeterMainLoop, GDB_BP_CHECK, ARMul_State::RecordBreak) is finally taken,
which exposes incorrect logic* in both RecordBreak and ServeBreak.

* a blank BreakpointAddress structure is passed, which sets r15 (PC) to NULL

* gdbstub: DynCom: default-initialize two members/vars used in conditionals

* gdbstub: DynCom: don't record memory watchpoint hits via RecordBreak()

For now, instead check for GDBStub::IsMemoryBreak() in InterpreterMainLoop and ServeBreak.

Fixes PC being set to a stale/unhit breakpoint address (often zero) when a memory watchpoint (rwatch, watch, awatch) is handled in ServeBreak() and generates a GDB trap.

Reasons for removing a call to RecordBreak() for memory watchpoints:
* The``breakpoint_data`` we pass is typed Execute or None. It describes the predicted next code breakpoint hit relative to PC;

* GDBStub::IsMemoryBreak() returns true if a recent Read/Write operation hit a watchpoint. It doesn't specify which in return, nor does it trace it anywhere. Thus, the only data we could give RecordBreak() is a placeholder BreakpointAddress at offset NULL and type Access. I found the idea silly, compared to simply relying on GDBStub::IsMemoryBreak().

There is currently no measure in the code that remembers the addresses (and types) of any watchpoints that were hit by an instruction, in order to send them to GDB as "extended stop information."
I'm considering an implementation for this.

* gdbstub: Change an ASSERT to DEBUG_ASSERT

I have never seen the (Reg[15] == last_bkpt.address) assert fail in practice, even after several weeks of (locally) developping various branches around GDB.  Only leave it inside Debug builds.
2019-03-08 00:09:06 -05:00
..
android android: fix native library inclusion 2019-01-15 20:28:56 -06:00
audio_core audio_core/codec: Resolve truncation warnings within DecodeADPCM 2019-03-02 14:06:30 +01:00
citra sdl: add GLES support 2019-02-03 15:58:09 -06:00
citra_qt Merge pull request #4627 from FearlessTobi/cia-install-short 2019-03-07 23:55:58 -05:00
common common/math_util: Move contents into the Common namespace 2019-03-02 18:13:10 +01:00
core gdbstub: Fix some bugs in IsMemoryBreak() and ServeBreak. Add workaround to let watchpoints break into GDB. (#4651) 2019-03-08 00:09:06 -05:00
dedicated_room network: Make citra mods optional and disabled by default 2018-12-15 22:47:07 +08:00
input_common common/math_util: Move contents into the Common namespace 2019-03-02 18:13:10 +01:00
network network: remove cpp-jwt library dependency 2018-12-31 23:23:09 -05:00
tests Merge pull request #4617 from wwylele/hle-service-clean 2019-02-25 10:22:13 -05:00
video_core common/math_util: Move contents into the Common namespace 2019-03-02 18:13:10 +01:00
web_service web_service: Change endpoint to /lobby. 2018-12-16 10:48:42 +08:00
.clang-format Remove special rules for Windows.h and library includes 2016-09-21 00:16:33 -07:00
CMakeLists.txt android: move cmakelist 2019-01-15 19:24:03 -06:00