summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-11-07 23:09:32 +0000
committerGreg Clayton <gclayton@apple.com>2012-11-07 23:09:32 +0000
commit84afacd253b4c4da7691153c3f0d07237cc0b21d (patch)
tree2616164afbc3ef7ccfef0b2c4620a5e6de892491
parentc3c8d95c51f3741c4d864a0cccf203d4e6c9147d (diff)
downloadbcm5719-llvm-84afacd253b4c4da7691153c3f0d07237cc0b21d.tar.gz
bcm5719-llvm-84afacd253b4c4da7691153c3f0d07237cc0b21d.zip
<rdar://problem/12645617>
<rdar://problem/12153915> (partial fix) Remove an assert and place an error message instead so we don't crash when we run into a type tag that we don't recognize. We will now emit a warning so that hopefully we can get a bug report that has example code that shows what we are missing. Also fixed a case when trying to unique one type to another where we would confuse concrete instances of methods with their definitions and end up not correctly registering the types. llvm-svn: 167557
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index dcaf2e8aeb5..f488eb5b2b9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -5076,18 +5076,32 @@ SymbolFileDWARF::CopyUniqueClassMethodTypes (Type *class_type,
{
if (src_die->Tag() == DW_TAG_subprogram)
{
- const char *src_name = src_die->GetMangledName (this, src_cu);
- if (src_name)
- src_name_to_die.Append(ConstString(src_name).GetCString(), src_die);
+ // Make sure this is a declaration and not a concrete instance by looking
+ // for DW_AT_declaration set to 1. Sometimes concrete function instances
+ // are placed inside the class definitions and shouldn't be included in
+ // the list of things are are tracking here.
+ if (src_die->GetAttributeValueAsUnsigned(this, src_cu, DW_AT_declaration, 0) == 1)
+ {
+ const char *src_name = src_die->GetMangledName (this, src_cu);
+ if (src_name)
+ src_name_to_die.Append(ConstString(src_name).GetCString(), src_die);
+ }
}
}
for (dst_die = dst_class_die->GetFirstChild(); dst_die != NULL; dst_die = dst_die->GetSibling())
{
if (dst_die->Tag() == DW_TAG_subprogram)
{
- const char *dst_name = dst_die->GetMangledName (this, dst_cu);
- if (dst_name)
- dst_name_to_die.Append(ConstString(dst_name).GetCString(), dst_die);
+ // Make sure this is a declaration and not a concrete instance by looking
+ // for DW_AT_declaration set to 1. Sometimes concrete function instances
+ // are placed inside the class definitions and shouldn't be included in
+ // the list of things are are tracking here.
+ if (dst_die->GetAttributeValueAsUnsigned(this, dst_cu, DW_AT_declaration, 0) == 1)
+ {
+ const char *dst_name = dst_die->GetMangledName (this, dst_cu);
+ if (dst_name)
+ dst_name_to_die.Append(ConstString(dst_name).GetCString(), dst_die);
+ }
}
}
const uint32_t src_size = src_name_to_die.GetSize ();
@@ -6495,7 +6509,10 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
break;
}
default:
- assert(false && "Unhandled type tag!");
+ GetObjectFile()->GetModule()->ReportError ("{0x%8.8x}: unhandled type tag 0x%4.4x (%s), please file a bug and attach the file at the start of this error message",
+ die->GetOffset(),
+ tag,
+ DW_TAG_value_to_name(tag));
break;
}
OpenPOWER on IntegriCloud