This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]