From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC/ia64-linux] pb with shared libraries when attaching to process
Date: Fri, 25 Apr 2008 14:26:00 -0000 [thread overview]
Message-ID: <20080425023623.GB16580@adacore.com> (raw)
In-Reply-To: <20080425014746.GA10244@caradoc.them.org>
> > (the slot number is encoded in the last 4 bits of the address and
> > should be either 0, 1, or 2).
>
> So what's actually at that address? Dump a couple of words... my
> first guess is that it ends up being a function descriptor for
> _dl_debug_state, but GDB is somehow failing to convert it back into
> the breakpoint address.
Indeed!
(gdb) x /2x 0x200000000003b768
0x200000000003b768 <local+168>: 0x0001b720 0x20000000
(gdb) x /i 0x200000000001b720
0x200000000001b720 <_dl_debug_state>: [MIB] nop.m 0x0
Looking deeper into this, the problem is that GDB determins that
this symbol is in the .data section. The code that recognizes
function descriptors for ia64 checks first that the associated
section name is ".opd", or else checks the name of the symbol
with is_vtable_name() (see ia64-tdep.c:ia64_convert_from_func_ptr_addr).
I double checked /lib/ld-linux-ia64.so.2, and unless I'm mistaken,
the debugger is correct. Our address is inside the .data section
of the loader. There is no .opd section in sight.
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 00000280 0000000000000120 0000000000000120 00000120 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 00000888 00000000000003a0 00000000000003a0 000003a0 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 00000401 0000000000000c28 0000000000000c28 00000c28 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.version 000000b6 000000000000102a 000000000000102a 0000102a 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version_d 00000080 00000000000010e0 00000000000010e0 000010e0 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .rela.dyn 00001bc0 0000000000001160 0000000000001160 00001160 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .rela.IA_64.pltoff 00000078 0000000000002d20 0000000000002d20 00002d20 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .plt 00000120 0000000000002da0 0000000000002da0 00002da0 2**5
CONTENTS, ALLOC, LOAD, READONLY, CODE
8 .text 00024450 0000000000002ec0 0000000000002ec0 00002ec0 2**6
CONTENTS, ALLOC, LOAD, READONLY, CODE
9 .rodata 00002722 0000000000027310 0000000000027310 00027310 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
10 .IA_64.unwind_info 00001008 0000000000029a38 0000000000029a38 00029a38 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
11 .IA_64.unwind 00000b28 000000000002aa40 000000000002aa40 0002aa40 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
12 .data 00004180 000000000003b568 000000000003b568 0002b568 2**3
CONTENTS, ALLOC, LOAD, DATA
13 .dynamic 00000170 000000000003f6e8 000000000003f6e8 0002f6e8 2**3
CONTENTS, ALLOC, LOAD, DATA
14 .got 000000e8 000000000003f858 000000000003f858 0002f858 2**3
CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
15 .IA_64.pltoff 00000050 000000000003f940 000000000003f940 0002f940 2**4
CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
16 .sdata 00000868 000000000003f990 000000000003f990 0002f990 2**3
CONTENTS, ALLOC, LOAD, DATA, SMALL_DATA
17 .sbss 0000010c 00000000000401f8 00000000000401f8 000301f8 2**3
ALLOC, SMALL_DATA
18 .bss 00000748 0000000000040308 0000000000040308 000301fc 2**3
ALLOC
19 .comment 00000535 0000000000000000 0000000000000000 000301fc 2**0
CONTENTS, READONLY
--
Joel
next prev parent reply other threads:[~2008-04-25 2:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-25 2:06 Joel Brobecker
2008-04-25 2:36 ` Daniel Jacobowitz
2008-04-25 14:26 ` Joel Brobecker [this message]
2008-04-25 16:15 ` Daniel Jacobowitz
2008-04-25 19:00 ` Joel Brobecker
2008-05-02 15:01 ` Daniel Jacobowitz
2008-05-07 10:12 ` Joel Brobecker
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=20080425023623.GB16580@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@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