[haiku-commits] r33924 - haiku/trunk/src/apps/debugger/dwarf

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 6 Nov 2009 19:29:27 +0100 (CET)

Author: bonefish
Date: 2009-11-06 19:29:27 +0100 (Fri, 06 Nov 2009)
New Revision: 33924
Changeset: http://dev.haiku-os.org/changeset/33924/haiku

Modified:
   haiku/trunk/src/apps/debugger/dwarf/DwarfFile.cpp
Log:
Handle the "eh" CIE augmentation which can appear in a .eh_frame section.
Hopefully the last hurdle gcc 2 has prepared for preventing variables to show
up.


Modified: haiku/trunk/src/apps/debugger/dwarf/DwarfFile.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/dwarf/DwarfFile.cpp   2009-11-06 17:32:07 UTC 
(rev 33923)
+++ haiku/trunk/src/apps/debugger/dwarf/DwarfFile.cpp   2009-11-06 18:29:27 UTC 
(rev 33924)
@@ -1395,9 +1395,24 @@
 
        uint8 version = dataReader.Read<uint8>(0);
        const char* augmentation = dataReader.ReadString();
-       if (version != 1 || augmentation == NULL || *augmentation != '\0')
+       if (version != 1) {
+               TRACE_CFI("  cie: length: %llu, version: %u -- unsupported\n",
+                       length, version);
                return B_UNSUPPORTED;
+       }
 
+       if (augmentation == NULL || *augmentation != '\0') {
+               if (strcmp(augmentation, "eh") == 0) {
+                       // the augmentation consists of the exception table 
pointer -- just
+                       // ignore it
+                       dataReader.ReadAddress(0);
+               } else {
+                       TRACE_CFI("  cie: length: %llu, version: %u, 
augmentation: \"%s\" "
+                               "-- unsupported\n", length, version, 
augmentation);
+                       return B_UNSUPPORTED;
+               }
+       }
+
        context.SetCodeAlignment(dataReader.ReadUnsignedLEB128(0));
        context.SetDataAlignment(dataReader.ReadSignedLEB128(0));
        context.SetReturnAddressRegister(dataReader.ReadUnsignedLEB128(0));


Other related posts: