public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Folkert van Heusden <folkert@vanheusden.com>
Cc: gdb@sourceware.org
Subject: Re: gdb and threads
Date: Fri, 13 Apr 2012 13:07:00 -0000	[thread overview]
Message-ID: <20120413130734.GA22952@host2.jankratochvil.net> (raw)
In-Reply-To: <CAFDOyVAAdzAoQd85kTgMAw581noH1hbx8fgs0MfCCe0LDTLLng@mail.gmail.com>

On Thu, 12 Apr 2012 11:44:26 +0200, Folkert van Heusden wrote:
> Now when my program gets a SIGSEGV, I can use 'bt' in gdb to get a backtrace.
> Can I be sure that the backtrace I get is the one from the thread
> causing the SIGSEGV?

Assuming GDB default mode, not async/non-stop modes.

With live process yes.  But be aware multiple threads may segfault "at once".

With core files it depends which thread is put first in the core file, with
Linux kernel in practice it works, I do not know guarantees of it in Linux
kernel.


Regards,
Jan

  reply	other threads:[~2012-04-13 13:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12  9:44 Folkert van Heusden
2012-04-13 13:07 ` Jan Kratochvil [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-26 17:39 GDB " Jiva DeVoe
2001-04-26 21:00 ` Jeffrey W. Baker
2001-04-30 18:32 ` Kevin Buettner
2001-04-30 18:46   ` Jiva DeVoe
2001-04-30 18:54   ` Jiva DeVoe

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=20120413130734.GA22952@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=folkert@vanheusden.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).