summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectImage.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-04-22 03:55:06 +0000
committerGreg Clayton <gclayton@apple.com>2011-04-22 03:55:06 +0000
commit385aa28cf6bb57d54e76e4e7c0c224b9fc7eb370 (patch)
tree86cc2c99275c79ca1be6d16c06412452a73af402 /lldb/source/Commands/CommandObjectImage.cpp
parentbafb9347ddfe01a8ee669e77d6e6c4dbe00be62f (diff)
downloadbcm5719-llvm-385aa28cf6bb57d54e76e4e7c0c224b9fc7eb370.tar.gz
bcm5719-llvm-385aa28cf6bb57d54e76e4e7c0c224b9fc7eb370.zip
Did some work on the "register read" command to only show the first register
set by default when dumping registers. If you want to see all of the register sets you can use the "--all" option: (lldb) register read --all If you want to just see some register sets, you can currently specify them by index: (lldb) register read --set 0 --set 2 We need to get shorter register set names soon so we can specify the register sets by name without having to type too much. I will make this change soon. You can also have any integer encoded registers resolve the address values back to any code or data from the object files using the "--lookup" option. Below is sample output when stopped in the libc function "puts" with some const strings in registers: Process 8973 stopped * thread #1: tid = 0x2c03, 0x00007fff828fa30f libSystem.B.dylib`puts + 1, stop reason = instruction step into frame #0: 0x00007fff828fa30f libSystem.B.dylib`puts + 1 (lldb) register read --lookup General Purpose Registers: rax = 0x0000000100000e98 "----------------------------------------------------------------------" rbx = 0x0000000000000000 rcx = 0x0000000000000001 rdx = 0x0000000000000000 rdi = 0x0000000100000e98 "----------------------------------------------------------------------" rsi = 0x0000000100800000 rbp = 0x00007fff5fbff710 rsp = 0x00007fff5fbff280 r8 = 0x0000000000000040 r9 = 0x0000000000000000 r10 = 0x0000000000000000 r11 = 0x0000000000000246 r12 = 0x0000000000000000 r13 = 0x0000000000000000 r14 = 0x0000000000000000 r15 = 0x0000000000000000 rip = 0x00007fff828fa30f libSystem.B.dylib`puts + 1 rflags = 0x0000000000000246 cs = 0x0000000000000027 fs = 0x0000000000000000 gs = 0x0000000000000000 As we can see, we see two constant strings and the PC (register "rip") is showing the code it resolves to. I fixed the register "--format" option to work as expected. Added a setting to disable skipping the function prologue when setting breakpoints as a target settings variable: (lldb) settings set target.skip-prologue false Updated the user settings controller boolean value handler funciton to be able to take the default value so it can correctly respond to the eVarSetOperationClear operation. Did some usability work on the OptionValue classes. Fixed the "image lookup" command to correctly respond to the "--verbose" option and display the detailed symbol context information when looking up line table entries and functions by name. This previously was only working for address lookups. llvm-svn: 129977
Diffstat (limited to 'lldb/source/Commands/CommandObjectImage.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp63
1 files changed, 45 insertions, 18 deletions
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index ae1612e4cf6..080d16bb5d1 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -324,7 +324,7 @@ LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *mod
static void
-DumpSymbolContextList (CommandInterpreter &interpreter, Stream &strm, SymbolContextList &sc_list, bool prepend_addr)
+DumpSymbolContextList (CommandInterpreter &interpreter, Stream &strm, SymbolContextList &sc_list, bool prepend_addr, bool verbose)
{
strm.IndentMore ();
uint32_t i;
@@ -336,31 +336,50 @@ DumpSymbolContextList (CommandInterpreter &interpreter, Stream &strm, SymbolCont
if (sc_list.GetContextAtIndex(i, sc))
{
strm.Indent();
+ ExecutionContextScope *exe_scope = interpreter.GetExecutionContext().GetBestExecutionContextScope ();
+
if (prepend_addr)
{
if (sc.line_entry.range.GetBaseAddress().IsValid())
{
- lldb::addr_t vm_addr = sc.line_entry.range.GetBaseAddress().GetLoadAddress(interpreter.GetExecutionContext().target);
- int addr_size = sizeof (addr_t);
- Process *process = interpreter.GetExecutionContext().process;
- if (process)
- addr_size = process->GetTarget().GetArchitecture().GetAddressByteSize();
- if (vm_addr != LLDB_INVALID_ADDRESS)
- strm.Address (vm_addr, addr_size);
- else
- sc.line_entry.range.GetBaseAddress().Dump (&strm, NULL, Address::DumpStyleSectionNameOffset);
-
+ sc.line_entry.range.GetBaseAddress().Dump (&strm,
+ exe_scope,
+ Address::DumpStyleLoadAddress,
+ Address::DumpStyleModuleWithFileAddress);
strm.PutCString(" in ");
}
}
- sc.DumpStopContext(&strm, interpreter.GetExecutionContext().process, sc.line_entry.range.GetBaseAddress(), true, true, false);
+ sc.DumpStopContext(&strm,
+ exe_scope,
+ sc.line_entry.range.GetBaseAddress(),
+ true,
+ true,
+ false);
+ strm.EOL();
+ if (verbose)
+ {
+ if (sc.line_entry.range.GetBaseAddress().IsValid())
+ {
+ if (sc.line_entry.range.GetBaseAddress().Dump (&strm,
+ exe_scope,
+ Address::DumpStyleDetailedSymbolContext))
+ strm.PutCString("\n\n");
+ }
+ else if (sc.function->GetAddressRange().GetBaseAddress().IsValid())
+ {
+ if (sc.function->GetAddressRange().GetBaseAddress().Dump (&strm,
+ exe_scope,
+ Address::DumpStyleDetailedSymbolContext))
+ strm.PutCString("\n\n");
+ }
+ }
}
}
strm.IndentLess ();
}
static uint32_t
-LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex)
+LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, bool verbose)
{
if (module && name && name[0])
{
@@ -392,7 +411,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *m
strm.Printf("%u match%s found in ", num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
- DumpSymbolContextList (interpreter, strm, sc_list, true);
+ DumpSymbolContextList (interpreter, strm, sc_list, true, verbose);
}
return num_matches;
}
@@ -457,7 +476,13 @@ LookupTypeInModule
}
static uint32_t
-LookupFileAndLineInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const FileSpec &file_spec, uint32_t line, bool check_inlines)
+LookupFileAndLineInModule (CommandInterpreter &interpreter,
+ Stream &strm,
+ Module *module,
+ const FileSpec &file_spec,
+ uint32_t line,
+ bool check_inlines,
+ bool verbose)
{
if (module && file_spec)
{
@@ -474,7 +499,7 @@ LookupFileAndLineInModule (CommandInterpreter &interpreter, Stream &strm, Module
strm << " in ";
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
- DumpSymbolContextList (interpreter, strm, sc_list, true);
+ DumpSymbolContextList (interpreter, strm, sc_list, true, verbose);
return num_matches;
}
}
@@ -1550,7 +1575,8 @@ public:
module,
m_options.m_file,
m_options.m_line_number,
- m_options.m_check_inlines))
+ m_options.m_check_inlines,
+ m_options.m_verbose))
{
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
@@ -1565,7 +1591,8 @@ public:
result.GetOutputStream(),
module,
m_options.m_str.c_str(),
- m_options.m_use_regex))
+ m_options.m_use_regex,
+ m_options.m_verbose))
{
result.SetStatus(eReturnStatusSuccessFinishResult);
return true;
OpenPOWER on IntegriCloud