Commit Graph

26 Commits

Author SHA1 Message Date
RichardG867
3b47f0590c gdbstub: Fix another Win32 threading deadlock 2024-08-22 15:45:32 -03:00
RichardG867
8d88d187b2 gdbstub: Work around Win32 threading behavior 2024-08-22 14:21:36 -03:00
Jasmine Iwanek
fde5606799 Fix compilation when building the GDB stub 2024-08-07 01:07:52 -04:00
RichardG867
f247fa84ac gdbstub: Don't reload CS on jump 2024-07-13 19:17:48 -03:00
Jasmine Iwanek
f6a5229a98 Future support for higher clocked CPU's 2023-10-13 17:55:18 -04:00
richardg867
b0cb094590 gdbstub: Small fixes to breakpoints and watches 2023-10-05 14:04:05 -03:00
Davidson Francis
4bde11c290 GDB stub small fixes: out-of-bounds and wrong packet reply in 'qfThreadInfo' (#3666)
* Fix out-of-bounds access on gdbstub_client_respond()

The issue happens when the ENABLE_GDBSTUB_LOG flag is set, more
specifically within the gdbstub_client_respond() function. This is
due to the fact that the string 'GDB Stub: Sending response: ' and
the newline character '\n' total 29 characters. When combined with
the 995 characters of client->response, the total is 1024 bytes.
However, the pclog_ex() buffer size is also 1024 bytes, leaving no
room for the null terminator '\0'. As a result, when attempting to
print the text on the screen, a segmentation fault occurs.

This commit fixes this by decreasing the response text's size by one
byte.

* Remove extra space in 'qfThreadInfo' packet response in gdbstub.c

When GDB sends the 'qfThreadInfo' packet, one of the possible responses
is 'm thread-id', as specified in [1]. However, contrary to what the
documentation implies, there is no space between 'm' and the thread-id.
In the current approach, GDB isn't even able to recognize that there's
any active thread, as the code sends "m 1" instead of "m1".

This commit addresses this by removing the space in the response.

Ref:
[1]: https://sourceware.org/gdb/onlinedocs/gdb/General-Query-Packets.html
2023-08-31 14:11:27 -03:00
Davidson Francis
68b6a58cc2 Bug Fix: Fix GDB stub builds due to undeclared symbol
This commit fixes a build issue that occurred when compiling with
GDBSTUB support (-DGDBSTUB=ON). The issue was introduced in commit
565421a, which commented out the GDB_REG_FS_BASE and GDB_REG_GS_BASE
registers, but did not remove the code snippets that referenced them
in gdbstub_client_write_reg(). This commit comments out those code
snippets as well.

Additionally, this commit removes the fs_base and gs_base registers
from the XML file, to ensure the correct numbering of the registers
for the GDB.
2023-08-30 00:37:30 -03:00
OBattler
565421a252 Serial receive/transmit rework (uses the new fifo.c API) and a small GDB stub fix. 2023-08-18 05:57:32 +02:00
RichardG867
481e48a917 gdbstub: Proper size_t format string 2023-08-09 17:21:48 -03:00
Jasmine Iwanek
998cfe5cc8 Constification 2023-07-25 17:59:24 -04:00
Jasmine Iwanek
ee695e71f9 More sonarlint work 2023-07-25 17:59:22 -04:00
Jasmine Iwanek
6c1e4a8e2c Some code smell fixes from sonarlint 2023-05-15 19:25:56 -04:00
Cacodemon345
c2af203029 gdbstub: explicitly define FS_BASE and GS_BASE in features description 2022-12-23 21:53:22 +06:00
OBattler
dc1dff8211 GDB stub fixes so it compiles again. 2022-12-15 22:23:43 +01:00
Jasmine Iwanek
e6dbaefeb1 clang-format in src/ 2022-09-18 17:19:21 -04:00
Jasmine Iwanek
5e0c1ac209 Gdbstub, Minitrace and more (#2653)
* Fix gdbstub compilation

* Fix minitrace compilation

* Fix many warnings on Linux Builds

* Support DirectInput for Joysticks in QT UI too
2022-08-31 18:35:32 -03:00
RichardG867
7702d05a10 gdbstub: Add IDA optimized mode 2022-08-18 17:22:59 -03:00
Cacodemon345
8dae24e2c4 gdbstub: Implement 'qsThreadInfo/qfThreadInfo' query 2022-07-11 00:43:00 +06:00
richardg867
51f8cb3634 gdbstub: Protocol fixes and improvements, IDA now works properly 2022-06-19 01:08:34 -03:00
David Hrdlička
e60af6c29d Clean up plat.h a bit 2022-04-20 01:03:39 +02:00
Didiet
100eaf70ee Fixing GdbStub Code to make it compiled with Clang (#2292)
- Fix the switch scoping preventing declaration
- Adding stdint.h as inclusion to make uint*_t works
2022-04-16 03:12:38 -03:00
RichardG867
64c38a2334 GDB Stub: Fix header indentation 2022-03-17 15:49:24 -03:00
RichardG867
fd6646f21b Run clang-format on all my new code 2022-03-16 14:12:45 -03:00
RichardG867
f57cbe36b1 GDB Stub: More progress 2022-03-16 00:33:01 -03:00
RichardG867
94be8cdfc6 GDB Stub: Initial commit 2022-03-12 20:20:25 -03:00