Cemu/src/Cafe/OS/libs
Crementif 6d75776b28
Add GDB stub for debugging (#657)
* Implement GDB stub debugger

Can be enabled by using the "--enable-gdbstub" option (and the debugger GUI, although that's untested) which'll pause any game you launch at start-up. Will start at port 1337 although it'll eventually be user-editable. The code is a bit weirdly sorted and also just needs a general cleanup, so expect that eventually too. And uses egyptian braces but formatting was easier to do at the end, so that's also something to do.

It has been tested to work with IDA Pro, Clion and the standalone interface for now, but I plan on writing some instructions in the PR to follow for people who want to use this. Memory breakpoints aren't possible yet, only execution breakpoints.

This code was aimed to be decoupled from the existing debugger to be able to be ported to the Wii U for an equal debugging experience. That's also why it uses the Cafe OS's thread sleep and resuming functions whenever possible instead of using recompiler/interpreter controls.

* Add memory writing and floating point registers support

* Reformat code a bit

* Format code to adhere to Cemu's coding style

* Rework GDB Stub settings in GUI

* Small styling fixes

* Rework execution breakpoints

Should work better in some edge cases now. But this should also allow for adding access breakpoints since it's now more separated.

* Implement access breakpoints

* Fix some issues with breakpoints

* Fix includes for Linux

* Fix unnecessary include

* Tweaks for Linux compatibility

* Use std::thread instead of std::jthread to fix MacOS support

* Enable GDB read/write breakpoints on x86 only

* Fix compilation for GCC compilers at least

The thread type varies on some platforms, so supporting this is hell... but let's get it to compile on MacOS first.

* Disable them for MacOS due to lack of ptrace

---------

Co-authored-by: Exzap <13877693+Exzap@users.noreply.github.com>
2023-02-19 15:41:49 +01:00
..
avm Add all the files 2022-08-22 22:21:23 +02:00
camera Add all the files 2022-08-22 22:21:23 +02:00
coreinit Add GDB stub for debugging (#657) 2023-02-19 15:41:49 +01:00
dmae Add all the files 2022-08-22 22:21:23 +02:00
drmapp Add all the files 2022-08-22 22:21:23 +02:00
erreula ImGui: match all begin()/end() (#470) 2022-11-09 02:45:40 +01:00
gx2 Code clean up + replace some wstring instances with utf8 (#640) 2023-01-29 13:53:31 +01:00
h264_avc memory optimization, using posix_memalign (#350) 2022-10-09 10:43:45 +02:00
mic Implement proper microphone support (#251) 2022-11-03 00:24:34 +01:00
nlibcurl Enable online features for Unix (#486) 2022-11-15 17:03:46 +01:00
nlibnss Add all the files 2022-08-22 22:21:23 +02:00
nn_ac Add all the files 2022-08-22 22:21:23 +02:00
nn_acp Rename path _utf8Wrapper to _utf8ToPath for better clarity 2022-09-09 23:49:38 +02:00
nn_act nn_act: Fix account endianness (#141) 2022-09-02 09:46:19 +02:00
nn_aoc Separate filestream.h into OS specific implementation files (#190) 2022-09-07 02:42:25 +02:00
nn_boss Add all the files 2022-08-22 22:21:23 +02:00
nn_ccr Add all the files 2022-08-22 22:21:23 +02:00
nn_cmpt Add all the files 2022-08-22 22:21:23 +02:00
nn_ec Add all the files 2022-08-22 22:21:23 +02:00
nn_fp Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287) 2022-09-24 08:43:27 +02:00
nn_idbe Fix various compiler warnings and update OpenSSL hash functions (#119) 2022-08-30 09:27:25 +02:00
nn_ndm Add all the files 2022-08-22 22:21:23 +02:00
nn_nfp nfp: Fix corruption, correct structs and use write counters (#310) 2022-09-29 13:00:46 +02:00
nn_nim Add all the files 2022-08-22 22:21:23 +02:00
nn_olv Add all the files 2022-08-22 22:21:23 +02:00
nn_pdm Add all the files 2022-08-22 22:21:23 +02:00
nn_save Initial macOS port bringup (#52) 2022-08-26 04:03:26 +02:00
nn_temp Code clean up + replace some wstring instances with utf8 (#640) 2023-01-29 13:53:31 +01:00
nn_uds Add all the files 2022-08-22 22:21:23 +02:00
nsyshid Code clean up + replace some wstring instances with utf8 (#640) 2023-01-29 13:53:31 +01:00
nsyskbd Add all the files 2022-08-22 22:21:23 +02:00
nsysnet Add GDB stub for debugging (#657) 2023-02-19 15:41:49 +01:00
padscore Logging: Add TextureReadback logtype and clean up code 2023-01-27 09:57:10 +00:00
proc_ui Add all the files 2022-08-22 22:21:23 +02:00
snd_core Make controller button code thread-safe (#405) 2022-10-23 15:47:42 +02:00
snd_user Add all the files 2022-08-22 22:21:23 +02:00
swkbd Add check for backwards delete (#564) 2022-12-09 18:01:08 +01:00
sysapp Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287) 2022-09-24 08:43:27 +02:00
TCL Add all the files 2022-08-22 22:21:23 +02:00
vpad Logging: Add TextureReadback logtype and clean up code 2023-01-27 09:57:10 +00:00
zlib125 Add all the files 2022-08-22 22:21:23 +02:00
nn_common.h Add all the files 2022-08-22 22:21:23 +02:00