This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix register corruption with conditional fast tracepoints in GDBserver
- From: Stan Shebs <stanshebs at earthlink dot net>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 08 Sep 2011 15:07:48 -0700
- Subject: [PATCH] Fix register corruption with conditional fast tracepoints in GDBserver
On i386 targets, compiled bytecodes for the conditional of a fast
tracepoint use the %eax/%ebx register pair to manipulate 64-bit values.
While %eax is assumed to be overwritten because it is the result return
register, %ebx needs to be saved because the caller (which is
GDBserver's condition_true_at_tracepoint) may be using it, and in fact
this seems to have started happening at some point, causing mystifying
crashes.
The fix is simple, just add a push/pop to prologue/epilogue. I'm
committing this as "fairly obvious" :-) - the semi-complicated test case
that exposed this bug is coming in a separate patch.
Stan
stan@codesourcery.com
2011-09-08 Stan Shebs <stan@codesourcery.com>
* linux-x86-low.c (i386_emit_prologue): Save %ebx.
(i386_emit_epilogue): Restore %ebx.
Attachment:
ebx-patch-1
Description: Text document