Re: collecting "oobs" message for user applications (WAS: Re: stack trace without core)



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.

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.

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.

DS

.



Relevant Pages