Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: adeeshah <asgher.adeel@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: How to check that GDB is going to make a longjmp?
Date: Wed, 07 Sep 2011 09:33:00 -0000	[thread overview]
Message-ID: <CAPftXUK8QDOnpCDV+fubL2hRzUBwFH=YvMX-=__+bBcseNxYrQ@mail.gmail.com> (raw)
In-Reply-To: <32414505.post@talk.nabble.com>

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.
>


  reply	other threads:[~2011-09-07  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07  9:10 adeeshah
2011-09-07  9:33 ` Kevin Pouget [this message]
2011-09-13 13:28   ` adeeshah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPftXUK8QDOnpCDV+fubL2hRzUBwFH=YvMX-=__+bBcseNxYrQ@mail.gmail.com' \
    --to=kevin.pouget@gmail.com \
    --cc=asgher.adeel@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox