public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Jim Keniston <jkenisto@linux.vnet.ibm.com>
To: gdb@sourceware.org
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Subject: bt: order of .text symbols in debuginfo important?
Date: Wed, 25 Jul 2012 18:54:00 -0000	[thread overview]
Message-ID: <1343242040.3415.43.camel@localhost> (raw)

For purposes of associating functions with .text addresses when creating
a backtrace, does gdb assume that the .text symbols for static functions
in a particular source file are in ascending order by address in the
debuginfo file?  That seems to be the case ALMOST universally in the
debuginfo file I'm looking at, but there's one source file (ehandler.c)
with just 2 static functions, and they're in reverse order in the
debuginfo:

$ objdump -t fsck.ext2.debug
...
0000000000000000 l    df *ABS*  0000000000000000 ehandler.c
000000000062d340 l     O .bss   0000000000000008 operation
000000000041a540 l     F .text  00000000000001bc e2fsck_handle_read_error
000000000041a3d0 l     F .text  000000000000016f e2fsck_handle_write_error
0000000000000000 l    df *ABS*  0000000000000000 problem.c
000000000062cd40 l     O .data  00000000000000b0 pr_latch_info
000000000041a7d0 l     F .text  000000000000005d reconfigure_bool
...

This is of interest to me because gdb's bt of a core file goes bad when
it hits e2fsck_handle_read_error's frame:

...
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Core was generated by `fsck.ext2 -f -y /dev/buse0'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f1618b0db8b in memcpy () from /lib64/libc.so.6
(gdb) where
#0  0x00007f1618b0db8b in memcpy () from /lib64/libc.so.6
#1  0x00007f1619633473 in reuse_cache (block=<value optimized out>, 
    cache=<value optimized out>, data=<value optimized out>, 
    channel=<value optimized out>) at /usr/include/bits/string3.h:52
#2  unix_write_blk64 (block=<value optimized out>, 
    cache=<value optimized out>, data=<value optimized out>, 
    channel=<value optimized out>) at unix_io.c:690
#3  0x000000000041a6c1 in ?? ()
#4  0x00007fff430432c0 in ?? ()
#5  0x000000007f2bb724 in ?? ()
#6  0x0000000000000000 in ?? ()
(gdb)

For comparison, when I point a fresh gdb instance at fsck.ext2 (no core
file), I'm able to set a breakpoint at e2fsck_handle_read_error.

Thanks for any suggestions.  I'd appreciate being cc-ed on responses,
since I'm not subscribed to this list; but I'll monitor the archive for
a while just in case.

Jim Keniston
IBM Linux Technology Center

                 reply	other threads:[~2012-07-25 18:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343242040.3415.43.camel@localhost \
    --to=jkenisto@linux.vnet.ibm.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).