Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jonathan Larmour <jifl@eCosCentric.com>
To: gdb@sources.redhat.com
Subject: Thread backtrace termination
Date: Mon, 11 Jul 2005 16:21:00 -0000	[thread overview]
Message-ID: <42D29C67.4070509@eCosCentric.com> (raw)

After a move from GDB 6.1 to GDB 6.3, something new happens with 
backtraces on at least ARM and MIPS, e.g.:

(gdb) bt
#0  breakme () at 
/home/jlarmour/ecos/ecospro-common-040929-branch/packages/kernel/current/tests/thread_gdb.c:108
#1  0xffffffff80021800 in controller (id=0) at 
/home/jlarmour/ecos/ecospro-common-040929-branch/packages/kernel/current/tests/thread_gdb.c:155
#2  0xffffffff8002a550 in Cyg_HardwareThread::thread_entry 
(thread=0x8003d3b0) at 
/home/jlarmour/ecos/ecospro-common-040929-branch/packages/kernel/current/src/common/thread.cxx:110
#3  0xffffffff8002a500 in global constructors keyed to cyg_scheduler_start 
() at 
/home/jlarmour/ecos/ecospro-common-040929-branch/packages/kernel/current/src/common/kapi.cxx:1257
#4  0xffffffff8002a500 in global constructors keyed to cyg_scheduler_start 
() at 
/home/jlarmour/ecos/ecospro-common-040929-branch/packages/kernel/current/src/common/kapi.cxx:1257
Previous frame identical to this frame (corrupt stack?)
(gdb)

The two "global constructors keyed to cyg_scheduler_start" lines are bogus 
frame entries, although those also happened with GDB 6.1. The "corrupt 
stack" whinge is new, and is treated as an error, including terminating 
gdbinit scripts etc.

I tried reverting 
<http://sources.redhat.com/ml/gdb-patches/2004-01/msg00104.html>, but that 
in itself isn't the issue. I know there were a bunch of other dwarf 
unwinder changes for GDB 6.2. But rather than try and explain what I've 
already tried to do, I'd be interested if someone could clarify to me what 
the termination conditions for a backtrace actually _are_. i.e. as an OS 
author, how do I initialise a thread context to persuade GDB to stop when 
it reaches the innermost frame. I've tried looking at the glibc sources to 
see how its thread support works, but it's rather a twisty maze of 
passages, and I don't know whether it would have this problem as well anyway.

One thought I had was if it halted if the saved stack pointer is 0, but 
that presents all sorts of problems for OS implementors, unless thread 
entry functions must now be written in assembler with knowledge of how GDB 
does its unwinding. In trying to create that scenario, I couldn't provoke 
it to affect things anyway.

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine


             reply	other threads:[~2005-07-11 16:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 16:21 Jonathan Larmour [this message]
2005-07-11 16:23 ` Daniel Jacobowitz
2005-07-11 17:52   ` Jonathan Larmour
2005-07-11 18:19     ` Daniel Jacobowitz
2005-07-12 18:32       ` Jonathan Larmour
2005-07-13 10:35         ` Steven Johnson
2005-07-13 12:53           ` GDB is stepping past main() Konstantin Karganov
2005-07-13 13:05             ` Daniel Jacobowitz
2005-07-13 13:31               ` Konstantin Karganov
2005-07-13 13:39                 ` Nathan J. Williams
2005-07-13 13:47                   ` Konstantin Karganov
2005-07-13 13:50                     ` Dave Korn
2005-07-13 13:46                 ` Daniel Jacobowitz
2005-07-13 13:57                   ` Konstantin Karganov
2005-07-14 14:27                   ` MI *stopped reason Konstantin Karganov
2005-07-14 14:40                     ` Bob Rossi
2005-07-14 15:15                     ` Incorrect breakpoint diagnostics in MI Konstantin Karganov

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=42D29C67.4070509@eCosCentric.com \
    --to=jifl@ecoscentric.com \
    --cc=gdb@sources.redhat.com \
    /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