Files
clang-p2996/lldb/source/Interpreter/OptionGroupUUID.cpp
Greg Clayton effe5c956b Added new OptionGroup classes for UInt64, UUID, File and Boolean values.
Removed the "image" command and moved it to "target modules". Added an alias
for "image" to "target modules". 

Added some new target commands to be able to add and load modules to a target:
(lldb) target modules add <path>
(lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...]

So you can load individual sections without running a target:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000

Or you can rigidly slide an entire shared library:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000

This should improve bare board debugging when symbol files need to be slid around manually.

llvm-svn: 130796
2011-05-03 22:09:39 +00:00

76 lines
1.7 KiB
C++

//===-- OptionGroupUUID.cpp -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "OptionGroupUUID.h"
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
using namespace lldb;
using namespace lldb_private;
OptionGroupUUID::OptionGroupUUID() :
m_uuid ()
{
}
OptionGroupUUID::~OptionGroupUUID ()
{
}
static OptionDefinition
g_option_table[] =
{
{ LLDB_OPT_SET_1 , false, "uuid", 'u', required_argument, NULL, 0, eArgTypeNone, "A module UUID value."},
};
const uint32_t k_num_file_options = sizeof(g_option_table)/sizeof(OptionDefinition);
uint32_t
OptionGroupUUID::GetNumDefinitions ()
{
return k_num_file_options;
}
const OptionDefinition *
OptionGroupUUID::GetDefinitions ()
{
return g_option_table;
}
Error
OptionGroupUUID::SetOptionValue (CommandInterpreter &interpreter,
uint32_t option_idx,
const char *option_arg)
{
Error error;
char short_option = (char) g_option_table[option_idx].short_option;
switch (short_option)
{
case 'u':
error = m_uuid.SetValueFromCString (option_arg);
break;
default:
error.SetErrorStringWithFormat ("Unrecognized option '%c'.\n", short_option);
break;
}
return error;
}
void
OptionGroupUUID::OptionParsingStarting (CommandInterpreter &interpreter)
{
m_uuid.Clear();
}