From 68b6a58cc2694c913166ad6d8e8a43fc0318093d Mon Sep 17 00:00:00 2001 From: Davidson Francis Date: Wed, 30 Aug 2023 00:34:49 -0300 Subject: [PATCH] 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. --- src/gdbstub.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gdbstub.c b/src/gdbstub.c index 30785eeac..14e75b4e0 100644 --- a/src/gdbstub.c +++ b/src/gdbstub.c @@ -222,8 +222,10 @@ static char target_xml[] = /* QEMU gdb-xml/i386-32bit.xml with modificati "" "" "" +#if 0 "" "" +#endif "" "" "" @@ -548,10 +550,12 @@ gdbstub_client_write_reg(int index, uint8_t *buf) flushmmucache(); break; +#if 0 case GDB_REG_FS_BASE ... GDB_REG_GS_BASE: /* Do what qemu does and just load the base. */ segment_regs[(index - 16) + (GDB_REG_FS - GDB_REG_CS)]->base = *((uint32_t *) buf); break; +#endif case GDB_REG_CR0 ... GDB_REG_CR4: *cr_regs[index - GDB_REG_CR0] = *((uint32_t *) buf);