This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [ppc64 help] Convert breakpoint's into addresses
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Andrew Cagney <ac131313 at redhat dot com>, gdb-patches at sources dot redhat dot com
- Date: Mon, 22 Sep 2003 15:16:54 -0700
- Subject: Re: [ppc64 help] Convert breakpoint's into addresses
- References: <3F6B5BCA.1040504@redhat.com>
On Sep 19, 3:40pm, Andrew Cagney wrote:
> I think the ppc64 ELF ABI is officially wierd.
>
> For "main" the minimal symbol table contains two symbols vis:
>
> main: points at descriptor in .opd sectoin
> .main: points at main's code entry point
>
> Consequently, given only a minimal symbol table, GDB, when given:
>
> (gdb) break main
>
> will try to insert the breakpoint in the descriptor, and not the
> function. Trying to enter:
>
> (gdb) break .main
>
> gets you no where (syntax error :-/)
>
> Adding to the fun, GCC's debug info contains the symbol "main" which
> points at the code address (and not the descriptor) and consequently
> debugging with symbols works. Yes, this means that "main" has two
> different values, arrrghghgh!!
Yuck. Is gcc simply broken or is there a good reason to do things this
way?
> Attatched is a hack to breakpoint.c that applies "convert from func ptr
> addr" to any address. This causing the breakpoint code to convert
> "main" into ".main" and hence work.
>
> I don't know if its a right fix, good fix, or of any other alternative
> fix. However it does work ...
> help!
>
> 2003-09-17 Andrew Cagney <cagney@redhat.com>
>
> * breakpoint.c (set_raw_breakpoint): Apply
> CONVERT_FROM_FUNC_PTR_ADDR to the breakpoint address.
> (breakpoint_re_set_one): Ditto.
I can't think of anything better. If this goes in, I suggest adding
a nice fat comment explaining what's going on...
Kevin