* [RFA] dwarf2-frame.c: Support DW_EH_PE_textrel encoding
@ 2003-10-02 20:07 Corinna Vinschen
2003-10-02 22:10 ` Mark Kettenis
0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2003-10-02 20:07 UTC (permalink / raw)
To: gdb-patches
Hi,
I'm not sure if the patch is actually 100% correct but I think it's
not far from that.
For a few weeks now, gcc emits the DW_EH_PE_textrel encoding for sh
and (AFAICS) ia64. This encoding type is unsupported in gdb so far.
The below patch tries to accomodate this encoding.
Is the patch ok as it is? On sh, the testcases failing with a gcc
emitting this encoding run through with the below patch and the
overall FAIL count is the same as before.
Corinna
* dwarf2-frame.c (struct comp_unit): Add tbase member to store
base for DW_EH_PE_textrel encodings.
(read_encoded_value): Add a DW_EH_PE_textrel case.
(dwarf2_build_frame_info): Set unit.tbase to beginning of text
section.
Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.14
diff -u -p -r1.14 dwarf2-frame.c
--- dwarf2-frame.c 9 Sep 2003 03:31:07 -0000 1.14
+++ dwarf2-frame.c 2 Oct 2003 19:56:24 -0000
@@ -885,6 +885,9 @@ struct comp_unit
/* Base for DW_EH_PE_datarel encodings. */
bfd_vma dbase;
+
+ /* Base for DW_EH_PE_textrel encodings. */
+ bfd_vma tbase;
};
const struct objfile_data *dwarf2_frame_data;
@@ -1063,6 +1066,9 @@ read_encoded_value (struct comp_unit *un
case DW_EH_PE_datarel:
base = unit->dbase;
break;
+ case DW_EH_PE_textrel:
+ base = unit->tbase;
+ break;
case DW_EH_PE_aligned:
base = 0;
offset = buf - unit->dwarf_frame_buffer;
@@ -1523,6 +1529,7 @@ dwarf2_build_frame_info (struct objfile
unit.objfile = objfile;
unit.addr_size = objfile->obfd->arch_info->bits_per_address / 8;
unit.dbase = 0;
+ unit.tbase = 0;
/* First add the information from the .eh_frame section. That way,
the FDEs from that section are searched last. */
@@ -1546,6 +1553,11 @@ dwarf2_build_frame_info (struct objfile
got = bfd_get_section_by_name (unit.abfd, ".got");
if (got)
unit.dbase = got->vma;
+
+ /* gcc emits the DW_EH_PE_textrel encoding type on sh and ia64 so far. */
+ got = bfd_get_section_by_name (unit.abfd, ".text");
+ if (got)
+ unit.tbase = got->vma;
frame_ptr = unit.dwarf_frame_buffer;
while (frame_ptr < unit.dwarf_frame_buffer + unit.dwarf_frame_size)
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [RFA] dwarf2-frame.c: Support DW_EH_PE_textrel encoding
2003-10-02 20:07 [RFA] dwarf2-frame.c: Support DW_EH_PE_textrel encoding Corinna Vinschen
@ 2003-10-02 22:10 ` Mark Kettenis
2003-10-03 8:09 ` Corinna Vinschen
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2003-10-02 22:10 UTC (permalink / raw)
To: gdb-patches
Date: Thu, 2 Oct 2003 22:06:52 +0200
From: Corinna Vinschen <vinschen@redhat.com>
Hi,
I'm not sure if the patch is actually 100% correct but I think it's
not far from that.
It looks sensible to me.
For a few weeks now, gcc emits the DW_EH_PE_textrel encoding for sh
and (AFAICS) ia64. This encoding type is unsupported in gdb so far.
The below patch tries to accomodate this encoding.
Is the patch ok as it is? On sh, the testcases failing with a gcc
emitting this encoding run through with the below patch and the
overall FAIL count is the same as before.
I've got a problem with re-using the variable named `got' in
dwarf2_build_frame_info() for the ".text" section. Could you please
rename the variable to something more generic (for example `sect') or
introduce a new variable?
I'd also appreciate it if you changed gcc into GCC in the comment
(thats the spelling the GCC project uses, and makes the sentence start
with a capital). You'll need to add an extra space after the . too.
With those changes, this is OK.
* dwarf2-frame.c (struct comp_unit): Add tbase member to store
base for DW_EH_PE_textrel encodings.
(read_encoded_value): Add a DW_EH_PE_textrel case.
(dwarf2_build_frame_info): Set unit.tbase to beginning of text
section.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] dwarf2-frame.c: Support DW_EH_PE_textrel encoding
2003-10-02 22:10 ` Mark Kettenis
@ 2003-10-03 8:09 ` Corinna Vinschen
0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2003-10-03 8:09 UTC (permalink / raw)
To: gdb-patches
On Fri, Oct 03, 2003 at 12:10:34AM +0200, Mark Kettenis wrote:
> I've got a problem with re-using the variable named `got' in
> dwarf2_build_frame_info() for the ".text" section. Could you please
> rename the variable to something more generic (for example `sect') or
> introduce a new variable?
>
> I'd also appreciate it if you changed gcc into GCC in the comment
> (thats the spelling the GCC project uses, and makes the sentence start
> with a capital). You'll need to add an extra space after the . too.
>
> With those changes, this is OK.
>
> * dwarf2-frame.c (struct comp_unit): Add tbase member to store
> base for DW_EH_PE_textrel encodings.
> (read_encoded_value): Add a DW_EH_PE_textrel case.
> (dwarf2_build_frame_info): Set unit.tbase to beginning of text
> section.
Applied with the suggested changes. I've introduced a new "txt" variable
instead of reusing "got".
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Developer
Red Hat, Inc.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-10-03 8:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-02 20:07 [RFA] dwarf2-frame.c: Support DW_EH_PE_textrel encoding Corinna Vinschen
2003-10-02 22:10 ` Mark Kettenis
2003-10-03 8:09 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox