This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/ia64-linux] pb with shared libraries when attaching to process


> > 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.

Eric Botcazou suggested that an address pointing to the .data section
should never be some code because the .data section is not executable;
So we could simply check the flags of our section, and if it doesn't
have the CODE flag set, then assume it's a function descriptor.

I have succesfully tested the following patch with gdb-6.8 (HEAD is
having some issues causing the inferior to fail to start with a SIGILL
at the moment - I'll look at that next).

2008-04-25  Joel Brobecker  <brobecker@adacore.com>

        * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Treat addresses
        pointing inside a non-executable section as function descriptors.

Results before and after the patch:
+------------+------------+----------------------------------------------------+
|       FAIL | PASS       | attach.exp: after attach2, reach tbreak postloop   |
|       FAIL | PASS       | attach.exp: after attach2, exit                    |
| UNRESOLVED | PASS       | attach.exp: before attach3, flush exec             |
| UNRESOLVED | PASS       | attach.exp: attach when process' a.out not in cwd  |
|       FAIL | PASS       | attach.exp: c                                      |
+------------+------------+----------------------------------------------------+

The attached patch is something that I would consider for gdb-6.8.
For gdb-head, I might even go one step farther and remove the check
for the .opd section name just above, since the new check should
handle the .opd section as well.

I'm also wondering about the vtable-related symbols, but that's
harder for me to verify...

What do you think?

-- 
Joel

Attachment: fundesc.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]