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 Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
3ds.h Move screen size constants from video_core to core 2017-05-27 18:41:24 -07:00
announce_multiplayer_session.cpp core, web_service: Changes to announce service 2018-12-15 11:02:52 +08:00
announce_multiplayer_session.h core, web_service: Changes to announce service 2018-12-15 11:02:52 +08:00
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 CoreTiming: wrap into class 2018-11-04 10:26:38 -05:00
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 Prefix all size_t with std:: 2018-09-06 16:03:28 -04:00
movie.cpp remove all occurance of specifying endianness inside BitField 2019-01-28 22:09:43 -05:00
movie.h movie: fix default value in StartPlayback 2018-09-30 14:26:38 +08:00
perf_stats.cpp core, citra_qt: add frame advancing to framelimiter 2018-10-02 07:28:58 +08:00
perf_stats.h core, citra_qt: add frame advancing to framelimiter 2018-10-02 07:28:58 +08:00
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 compatdb: Use a seperate endpoint for testcase submission 2018-10-27 12:20:03 +02:00