[Lldb-commits] [PATCH] D67994: [WIP] Modify lldb-test to print out ASTs from symbol file

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 16:15:50 PDT 2019


JDevlieghere added inline comments.


================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3029
   Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
-  TypeSP type_sp = dwarf_ast->ParseTypeFromDWARF(sc, die, log, type_is_new_ptr);
+    
+  TypeSP type_sp;
----------------
xiaobai wrote:
> nit: stray whitespace
Trailing whitespace. 


================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3030
+    
+  TypeSP type_sp;
+    
----------------
I assume this is unintentional? 


================
Comment at: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3060
+
+    switch (tag) {
+      case DW_TAG_array_type:
----------------
shafik wrote:
> I added this change because currently when end up trying to parse non-types which generates diagnostic like the following:
> 
> ```
> error: anon.o {0x0000001e}: unhandled type tag 0x0034 (DW_TAG_variable), please file a bug and attach the file at the start of this error message
> ```
Assuming these are LLVM enum values, there's a method in `Dwarf.h` named `isType` which tells you if a given tag is a type. This list is missing at least some DWARF5 types (DW_TAG_dynamic_type, DW_TAG_atomic_type...). 


================
Comment at: tools/lldb-test/lldb-test.cpp:553
+    
+    lldb_private::TypeList type_list;
+    size_t ntypes = symfile->GetTypes(nullptr, eTypeClassAny, type_list);
----------------
The formatting seems off. Did you run this through clang-format?


================
Comment at: tools/lldb-test/lldb-test.cpp:561
+        
+        if (clang::CXXRecordDecl *record_decl =
+          clang_ast_ctx->GetAsCXXRecordDecl(type->GetFullCompilerType().GetOpaqueQualType()) )
----------------
Personally I think this would be a lot more readable with braces.  


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67994/new/

https://reviews.llvm.org/D67994





More information about the lldb-commits mailing list