summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectImage.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-02 21:39:03 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-02 21:39:03 +0000
commitb501b99c6e86575cb0c2c609e85f9324474ecf6d (patch)
tree56359ca536459b98e54bdf2ade065aaa5eff9187 /lldb/source/Commands/CommandObjectImage.cpp
parente9f364f658bdd13a62750bb6dd993c43e837f4b6 (diff)
downloadbcm5719-llvm-b501b99c6e86575cb0c2c609e85f9324474ecf6d.tar.gz
bcm5719-llvm-b501b99c6e86575cb0c2c609e85f9324474ecf6d.zip
Added a "--triple [<width>]" ("-t<width>" as a short option) option to the
image list command so we can see the full triple for each target module. llvm-svn: 130728
Diffstat (limited to 'lldb/source/Commands/CommandObjectImage.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index 080d16bb5d1..cc87631ce7b 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -37,14 +37,19 @@ using namespace lldb_private;
// Static Helper functions
//----------------------------------------------------------------------
static void
-DumpModuleArchitecture (Stream &strm, Module *module, uint32_t width)
+DumpModuleArchitecture (Stream &strm, Module *module, bool full_triple, uint32_t width)
{
if (module)
{
+ const char *arch_cstr;
+ if (full_triple)
+ arch_cstr = module->GetArchitecture().GetTriple().str().c_str();
+ else
+ arch_cstr = module->GetArchitecture().GetArchitectureName();
if (width)
- strm.Printf("%-*s", width, module->GetArchitecture().GetArchitectureName());
+ strm.Printf("%-*s", width, arch_cstr);
else
- strm.PutCString(module->GetArchitecture().GetArchitectureName());
+ strm.PutCString(arch_cstr);
}
}
@@ -1278,9 +1283,13 @@ public:
switch (format_char)
{
case 'a':
- DumpModuleArchitecture (strm, module, width);
+ DumpModuleArchitecture (strm, module, false, width);
break;
+ case 't':
+ DumpModuleArchitecture (strm, module, true, width);
+ break;
+
case 'f':
DumpFullpath (strm, &module->GetFileSpec(), width);
dump_object_name = true;
@@ -1354,6 +1363,7 @@ OptionDefinition
CommandObjectImageList::CommandOptions::g_option_table[] =
{
{ LLDB_OPT_SET_1, false, "arch", 'a', optional_argument, NULL, 0, eArgTypeWidth, "Display the architecture when listing images."},
+{ LLDB_OPT_SET_1, false, "triple", 't', optional_argument, NULL, 0, eArgTypeWidth, "Display the triple when listing images."},
{ LLDB_OPT_SET_1, false, "uuid", 'u', no_argument, NULL, 0, eArgTypeNone, "Display the UUID when listing images."},
{ LLDB_OPT_SET_1, false, "fullpath", 'f', optional_argument, NULL, 0, eArgTypeWidth, "Display the fullpath to the image object file."},
{ LLDB_OPT_SET_1, false, "directory", 'd', optional_argument, NULL, 0, eArgTypeWidth, "Display the directory with optional width for the image object file."},
OpenPOWER on IntegriCloud