[Lldb-commits] [lldb] r125240 - in /lldb/trunk/source: Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Symbol/ClangASTContext.cpp
Greg Clayton
gclayton at apple.com
Wed Feb 9 15:39:34 PST 2011
Author: gclayton
Date: Wed Feb 9 17:39:34 2011
New Revision: 125240
URL: http://llvm.org/viewvc/llvm-project?rev=125240&view=rev
Log:
Modified version of a patch from Warren Paul that takes care of issues with
indirect forms, deals with empty DW_AT_comp_dir attributes, and fixups for
handling other signed integer types.
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/ClangASTContext.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=125240&r1=125239&r2=125240&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Wed Feb 9 17:39:34 2011
@@ -139,6 +139,7 @@
bool form_is_indirect = false;
do
{
+ form_is_indirect = false;
register uint32_t form_size = 0;
switch (form)
{
@@ -279,96 +280,77 @@
}
else
{
-die_extract_indirect_form:
- register uint32_t form_size = 0;
- switch (form)
+ bool form_is_indirect = false;
+ do
{
- // Blocks if inlined data that have a length field and the data bytes
- // inlined in the .debug_info
- case DW_FORM_block : form_size = debug_info_data.GetULEB128(&offset); break;
- case DW_FORM_block1 : form_size = debug_info_data.GetU8(&offset); break;
- case DW_FORM_block2 : form_size = debug_info_data.GetU16(&offset); break;
- case DW_FORM_block4 : form_size = debug_info_data.GetU32(&offset); break;
-
- // Inlined NULL terminated C-strings
- case DW_FORM_string :
+ form_is_indirect = false;
+ register uint32_t form_size = 0;
+ switch (form)
{
-// const char *s =
- debug_info_data.GetCStr(&offset);
-// switch (attr)
-// {
-// case DW_AT_name: m_name = s; break;
-// case DW_AT_MIPS_linkage_name: m_linkage_name = s; break;
-// default: break;
-// }
- }
- break;
+ // Blocks if inlined data that have a length field and the data bytes
+ // inlined in the .debug_info
+ case DW_FORM_block : form_size = debug_info_data.GetULEB128(&offset); break;
+ case DW_FORM_block1 : form_size = debug_info_data.GetU8(&offset); break;
+ case DW_FORM_block2 : form_size = debug_info_data.GetU16(&offset); break;
+ case DW_FORM_block4 : form_size = debug_info_data.GetU32(&offset); break;
+
+ // Inlined NULL terminated C-strings
+ case DW_FORM_string : debug_info_data.GetCStr(&offset); break;
+
+ // Compile unit address sized values
+ case DW_FORM_addr :
+ case DW_FORM_ref_addr :
+ form_size = cu_addr_size;
+ break;
+
+ // 1 byte values
+ case DW_FORM_data1 :
+ case DW_FORM_flag :
+ case DW_FORM_ref1 :
+ form_size = 1;
+ break;
+
+ // 2 byte values
+ case DW_FORM_data2 :
+ case DW_FORM_ref2 :
+ form_size = 2;
+ break;
- // Compile unit address sized values
- case DW_FORM_addr :
- case DW_FORM_ref_addr :
- form_size = cu_addr_size;
- break;
-
- // 1 byte values
- case DW_FORM_data1 :
- case DW_FORM_flag :
- case DW_FORM_ref1 :
- form_size = 1;
- break;
-
- // 2 byte values
- case DW_FORM_data2 :
- case DW_FORM_ref2 :
- form_size = 2;
- break;
-
- // 4 byte values
- case DW_FORM_strp :
-// switch (attr)
-// {
-// case DW_AT_name:
-// m_name = debug_str_data.PeekCStr(debug_info_data.GetU32(&offset));
-// break;
-// case DW_AT_MIPS_linkage_name:
-// m_linkage_name = debug_str_data.PeekCStr(debug_info_data.GetU32(&offset));
-// break;
-//
-// default:
+ // 4 byte values
+ case DW_FORM_strp :
form_size = 4;
-// break;
-// }
- break;
+ break;
- case DW_FORM_data4 :
- case DW_FORM_ref4 :
- form_size = 4;
- break;
-
- // 8 byte values
- case DW_FORM_data8 :
- case DW_FORM_ref8 :
- form_size = 8;
- break;
-
- // signed or unsigned LEB 128 values
- // case DW_FORM_APPLE_db_str:
- case DW_FORM_sdata :
- case DW_FORM_udata :
- case DW_FORM_ref_udata :
- debug_info_data.Skip_LEB128(&offset);
- break;
-
- case DW_FORM_indirect :
- form = debug_info_data.GetULEB128(&offset);
- goto die_extract_indirect_form;
+ case DW_FORM_data4 :
+ case DW_FORM_ref4 :
+ form_size = 4;
+ break;
- default:
- *offset_ptr = offset;
- return false;
- }
+ // 8 byte values
+ case DW_FORM_data8 :
+ case DW_FORM_ref8 :
+ form_size = 8;
+ break;
+
+ // signed or unsigned LEB 128 values
+ case DW_FORM_sdata :
+ case DW_FORM_udata :
+ case DW_FORM_ref_udata :
+ debug_info_data.Skip_LEB128(&offset);
+ break;
+
+ case DW_FORM_indirect :
+ form = debug_info_data.GetULEB128(&offset);
+ form_is_indirect = true;
+ break;
+
+ default:
+ *offset_ptr = offset;
+ return false;
+ }
- offset += form_size;
+ offset += form_size;
+ } while (form_is_indirect);
}
}
*offset_ptr = offset;
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=125240&r1=125239&r2=125240&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Feb 9 17:39:34 2011
@@ -559,7 +559,7 @@
{
FileSpec cu_file_spec;
- if (cu_die_name[0] == '/' || cu_comp_dir == NULL && cu_comp_dir[0])
+ if (cu_die_name[0] == '/' || cu_comp_dir == NULL || cu_comp_dir[0] == '\0')
{
// If we have a full path to the compile unit, we don't need to resolve
// the file. This can be expensive e.g. when the source files are NFS mounted.
@@ -1882,7 +1882,7 @@
m_aranges->Sort();
#if defined (ENABLE_DEBUG_PRINTF)
- StreamFile s(stdout);
+ StreamFile s(stdout, false);
s.Printf ("DWARF index for (%s) '%s/%s':",
GetObjectFile()->GetModule()->GetArchitecture().AsCString(),
GetObjectFile()->GetFileSpec().GetDirectory().AsCString(),
Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=125240&r1=125239&r2=125240&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Feb 9 17:39:34 2011
@@ -755,6 +755,11 @@
if (QualTypeMatchesBitSize (bit_size, ast, ast->WCharTy))
return ast->WCharTy.getAsOpaquePtr();
}
+ else if (streq(type_name, "void"))
+ {
+ if (QualTypeMatchesBitSize (bit_size, ast, ast->VoidTy))
+ return ast->VoidTy.getAsOpaquePtr();
+ }
}
// We weren't able to match up a type name, just search by size
if (QualTypeMatchesBitSize (bit_size, ast, ast->CharTy))
@@ -835,6 +840,8 @@
case DW_ATE_unsigned_char:
if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedCharTy))
return ast->UnsignedCharTy.getAsOpaquePtr();
+ if (QualTypeMatchesBitSize (bit_size, ast, ast->UnsignedShortTy))
+ return ast->UnsignedShortTy.getAsOpaquePtr();
break;
case DW_ATE_imaginary_float:
More information about the lldb-commits
mailing list