From bf15cbda5419893123f50ba99a8e49e73bcfd29f Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Thu, 8 Sep 2011 22:38:29 +0000 Subject: [PATCH] * linux-x86-low.c (i386_emit_prologue): Save %ebx. (i386_emit_epilogue): Restore %ebx. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-x86-low.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 8fd3f2a8a60..91fee1a6b52 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2011-09-08 Stan Shebs + + * linux-x86-low.c (i386_emit_prologue): Save %ebx. + (i386_emit_epilogue): Restore %ebx. + 2011-08-31 Jie Zhang * server.c (step_thread): Remove definition. diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index dd693795730..8a3a597ebf6 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -2035,7 +2035,8 @@ i386_emit_prologue (void) { EMIT_ASM32 (i386_prologue, "push %ebp\n\t" - "mov %esp,%ebp"); + "mov %esp,%ebp\n\t" + "push %ebx"); /* At this point, the raw regs base address is at 8(%ebp), and the value pointer is at 12(%ebp). */ } @@ -2048,6 +2049,7 @@ i386_emit_epilogue (void) "mov %eax,(%ecx)\n\t" "mov %ebx,0x4(%ecx)\n\t" "xor %eax,%eax\n\t" + "pop %ebx\n\t" "pop %ebp\n\t" "ret"); } -- 2.30.2