public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jifl@eCosCentric.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sources.redhat.com
Subject: Re: Thread backtrace termination
Date: Tue, 12 Jul 2005 18:32:00 -0000	[thread overview]
Message-ID: <42D40C9D.7070204@eCosCentric.com> (raw)
In-Reply-To: <20050711181907.GA4551@nevyn.them.org>

Daniel Jacobowitz wrote:
> On Mon, Jul 11, 2005 at 06:52:13PM +0100, Jonathan Larmour wrote:
> 
>>Daniel Jacobowitz wrote:
>>
>>>On Mon, Jul 11, 2005 at 05:20:55PM +0100, Jonathan Larmour wrote:
>>>
>>>
>>>>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.
[snip]
> The error is caught in the top level code for the backtrace command;
> that effectively downgrades it to a warning and backtrace termination.

Ah ok, thanks.

>>BTW, my other web searches seem to indicate that a fair few (naive) people 
>>are thinking they are having stack corruption because GDB thinks there 
>>might be. That's unfortunate.
> 
> 
> What else would you suggest?  GDB is confused.  From its point of view,
> the stack _is_ corrupt.

It's possibly alarmist, but it's no big deal.

> Well, the patch was:[snip]
> You can find the discussion and sample use on gdb@ a month or two
> earlier.

Aha, yes, at 
http://sources.redhat.com/ml/gdb-patches/2005-03/msg00047.html and friends.

That seems interesting but somewhat unwieldy, and as you said before, 
wouldn't apply to compiler generated code.

>>>For compiler-generated code there's really no useful way to do this.
>>
>>I guess atleast now I know that, which saves me spending more time.
>>
>>Wouldn't it make sense to make such a convention though, such as having a 
>>return address of 0?
> 
> 
> This is basically a convention.  You could, I suppose, patch a compiler
> to generate it.  I'm not sure that would be wise.

If someone were to come up with an __attribute__ that could be used with 
GCC to mark functions to be annotated this way, it might be possible. But 
it's beyond me (or at least, beyond what I have time to get up to speed 
with) and I doubt anyone else will be that interested. Ho hum.

>>Alternatively, how about adding a new command that allows you to define a 
>>set of entry point symbol names? People can then put an appropriate list 
>>for themselves or their OS in ~/.gdbinit. Or it can be pre-initialised by 
>>the OS support within GDB if there is one. e.g. nm-linux.h. Here's what 
>>I'm thinking of:
>>
>>set entry-point-name-list main _start _entry
>>
>>Although handling mangled symbols and multiple languages might be fun. I'm 
>>not an expert on such things.
> 
> 
> *shrug* maybe.

Well, I'm prepared to create a patch to add such a command if people here 
think something with that principle would be accepted.

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-12 18:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-11 16:21 Jonathan Larmour
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 [this message]
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=42D40C9D.7070204@eCosCentric.com \
    --to=jifl@ecoscentric.com \
    --cc=drow@false.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).