citra/src/core
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
..
arm 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
cheats core/cheats: Add and change a few functions 2019-02-02 08:15:23 +08:00
file_sys Merge pull request #4618 from wwylele/fs-clean 2019-03-04 12:34:54 -05:00
frontend Merge pull request #4666 from FearlessTobi/port-2167 2019-03-07 23:52:42 -05:00
gdbstub 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
hle Merge pull request #4666 from FearlessTobi/port-2167 2019-03-07 23:52:42 -05:00
hw common/vector_math: Move Vec[x] types into the Common namespace 2019-03-02 15:04:13 +01:00
loader Kernel: wrap resource limit state into kernel state; pass ref to resource limit 2018-10-18 21:41:36 -04:00
rpc rpc: send ending packet in Server instead of UDPServer 2019-03-04 11:05:07 -05:00
tracer
3ds.h
announce_multiplayer_session.cpp
announce_multiplayer_session.h
CMakeLists.txt Remove scripting switch in cmake 2019-02-02 15:25:23 -05:00
core.cpp ARM: pass MemorySystem separately in the constructor and make System optional 2019-02-14 14:04:46 -05:00
core.h ARM: pass MemorySystem separately in the constructor and make System optional 2019-02-14 14:04:46 -05:00
core_timing.cpp
core_timing.h threadsafe_queue: Remove NeedSize template parameter 2019-02-15 22:00:44 +01:00
memory.cpp Merge pull request #4630 from wwylele/memory-no-lock 2019-02-25 10:23:23 -05:00
memory.h Memory: replace Core::CPU 2019-02-14 14:04:46 -05:00
mmio.h
movie.cpp remove all occurance of specifying endianness inside BitField 2019-01-28 22:09:43 -05:00
movie.h
perf_stats.cpp
perf_stats.h
settings.cpp sdl: add GLES support 2019-02-03 15:58:09 -06:00
settings.h sdl: add GLES support 2019-02-03 15:58:09 -06:00
telemetry_session.cpp Merge pull request #4579 from xperia64/3d_slider 2019-01-23 20:23:55 -05:00
telemetry_session.h