Skip to contentSkip to conversation

Document how x86 gdb_num_core_regs is computed.

PATCH Applied Doug Evans 2 participants 2 messages Nov 3, 2016 – Nov 8, 2016

lore
Share & tools
lore

Doug Evans

author
#0 lore raw

PATCH 1/1 Document how x86 gdb_num_core_regs is computed.

Hi.

It helps when reading the code to see how the number is arrived at.

---
 target-i386/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target-i386/cpu.c +2 -0
index 14c5186..01f1ab0 100644
@@ -3721,6 +3721,8 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data)
     cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote;
     cc->vmsd = &vmstate_x86_cpu;
 #endif
+    /* CPU_NB_REGS * 2 = general regs + xmm regs
+       25 = eip, eflags, 6 seg regs, st[0-7], fctrl,...,fop, mxcsr */
     cc->gdb_num_core_regs = CPU_NB_REGS * 2 + 25;
 #ifndef CONFIG_USER_ONLY
     cc->debug_excp_handler = breakpoint_handler;
#1 lore raw
Quoted 22 lines · Doug Evans

Hi.

It helps when reading the code to see how the number is arrived at.

---
 target-i386/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target-i386/cpu.c +2 -0
index 14c5186..01f1ab0 100644
@@ -3721,6 +3721,8 @@ static void x86_cpu_common_class_init(ObjectClass
 *oc, void *data)
     cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote;
     cc->vmsd = &vmstate_x86_cpu;
 #endif
+    /* CPU_NB_REGS * 2 = general regs + xmm regs
+       25 = eip, eflags, 6 seg regs, st[0-7], fctrl,...,fop, mxcsr */
     cc->gdb_num_core_regs = CPU_NB_REGS * 2 + 25;
 #ifndef CONFIG_USER_ONLY
Quoted 4 lines
     cc->debug_excp_handler = breakpoint_handler;

Queued for 2.8, thanks.

Paolo