aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2010-09-15 05:51:24 +0000
committerGreg Clayton <gclayton@apple.com>2010-09-15 05:51:24 +0000
commit1924e2408687e0ee41976010c6b9410bdd01270d (patch)
treeb2c732a93ec61eb7fbc2a85a42c7f50335c27167 /source
parentd9ece2a74d30a0610e56b85dc472b9b09344c2c3 (diff)
downloadlldb-1924e2408687e0ee41976010c6b9410bdd01270d.tar.gz
Fixed a missing newline when dumping mixed disassembly.
Added a "bool show_fullpaths" to many more objects that were previously always dumping full paths. Fixed a few places where the DWARF was not indexed when we we needed it to be when making queries. Also fixed an issue where the DWARF in .o files wasn't searching all .o files for the types. Fixed an issue with the output from "image lookup --type <TYPENAME>" where the name and byte size might not be resolved and might not display. We now call the accessors so we end up seeing all of the type info. git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source')
-rw-r--r--source/Commands/CommandObjectDisassemble.cpp2
-rw-r--r--source/Core/Disassembler.cpp13
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp4
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp31
-rw-r--r--source/Symbol/Block.cpp10
-rw-r--r--source/Symbol/Declaration.cpp8
-rw-r--r--source/Symbol/Function.cpp8
-rw-r--r--source/Symbol/Type.cpp13
-rw-r--r--source/Symbol/Variable.cpp3
9 files changed, 69 insertions, 23 deletions
diff --git a/source/Commands/CommandObjectDisassemble.cpp b/source/Commands/CommandObjectDisassemble.cpp
index 49a56774e..a5fc7f6cf 100644
--- a/source/Commands/CommandObjectDisassemble.cpp
+++ b/source/Commands/CommandObjectDisassemble.cpp
@@ -196,7 +196,7 @@ CommandObjectDisassemble::Execute
ExecutionContext exe_ctx(interpreter.GetDebugger().GetExecutionContext());
if (m_options.show_mixed && m_options.num_lines_context == 0)
- m_options.num_lines_context = 3;
+ m_options.num_lines_context = 1;
if (!m_options.m_func_name.empty())
{
diff --git a/source/Core/Disassembler.cpp b/source/Core/Disassembler.cpp
index 40d8d3006..c2d36ef5b 100644
--- a/source/Core/Disassembler.cpp
+++ b/source/Core/Disassembler.cpp
@@ -107,7 +107,10 @@ Disassembler::Disassemble
if (module)
{
if (!module->FindFunctions (name,
- eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
+ eFunctionNameTypeBase |
+ eFunctionNameTypeFull |
+ eFunctionNameTypeMethod |
+ eFunctionNameTypeSelector,
true,
sc_list))
return false;
@@ -115,7 +118,10 @@ Disassembler::Disassemble
else
{
if (exe_ctx.target->GetImages().FindFunctions (name,
- eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
+ eFunctionNameTypeBase |
+ eFunctionNameTypeFull |
+ eFunctionNameTypeMethod |
+ eFunctionNameTypeSelector,
false,
sc_list))
{
@@ -240,7 +246,8 @@ Disassembler::Disassemble
if (offset != 0)
strm.EOL();
- sc.DumpStopContext(&strm, process, addr, true, true, false);
+ sc.DumpStopContext(&strm, process, addr, false, true, false);
+ strm.EOL();
if (sc.comp_unit && sc.line_entry.IsValid())
{
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index bcae13c34..d388d5435 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1834,6 +1834,10 @@ SymbolFileDWARF::FindTypes(const SymbolContext& sc, const ConstString &name, boo
if (!append)
types.Clear();
+ // Index if we already haven't to make sure the compile units
+ // get indexed and make their global DIE index list
+ if (!m_indexed)
+ Index ();
const uint32_t initial_types_size = types.GetSize();
DWARFCompileUnit* cu = NULL;
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index b99a30ce4..d216ef538 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -878,14 +878,35 @@ SymbolFileDWARFDebugMap::FindFunctions (const RegularExpression& regex, bool app
uint32_t
-SymbolFileDWARFDebugMap::FindTypes (const SymbolContext& sc, const ConstString &name, bool append, uint32_t max_matches, TypeList& types)
+SymbolFileDWARFDebugMap::FindTypes
+(
+ const SymbolContext& sc,
+ const ConstString &name,
+ bool append,
+ uint32_t max_matches,
+ TypeList& types
+)
{
- SymbolFileDWARF *oso_dwarf = GetSymbolFile (sc);
- if (oso_dwarf)
- return oso_dwarf->FindTypes (sc, name, append, max_matches, types);
if (!append)
types.Clear();
- return 0;
+
+ const uint32_t initial_types_size = types.GetSize();
+ SymbolFileDWARF *oso_dwarf;
+
+ if (sc.comp_unit)
+ {
+ oso_dwarf = GetSymbolFile (sc);
+ if (oso_dwarf)
+ return oso_dwarf->FindTypes (sc, name, append, max_matches, types);
+ }
+ else
+ {
+ uint32_t oso_idx = 0;
+ while ((oso_dwarf = GetSymbolFileByOSOIndex (oso_idx++)) != NULL)
+ oso_dwarf->FindTypes (sc, name, append, max_matches, types);
+ }
+
+ return types.GetSize() - initial_types_size;
}
//
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp
index 0096c5312..a2193891c 100644
--- a/source/Symbol/Block.cpp
+++ b/source/Symbol/Block.cpp
@@ -57,7 +57,10 @@ Block::GetDescription(Stream *s, Function *function, lldb::DescriptionLevel leve
}
if (m_inlineInfoSP.get() != NULL)
- m_inlineInfoSP->Dump(s);
+ {
+ bool show_fullpaths = (level == eDescriptionLevelVerbose);
+ m_inlineInfoSP->Dump(s, show_fullpaths);
+ }
}
void
@@ -83,7 +86,10 @@ Block::Dump(Stream *s, addr_t base_addr, int32_t depth, bool show_context) const
s->Printf(", parent = {0x%8.8x}", parent_block->GetID());
}
if (m_inlineInfoSP.get() != NULL)
- m_inlineInfoSP->Dump(s);
+ {
+ bool show_fullpaths = false;
+ m_inlineInfoSP->Dump(s, show_fullpaths);
+ }
if (!m_ranges.empty())
{
diff --git a/source/Symbol/Declaration.cpp b/source/Symbol/Declaration.cpp
index 2f312d461..8685d8df7 100644
--- a/source/Symbol/Declaration.cpp
+++ b/source/Symbol/Declaration.cpp
@@ -57,11 +57,15 @@ Declaration::Clear()
}
void
-Declaration::Dump(Stream *s) const
+Declaration::Dump(Stream *s, bool show_fullpaths) const
{
if (m_file)
{
- *s << ", decl = " << m_file;
+ *s << ", decl = ";
+ if (show_fullpaths)
+ *s << m_file;
+ else
+ *s << m_file.GetFilename();
if (m_line > 0)
s->Printf(":%u", m_line);
if (m_column > 0)
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index 8989f2e35..3c108d7e2 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -45,11 +45,11 @@ FunctionInfo::~FunctionInfo()
}
void
-FunctionInfo::Dump(Stream *s) const
+FunctionInfo::Dump(Stream *s, bool show_fullpaths) const
{
if (m_name)
*s << ", name = \"" << m_name << "\"";
- m_declaration.Dump(s);
+ m_declaration.Dump(s, show_fullpaths);
}
@@ -131,9 +131,9 @@ InlineFunctionInfo::Compare(const InlineFunctionInfo& a, const InlineFunctionInf
}
void
-InlineFunctionInfo::Dump(Stream *s) const
+InlineFunctionInfo::Dump(Stream *s, bool show_fullpaths) const
{
- FunctionInfo::Dump(s);
+ FunctionInfo::Dump(s, show_fullpaths);
if (m_mangled)
m_mangled.Dump(s);
}
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 886367f7e..4a5e4e1eb 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -87,13 +87,15 @@ lldb_private::Type::GetDescription (Stream *s, lldb::DescriptionLevel level, boo
{
*s << "id = " << (const UserID&)*this;
- if (show_name && m_name)
+ // Call the name accessor to make sure we resolve the type name
+ if (show_name && GetName())
*s << ", name = \"" << m_name << '"';
- if (m_byte_size != 0)
+ // Call the get byte size accesor so we resolve our byte size
+ if (GetByteSize())
s->Printf(", byte-size = %zu", m_byte_size);
-
- m_decl.Dump(s);
+ bool show_fullpaths = (level == lldb::eDescriptionLevelVerbose);
+ m_decl.Dump(s, show_fullpaths);
if (m_clang_qual_type)
{
@@ -138,7 +140,8 @@ lldb_private::Type::Dump (Stream *s, bool show_context)
s->PutCString(" )");
}
- m_decl.Dump(s);
+ bool show_fullpaths = false;
+ m_decl.Dump (s,show_fullpaths);
if (m_clang_qual_type)
{
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp
index 27af65ff0..7a4e12cad 100644
--- a/source/Symbol/Variable.cpp
+++ b/source/Symbol/Variable.cpp
@@ -91,7 +91,8 @@ Variable::Dump(Stream *s, bool show_context) const
s->PutCString(" )");
}
- m_declaration.Dump(s);
+ bool show_fullpaths = false;
+ m_declaration.Dump(s, show_fullpaths);
if (m_location.IsValid())
{