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.
This commit is contained in:
Davidson Francis
2023-08-30 00:34:49 -03:00
parent 42ea22e569
commit 68b6a58cc2

View File

@@ -222,8 +222,10 @@ static char target_xml[] = /* QEMU gdb-xml/i386-32bit.xml with modificati
"<reg name=\"fs\" bitsize=\"16\" type=\"int32\"/>" "<reg name=\"fs\" bitsize=\"16\" type=\"int32\"/>"
"<reg name=\"gs\" bitsize=\"16\" type=\"int32\"/>" "<reg name=\"gs\" bitsize=\"16\" type=\"int32\"/>"
"" ""
#if 0
"<reg name=\"fs_base\" bitsize=\"32\" type=\"int32\"/>" "<reg name=\"fs_base\" bitsize=\"32\" type=\"int32\"/>"
"<reg name=\"gs_base\" bitsize=\"32\" type=\"int32\"/>" "<reg name=\"gs_base\" bitsize=\"32\" type=\"int32\"/>"
#endif
"" ""
"<flags id=\"i386_cr0\" size=\"4\">" "<flags id=\"i386_cr0\" size=\"4\">"
"<field name=\"PG\" start=\"31\" end=\"31\"/>" "<field name=\"PG\" start=\"31\" end=\"31\"/>"
@@ -548,10 +550,12 @@ gdbstub_client_write_reg(int index, uint8_t *buf)
flushmmucache(); flushmmucache();
break; break;
#if 0
case GDB_REG_FS_BASE ... GDB_REG_GS_BASE: case GDB_REG_FS_BASE ... GDB_REG_GS_BASE:
/* Do what qemu does and just load the base. */ /* Do what qemu does and just load the base. */
segment_regs[(index - 16) + (GDB_REG_FS - GDB_REG_CS)]->base = *((uint32_t *) buf); segment_regs[(index - 16) + (GDB_REG_FS - GDB_REG_CS)]->base = *((uint32_t *) buf);
break; break;
#endif
case GDB_REG_CR0 ... GDB_REG_CR4: case GDB_REG_CR0 ... GDB_REG_CR4:
*cr_regs[index - GDB_REG_CR0] = *((uint32_t *) buf); *cr_regs[index - GDB_REG_CR0] = *((uint32_t *) buf);