* [RFA] skip fde augmentation
@ 2003-06-01 6:07 Richard Henderson
2003-06-01 9:26 ` Mark Kettenis
0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2003-06-01 6:07 UTC (permalink / raw)
To: gdb-patches
Found by inspection.
I assume that the bulk of the dwarf2 testing has been done
on C code. C++ code that handles exceptions would wind up
executing bogus CFA opcodes.
Ok?
r~
* dwarf2-frame.c (struct dwarf2_cie): Add saw_z_augmentation.
(decode_frame_entry): Set it. Skip FDE augmentation.
--- dwarf2-frame.c.orig 2003-05-31 22:23:54.000000000 -0700
+++ dwarf2-frame.c 2003-05-31 22:30:21.000000000 -0700
@@ -65,6 +65,9 @@ struct dwarf2_cie
/* Encoding of addresses. */
unsigned char encoding;
+ /* True if a 'z' augmentation existed. */
+ unsigned char saw_z_augmentation;
+
struct dwarf2_cie *next;
};
@@ -1111,7 +1114,8 @@ decode_frame_entry (struct comp_unit *un
cie->return_address_register = read_1_byte (unit->abfd, buf);
buf += 1;
- if (*augmentation == 'z')
+ cie->saw_z_augmentation = (*augmentation == 'z');
+ if (cie->saw_z_augmentation)
{
ULONGEST length;
@@ -1200,6 +1204,18 @@ decode_frame_entry (struct comp_unit *un
read_encoded_value (unit, fde->cie->encoding & 0x0f, buf, &bytes_read);
buf += bytes_read;
+ /* A 'z' augmentation in the CIE implies the presence of an
+ augmentation field in the FDE as well. The only thing known
+ to be in here at present is the LSDA entry for EH. So we
+ can skip the whole thing. */
+ if (fde->cie->saw_z_augmentation)
+ {
+ ULONGEST length;
+
+ length = read_unsigned_leb128 (unit->abfd, buf, &bytes_read);
+ buf += bytes_read + length;
+ }
+
fde->instructions = buf;
fde->end = end;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFA] skip fde augmentation
2003-06-01 6:07 [RFA] skip fde augmentation Richard Henderson
@ 2003-06-01 9:26 ` Mark Kettenis
0 siblings, 0 replies; 2+ messages in thread
From: Mark Kettenis @ 2003-06-01 9:26 UTC (permalink / raw)
To: Richard Henderson; +Cc: gdb-patches
Richard Henderson <rth@twiddle.net> writes:
> Found by inspection.
>
> I assume that the bulk of the dwarf2 testing has been done
> on C code. C++ code that handles exceptions would wind up
> executing bogus CFA opcodes.
>
> Ok?
>
> r~
>
> * dwarf2-frame.c (struct dwarf2_cie): Add saw_z_augmentation.
> (decode_frame_entry): Set it. Skip FDE augmentation.
I must have missed this when looking at GCC's unwinder. Approved.
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-01 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-01 6:07 [RFA] skip fde augmentation Richard Henderson
2003-06-01 9:26 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox