bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

backtrace() problem on ia64


From: John Reiser
Subject: backtrace() problem on ia64
Date: Mon, 19 Feb 2001 10:51:59 -0800

backtrace() and backtrace_symbols_fd() don't give what I expect
on ia64.  I read the mailing list archive, and tried -rdynamic when
building the application.  gdb "where" gives the traceback I expect.

How should I interpret "[0x10005]", and how can I get something
more like what gdb gives?

$ gcc -v
Reading specs from /usr/lib/gcc-lib/ia64-redhat-linux/2.96-ia64-000717/specs
gcc version 2.96-ia64-000717 snap 001117
$ ls -l /lib/libc*
-rwxr-xr-x    1 root     root     14287171 Dec  6 22:17 /lib/libc-2.2.so
lrwxrwxrwx    1 root     root           11 Jan  4 13:30 /lib/libc.so.6.1 -> 
libc-2.2.so
$ /lib/libc-2.2.so
GNU C Library stable release version 2.2, by Roland McGrath et al.
Copyright (C) 1992,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 2.96-ia64-000717 snap 001117.
Compiled on a Linux 2.4.0-0.39 system on 2000-12-06.
  --- [snip] ---
$ cat main.c
#include <execinfo.h>

int bar(int k)
{
        void *array[10];
        int const n = backtrace(array, 10);
        int t;
        for (t=0; t<n; ++t) {
                printf("%p\n", array[t]);
        }
        backtrace_symbols_fd(array, n, 2);
        return 7 * k;                     /* line 12 */
}

int
foo(int j)
{
        return bar(5 + j);
}

main()
{
        return foo(3);
}

$ gcc -g -rdynamic -o main main.c
$ gdb main
(gdb) b 12
Breakpoint 1 at 0x4000000000000d21: file main.c, line 12.
(gdb) run
Starting program: main 
0x10005
[0x10005]

Breakpoint 1, bar (k=8) at main.c:12
12              return 7 * k;
(gdb) where
#0  bar (k=8) at main.c:12
#1  0x4000000000000dc0 in foo (j=3) at main.c:18
#2  0x4000000000000e20 in main () at main.c:23
(gdb) q

-- 
John Reiser, address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]