This is the mail archive of the gdb@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]

Re: How to check that GDB is going to make a longjmp?


I guess you want to catch longjump of the inferior, not GDB itself, right?

One way is to set a breakpoint on the `longjmp' function itself, and
then jump over the function, or enter `return' to return directly from
the function without executing its body.
The content of the jmp_bug depends of your system, so you need to
check your local setjmp.h. For instance, you can see in this µlibC [1]
implementation that they use a buffer to store the relevant CPU
registers, with pre-processor macro.

setjump populates the buffer with the registers, longjmp pushes the
buffer values back to the CPU registers.


Cordially,

Kevin

[1]: http://cristi.indefero.net/p/uClibc-cristi/source/tree/0_9_29_rc1/libc/sysdeps/linux/cris/bits/setjmp.h

On Wed, Sep 7, 2011 at 11:10 AM, adeeshah <asgher.adeel@gmail.com> wrote:
>
> Hi,
>
> I want to avoid the GDB's longjmp. Is there a way to check that GDB is going
> to make a longjmp?
>
> How can i check the contents of jmp_buf?
>
> Adeel.
> --
> View this message in context: http://old.nabble.com/How-to-check-that-GDB-is-going-to-make-a-longjmp--tp32414505p32414505.html
> Sent from the Sourceware - gdb list mailing list archive at Nabble.com.
>


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