[haiku-commits] haiku: hrev45872 - src/apps/debugger/dwarf

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Jul 2013 23:12:49 +0200 (CEST)

hrev45872 adds 1 changeset to branch 'master'
old head: f74ad62fd49d8af1c34d6ed067a0172972a14a5e
new head: 6882d4b5d77831ae87fefaa5354bf20be51a7c8b
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=6882d4b+%5Ef74ad62

----------------------------------------------------------------------------

6882d4b: Debugger: Handle DW_FORM_exprloc.
  
  Get rid of AC_EXPRESSION. DW_FORM_exprloc is for all practical intents
  and purposes identical to DW_FORM_block except with a more explicit
  intent. As such, simply treat it the same as a block attribute. Gets
  value resolution working on DWARF4.

                                      [ Rene Gollent <anevilyak@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45872
Commit:      6882d4b5d77831ae87fefaa5354bf20be51a7c8b
URL:         http://cgit.haiku-os.org/haiku/commit/?id=6882d4b
Author:      Rene Gollent <anevilyak@xxxxxxxxx>
Date:        Wed Jul 17 21:08:14 2013 UTC

----------------------------------------------------------------------------

3 files changed, 27 insertions(+), 47 deletions(-)
src/apps/debugger/dwarf/AttributeClasses.cpp | 62 ++++++++++--------------
src/apps/debugger/dwarf/AttributeClasses.h   |  3 +-
src/apps/debugger/dwarf/DwarfFile.cpp        |  9 +---

----------------------------------------------------------------------------

diff --git a/src/apps/debugger/dwarf/AttributeClasses.cpp 
b/src/apps/debugger/dwarf/AttributeClasses.cpp
index 7e93de9..801e783 100644
--- a/src/apps/debugger/dwarf/AttributeClasses.cpp
+++ b/src/apps/debugger/dwarf/AttributeClasses.cpp
@@ -18,8 +18,7 @@ enum {
        AC_MACPTR               = 1 << (ATTRIBUTE_CLASS_MACPTR - 1),
        AC_RANGELISTPTR = 1 << (ATTRIBUTE_CLASS_RANGELISTPTR - 1),
        AC_REFERENCE    = 1 << (ATTRIBUTE_CLASS_REFERENCE - 1),
-       AC_STRING               = 1 << (ATTRIBUTE_CLASS_STRING - 1),
-       AC_EXPRESSION   = 1 << (ATTRIBUTE_CLASS_EXPRESSION - 1)
+       AC_STRING               = 1 << (ATTRIBUTE_CLASS_STRING - 1)
 };
 
 
@@ -43,15 +42,12 @@ struct attribute_name_info_entry {
 
 static const attribute_name_info_entry kAttributeNameInfos[] = {
        { ENTRY(sibling),                               AC_REFERENCE },
-       { ENTRY(location),                              AC_BLOCK | 
AC_EXPRESSION | AC_LOCLISTPTR },
+       { ENTRY(location),                              AC_BLOCK | 
AC_LOCLISTPTR },
        { ENTRY(name),                                  AC_STRING },
        { ENTRY(ordering),                              AC_CONSTANT },
-       { ENTRY(byte_size),                             AC_BLOCK | 
AC_EXPRESSION | AC_CONSTANT
-                                                                               
| AC_REFERENCE },
-       { ENTRY(bit_offset),                    AC_BLOCK | AC_EXPRESSION | 
AC_CONSTANT
-                                                                               
| AC_REFERENCE },
-       { ENTRY(bit_size),                              AC_BLOCK | 
AC_EXPRESSION | AC_CONSTANT
-                                                                               
| AC_REFERENCE },
+       { ENTRY(byte_size),                             AC_BLOCK | AC_CONSTANT 
| AC_REFERENCE },
+       { ENTRY(bit_offset),                    AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
+       { ENTRY(bit_size),                              AC_BLOCK | AC_CONSTANT 
| AC_REFERENCE },
        { ENTRY(stmt_list),                             AC_LINEPTR },
        { ENTRY(low_pc),                                AC_ADDRESS },
        { ENTRY(high_pc),                               AC_ADDRESS },
@@ -60,7 +56,7 @@ static const attribute_name_info_entry kAttributeNameInfos[] 
= {
        { ENTRY(discr_value),                   AC_CONSTANT },
        { ENTRY(visibility),                    AC_CONSTANT },
        { ENTRY(import),                                AC_REFERENCE },
-       { ENTRY(string_length),                 AC_BLOCK | AC_EXPRESSION | 
AC_LOCLISTPTR },
+       { ENTRY(string_length),                 AC_BLOCK | AC_LOCLISTPTR },
        { ENTRY(common_reference),              AC_REFERENCE },
        { ENTRY(comp_dir),                              AC_STRING },
        { ENTRY(const_value),                   AC_BLOCK | AC_CONSTANT | 
AC_STRING },
@@ -68,26 +64,21 @@ static const attribute_name_info_entry 
kAttributeNameInfos[] = {
        { ENTRY(default_value),                 AC_REFERENCE },
        { ENTRY(inline),                                AC_CONSTANT },
        { ENTRY(is_optional),                   AC_FLAG },
-       { ENTRY(lower_bound),                   AC_BLOCK | AC_EXPRESSION | 
AC_CONSTANT
-                                                                               
| AC_REFERENCE },
+       { ENTRY(lower_bound),                   AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
        { ENTRY(producer),                              AC_STRING },
        { ENTRY(prototyped),                    AC_FLAG },
-       { ENTRY(return_addr),                   AC_BLOCK | AC_EXPRESSION | 
AC_LOCLISTPTR },
+       { ENTRY(return_addr),                   AC_BLOCK | AC_LOCLISTPTR },
        { ENTRY(start_scope),                   AC_CONSTANT },
-       { ENTRY(bit_stride),                    AC_CONSTANT | AC_EXPRESSION
-                                                                               
| AC_REFERENCE },
-       { ENTRY(upper_bound),                   AC_BLOCK | AC_EXPRESSION | 
AC_CONSTANT
-                                                                               
| AC_REFERENCE },
+       { ENTRY(bit_stride),                    AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
+       { ENTRY(upper_bound),                   AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
        { ENTRY(abstract_origin),               AC_REFERENCE },
        { ENTRY(accessibility),                 AC_CONSTANT },
        { ENTRY(address_class),                 AC_CONSTANT },
        { ENTRY(artificial),                    AC_FLAG },
        { ENTRY(base_types),                    AC_REFERENCE },
        { ENTRY(calling_convention),    AC_CONSTANT },
-       { ENTRY(count),                                 AC_BLOCK | 
AC_EXPRESSION | AC_CONSTANT
-                                                                               
| AC_REFERENCE },
-       { ENTRY(data_member_location),  AC_BLOCK | AC_EXPRESSION | AC_CONSTANT
-                                                                               
| AC_LOCLISTPTR },
+       { ENTRY(count),                                 AC_BLOCK | AC_CONSTANT 
| AC_REFERENCE },
+       { ENTRY(data_member_location),  AC_BLOCK | AC_CONSTANT | AC_LOCLISTPTR 
},
        { ENTRY(decl_column),                   AC_CONSTANT },
        { ENTRY(decl_file),                             AC_CONSTANT },
        { ENTRY(decl_line),                             AC_CONSTANT },
@@ -95,27 +86,24 @@ static const attribute_name_info_entry 
kAttributeNameInfos[] = {
        { ENTRY(discr_list),                    AC_BLOCK },
        { ENTRY(encoding),                              AC_CONSTANT },
        { ENTRY(external),                              AC_FLAG },
-       { ENTRY(frame_base),                    AC_BLOCK | AC_EXPRESSION | 
AC_LOCLISTPTR },
+       { ENTRY(frame_base),                    AC_BLOCK | AC_LOCLISTPTR },
        { ENTRY(friend),                                AC_REFERENCE },
        { ENTRY(identifier_case),               AC_CONSTANT },
        { ENTRY(macro_info),                    AC_MACPTR },
        { ENTRY(namelist_item),                 AC_BLOCK | AC_REFERENCE },
        { ENTRY(priority),                              AC_REFERENCE },
-       { ENTRY(segment),                               AC_BLOCK | 
AC_EXPRESSION | AC_LOCLISTPTR },
+       { ENTRY(segment),                               AC_BLOCK | 
AC_LOCLISTPTR },
        { ENTRY(specification),                 AC_REFERENCE },
-       { ENTRY(static_link),                   AC_BLOCK | AC_EXPRESSION | 
AC_LOCLISTPTR },
+       { ENTRY(static_link),                   AC_BLOCK | AC_LOCLISTPTR },
        { ENTRY(type),                                  AC_REFERENCE },
-       { ENTRY(use_location),                  AC_BLOCK | AC_EXPRESSION | 
AC_LOCLISTPTR },
+       { ENTRY(use_location),                  AC_BLOCK | AC_LOCLISTPTR },
        { ENTRY(variable_parameter),    AC_FLAG },
        { ENTRY(virtuality),                    AC_CONSTANT },
        { ENTRY(vtable_elem_location),  AC_BLOCK | AC_LOCLISTPTR },
-       { ENTRY(allocated),                             AC_BLOCK | 
AC_EXPRESSION | AC_CONSTANT
-                                                                               
| AC_REFERENCE },
-       { ENTRY(associated),                    AC_BLOCK | AC_EXPRESSION | 
AC_CONSTANT
-                                                                               
| AC_REFERENCE },
-       { ENTRY(data_location),                 AC_BLOCK | AC_EXPRESSION },
-       { ENTRY(byte_stride),                   AC_BLOCK | AC_EXPRESSION | 
AC_CONSTANT
-                                                                               
| AC_REFERENCE },
+       { ENTRY(allocated),                             AC_BLOCK | AC_CONSTANT 
| AC_REFERENCE },
+       { ENTRY(associated),                    AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
+       { ENTRY(data_location),                 AC_BLOCK },
+       { ENTRY(byte_stride),                   AC_BLOCK | AC_CONSTANT | 
AC_REFERENCE },
        { ENTRY(entry_pc),                              AC_ADDRESS },
        { ENTRY(use_UTF8),                              AC_FLAG },
        { ENTRY(extension),                             AC_REFERENCE },
@@ -146,11 +134,11 @@ static const attribute_name_info_entry 
kAttributeNameInfos[] = {
        { ENTRY(const_expr),                    AC_FLAG },
        { ENTRY(enum_class),                    AC_FLAG },
        { ENTRY(linkage_name),                  AC_STRING },
-       { ENTRY(call_site_value),               AC_BLOCK | AC_EXPRESSION },
-       { ENTRY(call_site_data_value),  AC_BLOCK | AC_EXPRESSION },
-       { ENTRY(call_site_target),              AC_BLOCK | AC_EXPRESSION },
+       { ENTRY(call_site_value),               AC_BLOCK },
+       { ENTRY(call_site_data_value),  AC_BLOCK },
+       { ENTRY(call_site_target),              AC_BLOCK },
        { ENTRY(call_site_target_clobbered),
-                                                                       
AC_BLOCK | AC_EXPRESSION },
+                                                                       
AC_BLOCK },
        { ENTRY(tail_call),                             AC_FLAG },
        { ENTRY(all_tail_call_sites),   AC_FLAG },
        { ENTRY(all_call_sites),                AC_FLAG },
@@ -192,7 +180,7 @@ static const attribute_info_entry kAttributeFormInfos[] = {
        { ENTRY(indirect),              AC_REFERENCE },
        { ENTRY(sec_offset),    AC_LINEPTR | AC_LOCLISTPTR | AC_MACPTR
                                                                | 
AC_RANGELISTPTR },
-       { ENTRY(exprloc),               AC_EXPRESSION },
+       { ENTRY(exprloc),               AC_BLOCK },
        { ENTRY(flag_present),  AC_FLAG },
        { ENTRY(ref_sig8),              AC_REFERENCE },
        {}
diff --git a/src/apps/debugger/dwarf/AttributeClasses.h 
b/src/apps/debugger/dwarf/AttributeClasses.h
index 6b7b873..8cf5f85 100644
--- a/src/apps/debugger/dwarf/AttributeClasses.h
+++ b/src/apps/debugger/dwarf/AttributeClasses.h
@@ -25,8 +25,7 @@ enum {
        ATTRIBUTE_CLASS_MACPTR                  = 7,
        ATTRIBUTE_CLASS_RANGELISTPTR    = 8,
        ATTRIBUTE_CLASS_REFERENCE               = 9,
-       ATTRIBUTE_CLASS_STRING                  = 10,
-       ATTRIBUTE_CLASS_EXPRESSION              = 11
+       ATTRIBUTE_CLASS_STRING                  = 10
 };
 
 
diff --git a/src/apps/debugger/dwarf/DwarfFile.cpp 
b/src/apps/debugger/dwarf/DwarfFile.cpp
index 4386fc1..63c2d43 100644
--- a/src/apps/debugger/dwarf/DwarfFile.cpp
+++ b/src/apps/debugger/dwarf/DwarfFile.cpp
@@ -1378,6 +1378,7 @@ DwarfFile::_ParseEntryAttributes(DataReader& dataReader,
                                
attributeValue.SetToString(dataReader.ReadString());
                                break;
                        case DW_FORM_block:
+                       case DW_FORM_exprloc:
                                blockLength = dataReader.ReadUnsignedLEB128(0);
                                break;
                        case DW_FORM_block1:
@@ -1436,9 +1437,6 @@ DwarfFile::_ParseEntryAttributes(DataReader& dataReader,
                        case DW_FORM_ref_udata:
                                value = dataReader.ReadUnsignedLEB128(0);
                                break;
-                       case DW_FORM_exprloc:
-                               value = dataReader.ReadUnsignedLEB128(0);
-                               break;
                        case DW_FORM_flag_present:
                                attributeValue.SetToFlag(true);
                                break;
@@ -1523,11 +1521,6 @@ DwarfFile::_ParseEntryAttributes(DataReader& dataReader,
                        case ATTRIBUTE_CLASS_STRING:
                                // already set
                                break;
-                       case ATTRIBUTE_CLASS_EXPRESSION:
-                               WARNING("Skipping unhandled attribute class 
expression.\n");
-                               // TODO: implement
-                               dataReader.Skip(value);
-                               break;
                }
 
                if (dataReader.HasOverflow()) {


Other related posts:

  • » [haiku-commits] haiku: hrev45872 - src/apps/debugger/dwarf - anevilyak