Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- From: RezaRob <RezaRob@xxxxxxxxx>
- Date: Sun, 24 Jun 2007 21:28:52 -0000
On Jun 24, 12:44 pm, David Schwartz <dav...@xxxxxxxxxxxxx> wrote:
On Jun 23, 11:43 pm,RezaRob<Reza...@xxxxxxxxx> wrote:
If I just dump the stack, is there any way to tell gdb to reconstruct
the thing after the fact? For instance, can gcc generate a separate
file similar to the "system.map" file that the kernel uses?
I don't see what you would want 'gdb' for at that point. If you must
do it that way, just write the stack to a file using
__builtin_return_address. It may help to also write out a well-known
address in case the executable has been relocated. You can them
compare those addresses to a symbol table.
Good point about relocation :-) If it helps solve such a potential
issue it's great.
Compile/link the executable with symbols. Run 'nm' on the executable
and save the output. Then strip and ship. If you get a dump file, just
compare the addresses in the file to the ones in your 'nm' output.
I wanted a stack dump + gdb solution, because that can also give me
_some_ idea about the specific function parameters that initiated the
crash. This can help greatly with debugging, and acts more similar to
a kernel oobs, i.e. a very brief "snapshot" of what was happening,
without the disturbing noise.
Are you shipping a dynamically-linked or a statically-linked
executable? If dynamically-linked, I would still try to 'dlsym' the
addresses, because if they're in a library on that user's machine,
your symbol table won't help you -- you need the symbol table for the
library on the customer's machine.
I'm not concerned about the user's library being buggy. "gdb" or
whatever can just give me a raw address for unknown symbols, as long
as I can get the general pattern of what _my_ code was up to at the
time. So that it gives me a starting point to think about :-)
Thanks again.
Reza.
.
- References:
- stack trace without core
- From: RezaRob
- Re: stack trace without core
- From: Jasen
- Re: stack trace without core
- From: RezaRob
- Re: stack trace without core
- From: David Schwartz
- collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- From: RezaRob
- Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- From: David Schwartz
- Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- From: RezaRob
- Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- From: David Schwartz
- stack trace without core
- Prev by Date: Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- Next by Date: Re: My way to check if a progam is already running
- Previous by thread: Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)
- Next by thread: Re: stack trace without core
- Index(es):
Relevant Pages
|