On Mon, May 7, 2012 at 2:04 PM, Douglas, William
<[email protected]> wrote:
> On Mon, May 7, 2012 at 12:35 PM, Roland McGrath <[email protected]> wrote:
>> It sounds like you want strip -g, which has existed for many years.
>
> That's what I'm seeing right now when I try it. That is very confusing
> as on a different system last week I had strip -g -f when you don't
> have access to the debuginfo file it outputs showing ?? for the
> function names but if I readelf the binaries on this system I clearly
> see functions in the symtab table.  I'll have to get back on that
> system tomorrow and see what I did/missed, thanks.

Coming back to this finally. The problem I was running into was that
the libraries were being stripped on the machine I had initially
tested this on causing the the problem I was running into where
debuginfo missing caused outputs of ?? in the backtrace.

Minimal example with glib getting the strip -g treatment is the
following crash.c:

#include <stdlib.h>
#include <stdio.h>

#include <glib.h>

int main(void)
{
        char *c ;

        c = g_malloc(5);
        g_free(c);
        g_free(c);
}


$ gcc -g $(pkg-config --cflags glib-2.0 --libs glib-2.0) crash.c -o crash
$ gdb crash
(gdb) run
(gdb) bt
#0  0x00007ffff77279e5 in raise () from /lib64/libc.so.6
#1  0x00007ffff7729198 in abort () from /lib64/libc.so.6
#2  0x0000000000000020 in ?? ()
#3  0x0000000000000000 in ?? ()

Is there something I'm doing wrong or is this not expected to work?
_______________________________________________
elfutils-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/elfutils-devel

Reply via email to