public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] GDB's stack trace.
@ 2000-01-20 20:43 Patrick O'Grady
  2000-01-21  0:24 ` Bob Koninckx
  2000-01-21  9:53 ` Jonathan Larmour
  0 siblings, 2 replies; 4+ messages in thread
From: Patrick O'Grady @ 2000-01-20 20:43 UTC (permalink / raw)
  To: ecos-discuss

Hi, all--

Does anyone out there know what tells GDB that it's at the top of the
stack during a back-trace?  Whenever I 'bt' a stopped thread, I get
legtimate stack data followed by a bunch of junk...  somehow GDB gets told
when the stack ends--anyone know how this is done?  Thanks in advance..

-patrick
patrick@softprocess.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] GDB's stack trace.
  2000-01-20 20:43 [ECOS] GDB's stack trace Patrick O'Grady
@ 2000-01-21  0:24 ` Bob Koninckx
  2000-01-21  9:58   ` Patrick O'Grady
  2000-01-21  9:53 ` Jonathan Larmour
  1 sibling, 1 reply; 4+ messages in thread
From: Bob Koninckx @ 2000-01-21  0:24 UTC (permalink / raw)
  To: Patrick O'Grady; +Cc: ecos-discuss

Patrick O'Grady wrote:
> 
> Hi, all--
> 
> Does anyone out there know what tells GDB that it's at the top of the
> stack during a back-trace?  Whenever I 'bt' a stopped thread, I get
> legtimate stack data followed by a bunch of junk...  somehow GDB gets told
> when the stack ends--anyone know how this is done?  Thanks in advance..
> 
> -patrick
> patrick@softprocess.com
If I am not mistaking, GDB decides that it reached the top of the stack
as soon as it sees a "terminating stack record", that is, a stack record
that has no valid (0x0000000) backchain and return address anymore.

Are you sure that the stack is correctly initialised before entering the
new thread ?? I suppose that a terminating stack record must be present
before the call to the thread entry point. This way, the entry will be
seen as the last call on that stack.

Hope this helps,

Bob
-- 
----------------------------------------------------------------------- 
 ir. Bob Koninckx
 Katholieke Universiteit Leuven       
 Division Production Engineering,     tel.  +32 16 322535
 Machine Design and Automation        fax.  +32 16 322987
 Celestijnenlaan 300B                 bob.koninckx@mech.kuleuven.ac.be
 B-3001 Leuven Belgium
 http://www.mech.kuleuven.ac.be/pma.html
-----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] GDB's stack trace.
  2000-01-20 20:43 [ECOS] GDB's stack trace Patrick O'Grady
  2000-01-21  0:24 ` Bob Koninckx
@ 2000-01-21  9:53 ` Jonathan Larmour
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Larmour @ 2000-01-21  9:53 UTC (permalink / raw)
  To: Patrick O'Grady; +Cc: ecos-discuss

Patrick O'Grady wrote:
> 
> Does anyone out there know what tells GDB that it's at the top of the
> stack during a back-trace?  Whenever I 'bt' a stopped thread, I get
> legtimate stack data followed by a bunch of junk...  somehow GDB gets told
> when the stack ends--anyone know how this is done?  Thanks in advance..

We've had problems sometimes with this, mostly due to the compiler
optimizing the function prolog. Which target and tools version (gcc, gdb and
binutils) are you using?

Jifl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] GDB's stack trace.
  2000-01-21  0:24 ` Bob Koninckx
@ 2000-01-21  9:58   ` Patrick O'Grady
  0 siblings, 0 replies; 4+ messages in thread
From: Patrick O'Grady @ 2000-01-21  9:58 UTC (permalink / raw)
  To: Bob Koninckx; +Cc: ecos-discuss

Hi, Bob--

Your suggestion worked great: I modified the function which initialized
the stack to include a few extra 0's at the top of the stack...  now the
stack traces come out perfectly.  Thanks for your advice!

-patrick


On Fri, 21 Jan 2000, Bob Koninckx wrote:

> Patrick O'Grady wrote:
> > 
> > Hi, all--
> > 
> > Does anyone out there know what tells GDB that it's at the top of the
> > stack during a back-trace?  Whenever I 'bt' a stopped thread, I get
> > legtimate stack data followed by a bunch of junk...  somehow GDB gets told
> > when the stack ends--anyone know how this is done?  Thanks in advance..
> > 
> > -patrick
> > patrick@softprocess.com
> If I am not mistaking, GDB decides that it reached the top of the stack
> as soon as it sees a "terminating stack record", that is, a stack record
> that has no valid (0x0000000) backchain and return address anymore.
> 
> Are you sure that the stack is correctly initialised before entering the
> new thread ?? I suppose that a terminating stack record must be present
> before the call to the thread entry point. This way, the entry will be
> seen as the last call on that stack.
> 
> Hope this helps,
> 
> Bob
> -- 
> ----------------------------------------------------------------------- 
>  ir. Bob Koninckx
>  Katholieke Universiteit Leuven       
>  Division Production Engineering,     tel.  +32 16 322535
>  Machine Design and Automation        fax.  +32 16 322987
>  Celestijnenlaan 300B                 bob.koninckx@mech.kuleuven.ac.be
>  B-3001 Leuven Belgium
>  http://www.mech.kuleuven.ac.be/pma.html
> -----------------------------------------------------------------------
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-01-21  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-20 20:43 [ECOS] GDB's stack trace Patrick O'Grady
2000-01-21  0:24 ` Bob Koninckx
2000-01-21  9:58   ` Patrick O'Grady
2000-01-21  9:53 ` Jonathan Larmour

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