[Lldb-commits] [lldb] r187423 - Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin

Ashok Thirumurthi ashok.thirumurthi at intel.com
Tue Jul 30 07:58:40 PDT 2013


Author: athirumu
Date: Tue Jul 30 09:58:39 2013
New Revision: 187423

URL: http://llvm.org/viewvc/llvm-project?rev=187423&view=rev
Log:
Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin
to handle the case of an integer constant (DWARF 3 and later).

- Fixes tests that assert in RecordLayoutBuilder::updateExternalFieldOffset
because LLDB was providing an external AST source with missing member offsets.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=187423&r1=187422&r2=187423&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Jul 30 09:58:39 2013
@@ -1780,6 +1780,13 @@ SymbolFileDWARF::ParseChildMembers
                                         member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
                                     }
                                 }
+                                else
+                                {
+                                    // With DWARF 3 and later, if the value is an integer constant,
+                                    // this form value is the offset in bytes from the beginning
+                                    // of the containing entity. 
+                                    member_byte_offset = form_value.Unsigned(); 
+                                }
                                 break;
 
                             case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType (form_value.Unsigned()); break;
@@ -2164,16 +2171,28 @@ SymbolFileDWARF::ParseChildMembers
                                         member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
                                     }
                                 }
+                                else
+                                {
+                                    // With DWARF 3 and later, if the value is an integer constant,
+                                    // this form value is the offset in bytes from the beginning
+                                    // of the containing entity. 
+                                    member_byte_offset = form_value.Unsigned(); 
+                                }
                                 break;
 
                             case DW_AT_accessibility:
                                 accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
                                 break;
 
-                            case DW_AT_virtuality: is_virtual = form_value.Boolean(); break;
-                            default:
+                            case DW_AT_virtuality:
+                                is_virtual = form_value.Boolean();
+                                break;
+                                                   
                             case DW_AT_sibling:
                                 break;
+
+                            default:
+                                break;
                             }
                         }
                     }
@@ -2620,7 +2639,7 @@ SymbolFileDWARF::ResolveClangOpaqueTypeD
         assert(false && "not a forward clang type decl!");
         break;
     }
-    return NULL;
+    return false;
 }
 
 Type*





More information about the lldb-commits mailing list