aboutsummaryrefslogtreecommitdiff
path: root/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Commands/CommandObjectTarget.cpp')
-rw-r--r--source/Commands/CommandObjectTarget.cpp749
1 files changed, 378 insertions, 371 deletions
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index 308b72f355d3..024f7b5a0415 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -63,18 +63,18 @@ static void
DumpTargetInfo (uint32_t target_idx, Target *target, const char *prefix_cstr, bool show_stopped_process_status, Stream &strm)
{
const ArchSpec &target_arch = target->GetArchitecture();
-
+
Module *exe_module = target->GetExecutableModulePointer();
char exe_path[PATH_MAX];
bool exe_valid = false;
if (exe_module)
exe_valid = exe_module->GetFileSpec().GetPath (exe_path, sizeof(exe_path));
-
+
if (!exe_valid)
::strcpy (exe_path, "<none>");
-
+
strm.Printf ("%starget #%u: %s", prefix_cstr ? prefix_cstr : "", target_idx, exe_path);
-
+
uint32_t properties = 0;
if (target_arch.IsValid())
{
@@ -84,7 +84,7 @@ DumpTargetInfo (uint32_t target_idx, Target *target, const char *prefix_cstr, bo
PlatformSP platform_sp (target->GetPlatform());
if (platform_sp)
strm.Printf ("%splatform=%s", properties++ > 0 ? ", " : " ( ", platform_sp->GetName().GetCString());
-
+
ProcessSP process_sp (target->GetProcessSP());
bool show_process_status = false;
if (process_sp)
@@ -123,7 +123,7 @@ DumpTargetList (TargetList &target_list, bool show_stopped_process_status, Strea
{
const uint32_t num_targets = target_list.GetNumTargets();
if (num_targets)
- {
+ {
TargetSP selected_target_sp (target_list.GetSelectedTarget());
strm.PutCString ("Current targets:\n");
for (uint32_t i=0; i<num_targets; ++i)
@@ -167,17 +167,17 @@ public:
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
-
+
// Define the first (and only) variant of this arg.
file_arg.arg_type = eArgTypeFilename;
file_arg.arg_repetition = eArgRepeatPlain;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (file_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
-
+
m_option_group.Append (&m_arch_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append (&m_platform_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append (&m_core_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
@@ -210,7 +210,7 @@ public:
{
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
-
+
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
CommandCompletions::eDiskFileCompletion,
completion_str.c_str(),
@@ -230,12 +230,38 @@ protected:
FileSpec core_file (m_core_file.GetOptionValue().GetCurrentValue());
FileSpec remote_file (m_remote_file.GetOptionValue().GetCurrentValue());
+ if (core_file)
+ {
+ if (!core_file.Exists())
+ {
+ result.AppendErrorWithFormat("core file '%s' doesn't exist", core_file.GetPath().c_str());
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+
+ }
+ if (!core_file.Readable())
+ {
+ result.AppendErrorWithFormat("core file '%s' is not readable", core_file.GetPath().c_str());
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
+ }
+
if (argc == 1 || core_file || remote_file)
{
FileSpec symfile (m_symbol_file.GetOptionValue().GetCurrentValue());
if (symfile)
{
- if (!symfile.Exists())
+ if (symfile.Exists())
+ {
+ if (!symfile.Readable())
+ {
+ result.AppendErrorWithFormat("symbol file '%s' is not readable", core_file.GetPath().c_str());
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
+ }
+ else
{
char symfile_path[PATH_MAX];
symfile.GetPath(symfile_path, sizeof(symfile_path));
@@ -248,12 +274,12 @@ protected:
const char *file_path = command.GetArgumentAtIndex(0);
Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) target create '%s'", file_path);
FileSpec file_spec;
-
+
if (file_path)
file_spec.SetFile (file_path, true);
-
+
bool must_set_platform_path = false;
-
+
Debugger &debugger = m_interpreter.GetDebugger();
PlatformSP platform_sp(debugger.GetPlatformList().GetSelectedPlatform ());
@@ -334,7 +360,7 @@ protected:
}
}
}
-
+
debugger.GetTargetList().SetSelectedTarget(target_sp.get());
if (must_set_platform_path)
{
@@ -352,7 +378,7 @@ protected:
FileSpec core_file_dir;
core_file_dir.GetDirectory() = core_file.GetDirectory();
target_sp->GetExecutableSearchPaths ().Append (core_file_dir);
-
+
ProcessSP process_sp (target_sp->CreateProcess (m_interpreter.GetDebugger().GetListener(), NULL, &core_file));
if (process_sp)
@@ -360,7 +386,7 @@ protected:
// Seems wierd that we Launch a core file, but that is
// what we do!
error = process_sp->LoadCore();
-
+
if (error.Fail())
{
result.AppendError(error.AsCString("can't find plug-in for core file"));
@@ -403,7 +429,6 @@ protected:
result.SetStatus (eReturnStatusFailed);
}
return result.Succeeded();
-
}
private:
@@ -434,12 +459,12 @@ public:
0)
{
}
-
+
virtual
~CommandObjectTargetList ()
{
}
-
+
protected:
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
@@ -447,7 +472,7 @@ protected:
if (args.GetArgumentCount() == 0)
{
Stream &strm = result.GetOutputStream();
-
+
bool show_stopped_process_status = false;
if (DumpTargetList (m_interpreter.GetDebugger().GetTargetList(), show_stopped_process_status, strm) == 0)
{
@@ -482,12 +507,12 @@ public:
0)
{
}
-
+
virtual
~CommandObjectTargetSelect ()
{
}
-
+
protected:
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
@@ -520,9 +545,16 @@ protected:
}
else
{
- result.AppendErrorWithFormat ("index %u is out of range, valid target indexes are 0 - %u\n",
- target_idx,
- num_targets - 1);
+ if (num_targets > 0)
+ {
+ result.AppendErrorWithFormat ("index %u is out of range, valid target indexes are 0 - %u\n",
+ target_idx,
+ num_targets - 1);
+ } else
+ {
+ result.AppendErrorWithFormat ("index %u is out of range since there are no active targets\n",
+ target_idx);
+ }
result.SetStatus (eReturnStatusFailed);
}
}
@@ -562,12 +594,12 @@ public:
m_option_group.Append (&m_cleanup_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
}
-
+
virtual
~CommandObjectTargetDelete ()
{
}
-
+
Options *
GetOptions ()
{
@@ -600,7 +632,7 @@ protected:
if (success)
{
if (target_idx < num_targets)
- {
+ {
target_sp = target_list.GetTargetAtIndex (target_idx);
if (target_sp)
{
@@ -626,7 +658,6 @@ protected:
success = false;
}
}
-
}
else
{
@@ -661,10 +692,10 @@ protected:
result.GetOutputStream().Printf("%u targets deleted.\n", (uint32_t)num_targets_to_delete);
result.SetStatus(eReturnStatusSuccessFinishResult);
}
-
+
return result.Succeeded();
}
-
+
OptionGroupOptions m_option_group;
OptionGroupBoolean m_cleanup_option;
};
@@ -678,6 +709,9 @@ protected:
class CommandObjectTargetVariable : public CommandObjectParsed
{
+ static const uint32_t SHORT_OPTION_FILE = 0x66696c65; // 'file'
+ static const uint32_t SHORT_OPTION_SHLB = 0x73686c62; // 'shlb'
+
public:
CommandObjectTargetVariable (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
@@ -688,23 +722,27 @@ public:
m_option_group (interpreter),
m_option_variable (false), // Don't include frame options
m_option_format (eFormatDefault),
- m_option_compile_units (LLDB_OPT_SET_1, false, "file", 'file', 0, eArgTypeFilename, "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
- m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",'shlb', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
+ m_option_compile_units (LLDB_OPT_SET_1, false, "file",
+ SHORT_OPTION_FILE, 0, eArgTypeFilename,
+ "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
+ m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",
+ SHORT_OPTION_SHLB, 0, eArgTypeFilename,
+ "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
m_varobj_options()
{
CommandArgumentEntry arg;
CommandArgumentData var_name_arg;
-
+
// Define the first (and only) variant of this arg.
var_name_arg.arg_type = eArgTypeVarName;
var_name_arg.arg_repetition = eArgRepeatPlus;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (var_name_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
-
+
m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1);
@@ -712,7 +750,7 @@ public:
m_option_group.Append (&m_option_shared_libraries, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
}
-
+
virtual
~CommandObjectTargetVariable ()
{
@@ -722,33 +760,33 @@ public:
DumpValueObject (Stream &s, VariableSP &var_sp, ValueObjectSP &valobj_sp, const char *root_name)
{
DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions());
-
+
switch (var_sp->GetScope())
{
case eValueTypeVariableGlobal:
if (m_option_variable.show_scope)
s.PutCString("GLOBAL: ");
break;
-
+
case eValueTypeVariableStatic:
if (m_option_variable.show_scope)
s.PutCString("STATIC: ");
break;
-
+
case eValueTypeVariableArgument:
if (m_option_variable.show_scope)
s.PutCString(" ARG: ");
break;
-
+
case eValueTypeVariableLocal:
if (m_option_variable.show_scope)
s.PutCString(" LOCAL: ");
break;
-
+
default:
break;
}
-
+
if (m_option_variable.show_decl)
{
bool show_fullpaths = false;
@@ -756,17 +794,16 @@ public:
if (var_sp->DumpDeclaration(&s, show_fullpaths, show_module))
s.PutCString (": ");
}
-
+
const Format format = m_option_format.GetFormat();
if (format != eFormatDefault)
options.SetFormat(format);
options.SetRootValueObjectName(root_name);
-
+
valobj_sp->Dump(s,options);
}
-
-
+
static size_t GetVariableCallback (void *baton,
const char *name,
VariableList &variable_list)
@@ -781,17 +818,14 @@ public:
}
return 0;
}
-
-
Options *
GetOptions ()
{
return &m_option_group;
}
-
+
protected:
-
void
DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, const VariableList &variable_list, Stream &s)
{
@@ -817,14 +851,14 @@ protected:
s.Printf ("Global variables for %s\n",
sc.comp_unit->GetPath().c_str());
}
-
+
for (uint32_t i=0; i<count; ++i)
{
VariableSP var_sp (variable_list.GetVariableAtIndex(i));
if (var_sp)
{
ValueObjectSP valobj_sp (ValueObjectVariable::Create (exe_ctx.GetBestExecutionContextScope(), var_sp));
-
+
if (valobj_sp)
DumpValueObject (s, var_sp, valobj_sp, var_sp->GetName().GetCString());
}
@@ -838,7 +872,7 @@ protected:
Target *target = m_exe_ctx.GetTargetPtr();
const size_t argc = args.GetArgumentCount();
Stream &s = result.GetOutputStream();
-
+
if (argc > 0)
{
@@ -875,7 +909,7 @@ protected:
valobj_list));
matches = variable_list.GetSize();
}
-
+
if (matches == 0)
{
result.GetErrorStream().Printf ("error: can't find global variable '%s'\n", arg);
@@ -892,7 +926,7 @@ protected:
ValueObjectSP valobj_sp (valobj_list.GetValueObjectAtIndex(global_idx));
if (!valobj_sp)
valobj_sp = ValueObjectVariable::Create (m_exe_ctx.GetBestExecutionContextScope(), var_sp);
-
+
if (valobj_sp)
DumpValueObject (s, var_sp, valobj_sp, use_var_name ? var_sp->GetName().GetCString() : arg);
}
@@ -939,7 +973,7 @@ protected:
comp_unit->GetPath().c_str());
else
result.AppendErrorWithFormat ("no debug information for frame %u\n", frame->GetFrameIndex());
- }
+ }
else
result.AppendError ("'target variable' takes one or more global variable names as arguments\n");
result.SetStatus (eReturnStatusFailed);
@@ -956,7 +990,7 @@ protected:
{
const FileSpec module_file(shlibs.GetFileSpecAtIndex(shlib_idx));
ModuleSpec module_spec (module_file);
-
+
ModuleSP module_sp (target->GetImages().FindFirstModule(module_spec));
if (module_sp)
{
@@ -986,7 +1020,7 @@ protected:
for (size_t cu_idx=0; cu_idx<num_compile_units; ++cu_idx)
target->GetImages().FindCompileUnits(compile_units.GetFileSpecAtIndex(cu_idx), append, sc_list);
}
-
+
const uint32_t num_scs = sc_list.GetSize();
if (num_scs > 0)
{
@@ -1022,10 +1056,10 @@ protected:
m_cmd_name.c_str());
m_interpreter.TruncationWarningGiven();
}
-
+
return result.Succeeded();
}
-
+
OptionGroupOptions m_option_group;
OptionGroupVariable m_option_variable;
OptionGroupFormat m_option_format;
@@ -1051,15 +1085,15 @@ public:
CommandArgumentEntry arg;
CommandArgumentData old_prefix_arg;
CommandArgumentData new_prefix_arg;
-
+
// Define the first variant of this arg pair.
old_prefix_arg.arg_type = eArgTypeOldPathPrefix;
old_prefix_arg.arg_repetition = eArgRepeatPairPlus;
-
+
// Define the first variant of this arg pair.
new_prefix_arg.arg_type = eArgTypeNewPathPrefix;
new_prefix_arg.arg_repetition = eArgRepeatPairPlus;
-
+
// There are two required arguments that must always occur together, i.e. an argument "pair". Because they
// must always occur together, they are treated as two variants of one argument rather than two independent
// arguments. Push them both into the first argument position for m_arguments...
@@ -1094,7 +1128,7 @@ protected:
{
const char *from = command.GetArgumentAtIndex(i);
const char *to = command.GetArgumentAtIndex(i+1);
-
+
if (from[0] && to[0])
{
bool last_pair = ((argc - i) == 2);
@@ -1179,7 +1213,7 @@ public:
CommandArgumentData index_arg;
CommandArgumentData old_prefix_arg;
CommandArgumentData new_prefix_arg;
-
+
// Define the first and only variant of this arg.
index_arg.arg_type = eArgTypeIndex;
index_arg.arg_repetition = eArgRepeatPlain;
@@ -1190,11 +1224,11 @@ public:
// Define the first variant of this arg pair.
old_prefix_arg.arg_type = eArgTypeOldPathPrefix;
old_prefix_arg.arg_repetition = eArgRepeatPairPlus;
-
+
// Define the first variant of this arg pair.
new_prefix_arg.arg_type = eArgTypeNewPathPrefix;
new_prefix_arg.arg_repetition = eArgRepeatPairPlus;
-
+
// There are two required arguments that must always occur together, i.e. an argument "pair". Because they
// must always occur together, they are treated as two variants of one argument rather than two independent
// arguments. Push them both into the same argument position for m_arguments...
@@ -1242,7 +1276,7 @@ protected:
{
const char *from = command.GetArgumentAtIndex(i);
const char *to = command.GetArgumentAtIndex(i+1);
-
+
if (from[0] && to[0])
{
bool last_pair = ((argc - i) == 2);
@@ -1341,14 +1375,14 @@ public:
{
CommandArgumentEntry arg;
CommandArgumentData path_arg;
-
+
// Define the first (and only) variant of this arg.
path_arg.arg_type = eArgTypeDirectoryName;
path_arg.arg_repetition = eArgRepeatPlain;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (path_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
}
@@ -1435,7 +1469,7 @@ DumpCompileUnitLineTable (CommandInterpreter &interpreter,
false,
eSymbolContextCompUnit,
sc_list);
-
+
for (uint32_t i=0; i<num_matches; ++i)
{
SymbolContext sc;
@@ -1443,7 +1477,7 @@ DumpCompileUnitLineTable (CommandInterpreter &interpreter,
{
if (i > 0)
strm << "\n\n";
-
+
strm << "Line table for " << *static_cast<FileSpec*> (sc.comp_unit) << " in `"
<< module->GetFileSpec().GetFilename() << "\n";
LineTable *line_table = sc.comp_unit->GetLineTable();
@@ -1612,7 +1646,7 @@ LookupAddressInModule (CommandInterpreter &interpreter,
if (!module->ResolveFileAddress (addr, so_addr))
return false;
}
-
+
ExecutionContextScope *exe_scope = interpreter.GetExecutionContext().GetBestExecutionContextScope();
DumpAddress (exe_scope, so_addr, verbose, strm);
// strm.IndentMore();
@@ -1635,7 +1669,7 @@ LookupAddressInModule (CommandInterpreter &interpreter,
// strm.IndentLess();
return true;
}
-
+
return false;
}
@@ -1645,7 +1679,7 @@ LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *mod
if (module)
{
SymbolContext sc;
-
+
SymbolVendor *sym_vendor = module->GetSymbolVendor ();
if (sym_vendor)
{
@@ -1667,8 +1701,7 @@ LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *mod
{
num_matches = symtab->AppendSymbolIndexesWithName (symbol_name, match_indexes);
}
-
-
+
if (num_matches > 0)
{
strm.Indent ();
@@ -1705,19 +1738,19 @@ DumpSymbolContextList (ExecutionContextScope *exe_scope, Stream &strm, SymbolCon
strm.IndentMore ();
uint32_t i;
const uint32_t num_matches = sc_list.GetSize();
-
+
for (i=0; i<num_matches; ++i)
{
SymbolContext sc;
if (sc_list.GetContextAtIndex(i, sc))
{
AddressRange range;
-
+
sc.GetAddressRange(eSymbolContextEverything,
0,
true,
range);
-
+
DumpAddress (exe_scope, range.GetBaseAddress(), verbose, strm);
}
}
@@ -1759,11 +1792,11 @@ LookupFunctionInModule (CommandInterpreter &interpreter,
append,
sc_list);
}
-
+
if (num_matches)
{
strm.Indent ();
- strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%" PRIu64 " match%s found in ", (uint64_t)num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
DumpSymbolContextList (interpreter.GetExecutionContext().GetBestExecutionContextScope(), strm, sc_list, verbose);
@@ -1790,11 +1823,11 @@ LookupTypeInModule (CommandInterpreter &interpreter,
ConstString name(name_cstr);
num_matches = module->FindTypes(sc, name, name_is_fully_qualified, max_num_matches, type_list);
-
+
if (num_matches)
{
strm.Indent ();
- strm.Printf("%zu match%s found in ", num_matches, num_matches > 1 ? "es" : "");
+ strm.Printf("%" PRIu64 " match%s found in ", (uint64_t)num_matches, num_matches > 1 ? "es" : "");
DumpFullpath (strm, &module->GetFileSpec(), 0);
strm.PutCString(":\n");
for (TypeSP type_sp : type_list.Types())
@@ -1835,22 +1868,22 @@ LookupTypeHere (CommandInterpreter &interpreter,
{
if (!sym_ctx.module_sp)
return 0;
-
+
TypeList type_list;
const uint32_t max_num_matches = UINT32_MAX;
size_t num_matches = 1;
bool name_is_fully_qualified = false;
-
+
ConstString name(name_cstr);
num_matches = sym_ctx.module_sp->FindTypes(sym_ctx, name, name_is_fully_qualified, max_num_matches, type_list);
-
+
if (num_matches)
{
strm.Indent ();
strm.PutCString("Best match found in ");
DumpFullpath (strm, &sym_ctx.module_sp->GetFileSpec(), 0);
strm.PutCString(":\n");
-
+
TypeSP type_sp (type_list.GetTypeAtIndex(0));
if (type_sp)
{
@@ -1905,7 +1938,6 @@ LookupFileAndLineInModule (CommandInterpreter &interpreter,
}
}
return 0;
-
}
@@ -1918,7 +1950,7 @@ FindModulesByName (Target *target,
// Dump specified images (by basename or fullpath)
FileSpec module_file_spec(module_name, false);
ModuleSpec module_spec (module_file_spec);
-
+
const size_t initial_size = module_list.GetSize ();
if (check_global_list)
@@ -1930,7 +1962,7 @@ FindModulesByName (Target *target,
for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
Module *module = Module::GetAllocatedModuleAtIndex(image_idx);
-
+
if (module)
{
if (module->MatchesModuleSpec (module_spec))
@@ -1946,7 +1978,7 @@ FindModulesByName (Target *target,
if (target)
{
const size_t num_matches = target->GetImages().FindModules (module_spec, module_list);
-
+
// Not found in our module list for our target, check the main
// shared module list in case it is a extra file used somewhere
// else
@@ -1961,7 +1993,7 @@ FindModulesByName (Target *target,
ModuleList::FindSharedModules (module_spec,module_list);
}
}
-
+
return module_list.GetSize () - initial_size;
}
@@ -1975,7 +2007,6 @@ FindModulesByName (Target *target,
class CommandObjectTargetModulesModuleAutoComplete : public CommandObjectParsed
{
public:
-
CommandObjectTargetModulesModuleAutoComplete (CommandInterpreter &interpreter,
const char *name,
const char *help,
@@ -1984,23 +2015,23 @@ public:
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
-
+
// Define the first (and only) variant of this arg.
file_arg.arg_type = eArgTypeFilename;
file_arg.arg_repetition = eArgRepeatStar;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (file_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
}
-
+
virtual
~CommandObjectTargetModulesModuleAutoComplete ()
{
}
-
+
virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
@@ -2014,7 +2045,7 @@ public:
// Arguments are the standard module completer.
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
-
+
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
CommandCompletions::eModuleCompletion,
completion_str.c_str(),
@@ -2037,7 +2068,6 @@ public:
class CommandObjectTargetModulesSourceFileAutoComplete : public CommandObjectParsed
{
public:
-
CommandObjectTargetModulesSourceFileAutoComplete (CommandInterpreter &interpreter,
const char *name,
const char *help,
@@ -2047,23 +2077,23 @@ public:
{
CommandArgumentEntry arg;
CommandArgumentData source_file_arg;
-
+
// Define the first (and only) variant of this arg.
source_file_arg.arg_type = eArgTypeSourceFile;
source_file_arg.arg_repetition = eArgRepeatPlus;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (source_file_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
}
-
+
virtual
~CommandObjectTargetModulesSourceFileAutoComplete ()
{
}
-
+
virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
@@ -2077,7 +2107,7 @@ public:
// Arguments are the standard source file completer.
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
-
+
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
CommandCompletions::eSourceFileCompletion,
completion_str.c_str(),
@@ -2105,39 +2135,38 @@ public:
m_options (interpreter)
{
}
-
+
virtual
~CommandObjectTargetModulesDumpSymtab ()
{
}
-
+
virtual Options *
GetOptions ()
{
return &m_options;
}
-
+
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter),
m_sort_order (eSortOrderNone)
{
}
-
+
virtual
~CommandOptions ()
{
}
-
+
virtual Error
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
const int short_option = m_getopt_table[option_idx].val;
-
+
switch (short_option)
{
case 's':
@@ -2146,33 +2175,33 @@ public:
eSortOrderNone,
error);
break;
-
+
default:
error.SetErrorStringWithFormat("invalid short option character '%c'", short_option);
break;
-
+
}
return error;
}
-
+
void
OptionParsingStarting ()
{
m_sort_order = eSortOrderNone;
}
-
+
const OptionDefinition*
GetDefinitions ()
{
return g_option_table;
}
-
+
// Options table: Required for subclasses of Options.
static OptionDefinition g_option_table[];
-
+
SortOrder m_sort_order;
};
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -2188,11 +2217,11 @@ protected:
else
{
uint32_t num_dumped = 0;
-
+
uint32_t addr_byte_size = target->GetArchitecture().GetAddressByteSize();
result.GetOutputStream().SetAddressByteSize(addr_byte_size);
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
-
+
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
@@ -2200,7 +2229,7 @@ protected:
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping symbol table for %zu modules.\n", num_modules);
+ result.GetOutputStream().Printf("Dumping symbol table for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (num_dumped > 0)
@@ -2251,7 +2280,7 @@ protected:
result.AppendWarningWithFormat("Unable to find an image that matches '%s'.\n", arg_cstr);
}
}
-
+
if (num_dumped > 0)
result.SetStatus (eReturnStatusSuccessFinishResult);
else
@@ -2262,8 +2291,7 @@ protected:
}
return result.Succeeded();
}
-
-
+
CommandOptions m_options;
};
@@ -2280,8 +2308,8 @@ g_sort_option_enumeration[4] =
OptionDefinition
CommandObjectTargetModulesDumpSymtab::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "sort", 's', OptionParser::eRequiredArgument, g_sort_option_enumeration, 0, eArgTypeSortOrder, "Supply a sort order when dumping the symbol table."},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1, false, "sort", 's', OptionParser::eRequiredArgument, NULL, g_sort_option_enumeration, 0, eArgTypeSortOrder, "Supply a sort order when dumping the symbol table."},
+ { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
};
#pragma mark CommandObjectTargetModulesDumpSections
@@ -2301,12 +2329,12 @@ public:
NULL)
{
}
-
+
virtual
~CommandObjectTargetModulesDumpSections ()
{
}
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -2322,18 +2350,18 @@ protected:
else
{
uint32_t num_dumped = 0;
-
+
uint32_t addr_byte_size = target->GetArchitecture().GetAddressByteSize();
result.GetOutputStream().SetAddressByteSize(addr_byte_size);
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
-
+
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
const size_t num_modules = target->GetImages().GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping sections for %zu modules.\n", num_modules);
+ result.GetOutputStream().Printf("Dumping sections for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (size_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
num_dumped++;
@@ -2376,7 +2404,7 @@ protected:
}
}
}
-
+
if (num_dumped > 0)
result.SetStatus (eReturnStatusSuccessFinishResult);
else
@@ -2407,12 +2435,12 @@ public:
NULL)
{
}
-
+
virtual
~CommandObjectTargetModulesDumpSymfile ()
{
}
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -2428,11 +2456,11 @@ protected:
else
{
uint32_t num_dumped = 0;
-
+
uint32_t addr_byte_size = target->GetArchitecture().GetAddressByteSize();
result.GetOutputStream().SetAddressByteSize(addr_byte_size);
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
-
+
if (command.GetArgumentCount() == 0)
{
// Dump all sections for all modules images
@@ -2441,7 +2469,7 @@ protected:
const size_t num_modules = target_modules.GetSize();
if (num_modules > 0)
{
- result.GetOutputStream().Printf("Dumping debug symbols for %zu modules.\n", num_modules);
+ result.GetOutputStream().Printf("Dumping debug symbols for %" PRIu64 " modules.\n", (uint64_t)num_modules);
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
if (DumpModuleSymbolVendor (result.GetOutputStream(), target_modules.GetModulePointerAtIndexUnlocked(image_idx)))
@@ -2479,7 +2507,7 @@ protected:
result.AppendWarningWithFormat("Unable to find an image that matches '%s'.\n", arg_cstr);
}
}
-
+
if (num_dumped > 0)
result.SetStatus (eReturnStatusSuccessFinishResult);
else
@@ -2510,12 +2538,12 @@ public:
eFlagRequiresTarget)
{
}
-
+
virtual
~CommandObjectTargetModulesDumpLineTable ()
{
}
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -2523,11 +2551,11 @@ protected:
{
Target *target = m_exe_ctx.GetTargetPtr();
uint32_t total_num_dumped = 0;
-
+
uint32_t addr_byte_size = target->GetArchitecture().GetAddressByteSize();
result.GetOutputStream().SetAddressByteSize(addr_byte_size);
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
-
+
if (command.GetArgumentCount() == 0)
{
result.AppendErrorWithFormat ("\nSyntax: %s\n", m_cmd_syntax.c_str());
@@ -2540,7 +2568,7 @@ protected:
for (int arg_idx = 0; (arg_cstr = command.GetArgumentAtIndex(arg_idx)) != NULL; ++arg_idx)
{
FileSpec file_spec(arg_cstr, false);
-
+
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
const size_t num_modules = target_modules.GetSize();
@@ -2563,7 +2591,7 @@ protected:
}
}
}
-
+
if (total_num_dumped > 0)
result.SetStatus (eReturnStatusSuccessFinishResult);
else
@@ -2585,7 +2613,6 @@ protected:
class CommandObjectTargetModulesDump : public CommandObjectMultiword
{
public:
-
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
@@ -2600,7 +2627,7 @@ public:
LoadSubCommand ("symfile", CommandObjectSP (new CommandObjectTargetModulesDumpSymfile (interpreter)));
LoadSubCommand ("line-table", CommandObjectSP (new CommandObjectTargetModulesDumpLineTable (interpreter)));
}
-
+
virtual
~CommandObjectTargetModulesDump()
{
@@ -2622,18 +2649,18 @@ public:
m_option_group.Append (&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
}
-
+
virtual
~CommandObjectTargetModulesAdd ()
{
}
-
+
virtual Options *
GetOptions ()
{
return &m_option_group;
}
-
+
virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
@@ -2646,7 +2673,7 @@ public:
{
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
-
+
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
CommandCompletions::eDiskFileCompletion,
completion_str.c_str(),
@@ -2659,11 +2686,9 @@ public:
}
protected:
-
OptionGroupOptions m_option_group;
OptionGroupUUID m_uuid_option_group;
OptionGroupFile m_symbol_file;
-
virtual bool
DoExecute (Args& args,
@@ -2679,7 +2704,7 @@ protected:
else
{
bool flush = false;
-
+
const size_t argc = args.GetArgumentCount();
if (argc == 0)
{
@@ -2700,8 +2725,6 @@ protected:
}
else
{
- flush = true;
-
StreamString strm;
module_spec.GetUUID().Dump (&strm);
if (module_spec.GetFileSpec())
@@ -2798,7 +2821,7 @@ protected:
}
}
}
-
+
if (flush)
{
ProcessSP process = target->GetProcessSP();
@@ -2806,7 +2829,7 @@ protected:
process->Flush();
}
}
-
+
return result.Succeeded();
}
@@ -2829,18 +2852,18 @@ public:
m_option_group.Append (&m_slide_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
m_option_group.Finalize();
}
-
+
virtual
~CommandObjectTargetModulesLoad ()
{
}
-
+
virtual Options *
GetOptions ()
{
return &m_option_group;
}
-
+
protected:
virtual bool
DoExecute (Args& args,
@@ -2863,7 +2886,7 @@ protected:
search_using_module_spec = true;
module_spec.GetFileSpec() = m_file_option.GetOptionValue().GetCurrentValue();
}
-
+
if (m_uuid_option_group.GetOptionValue().OptionWasSet())
{
search_using_module_spec = true;
@@ -2872,7 +2895,6 @@ protected:
if (search_using_module_spec)
{
-
ModuleList matching_modules;
const size_t num_matches = target->GetImages().FindModules (module_spec, matching_modules);
@@ -2965,7 +2987,7 @@ protected:
}
}
}
-
+
if (changed)
{
target->ModulesDidLoad (matching_modules);
@@ -3004,7 +3026,7 @@ protected:
else
{
std::string uuid_str;
-
+
if (module_spec.GetFileSpec())
module_spec.GetFileSpec().GetPath (path, sizeof(path));
else
@@ -3044,8 +3066,8 @@ protected:
}
}
return result.Succeeded();
- }
-
+ }
+
OptionGroupOptions m_option_group;
OptionGroupUUID m_uuid_option_group;
OptionGroupFile m_file_option;
@@ -3058,11 +3080,9 @@ protected:
class CommandObjectTargetModulesList : public CommandObjectParsed
{
public:
-
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter),
m_format_array(),
@@ -3070,12 +3090,12 @@ public:
m_module_addr (LLDB_INVALID_ADDRESS)
{
}
-
+
virtual
~CommandOptions ()
{
}
-
+
virtual Error
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
@@ -3100,7 +3120,7 @@ public:
}
return error;
}
-
+
void
OptionParsingStarting ()
{
@@ -3108,24 +3128,24 @@ public:
m_use_global_module_list = false;
m_module_addr = LLDB_INVALID_ADDRESS;
}
-
+
const OptionDefinition*
GetDefinitions ()
{
return g_option_table;
}
-
+
// Options table: Required for subclasses of Options.
-
+
static OptionDefinition g_option_table[];
-
+
// Instance variables to hold the values for command options.
typedef std::vector< std::pair<char, uint32_t> > FormatWidthCollection;
FormatWidthCollection m_format_array;
bool m_use_global_module_list;
lldb::addr_t m_module_addr;
};
-
+
CommandObjectTargetModulesList (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"target modules list",
@@ -3134,19 +3154,19 @@ public:
m_options (interpreter)
{
}
-
+
virtual
~CommandObjectTargetModulesList ()
{
}
-
+
virtual
Options *
GetOptions ()
{
return &m_options;
}
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -3174,7 +3194,7 @@ protected:
}
// Dump all sections for all modules images
Stream &strm = result.GetOutputStream();
-
+
if (m_options.m_module_addr != LLDB_INVALID_ADDRESS)
{
if (target)
@@ -3207,7 +3227,7 @@ protected:
}
return result.Succeeded();
}
-
+
size_t num_modules = 0;
Mutex::Locker locker; // This locker will be locked on the mutex in module_list_ptr if it is non-NULL.
// Otherwise it will lock the AllocationModuleCollectionMutex when accessing
@@ -3243,10 +3263,10 @@ protected:
}
}
}
-
+
module_list_ptr = &module_list;
}
-
+
if (module_list_ptr != NULL)
{
locker.Lock(module_list_ptr->GetMutex());
@@ -3254,7 +3274,7 @@ protected:
}
if (num_modules > 0)
- {
+ {
for (uint32_t image_idx = 0; image_idx<num_modules; ++image_idx)
{
ModuleSP module_sp;
@@ -3269,7 +3289,7 @@ protected:
module = Module::GetAllocatedModuleAtIndex(image_idx);
module_sp = module->shared_from_this();
}
-
+
const size_t indent = strm.Printf("[%3u] ", image_idx);
PrintModule (target, module, indent, strm);
@@ -3308,7 +3328,7 @@ protected:
strm.PutCString("Null module");
return;
}
-
+
bool dump_object_name = false;
if (m_options.m_format_array.empty())
{
@@ -3331,25 +3351,25 @@ protected:
case 'A':
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;
break;
-
+
case 'd':
DumpDirectory (strm, &module->GetFileSpec(), width);
break;
-
+
case 'b':
DumpBasename (strm, &module->GetFileSpec(), width);
dump_object_name = true;
break;
-
+
case 'h':
case 'o':
// Image header address
@@ -3402,9 +3422,9 @@ protected:
ref_count = module_sp.use_count() - 1;
}
if (width)
- strm.Printf("{%*zu}", width, ref_count);
+ strm.Printf("{%*" PRIu64 "}", width, (uint64_t)ref_count);
else
- strm.Printf("{%zu}", ref_count);
+ strm.Printf("{%" PRIu64 "}", (uint64_t)ref_count);
}
break;
@@ -3437,23 +3457,23 @@ protected:
strm.Printf("%.*s", width, "<NONE>");
}
break;
-
+
case 'm':
module->GetModificationTime().Dump(&strm, width);
break;
case 'p':
- strm.Printf("%p", module);
+ strm.Printf("%p", static_cast<void*>(module));
break;
case 'u':
DumpModuleUUID(strm, module);
break;
-
+
default:
break;
}
-
+
}
if (dump_object_name)
{
@@ -3463,29 +3483,29 @@ protected:
}
strm.EOL();
}
-
+
CommandOptions m_options;
};
OptionDefinition
CommandObjectTargetModulesList::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "address", 'a', OptionParser::eRequiredArgument, NULL, 0, eArgTypeAddressOrExpression, "Display the image at this address."},
- { LLDB_OPT_SET_1, false, "arch", 'A', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the architecture when listing images."},
- { LLDB_OPT_SET_1, false, "triple", 't', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the triple when listing images."},
- { LLDB_OPT_SET_1, false, "header", 'h', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Display the image header address as a load address if debugging, a file address otherwise."},
- { LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Display the image header address offset from the header file address (the slide amount)."},
- { LLDB_OPT_SET_1, false, "uuid", 'u', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Display the UUID when listing images."},
- { LLDB_OPT_SET_1, false, "fullpath", 'f', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the fullpath to the image object file."},
- { LLDB_OPT_SET_1, false, "directory", 'd', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the directory with optional width for the image object file."},
- { LLDB_OPT_SET_1, false, "basename", 'b', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the basename with optional width for the image object file."},
- { LLDB_OPT_SET_1, false, "symfile", 's', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the fullpath to the image symbol file with optional width."},
- { LLDB_OPT_SET_1, false, "symfile-unique", 'S', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the symbol file with optional width only if it is different from the executable object file."},
- { LLDB_OPT_SET_1, false, "mod-time", 'm', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the modification time with optional width of the module."},
- { LLDB_OPT_SET_1, false, "ref-count", 'r', OptionParser::eOptionalArgument, NULL, 0, eArgTypeWidth, "Display the reference count if the module is still in the shared module cache."},
- { LLDB_OPT_SET_1, false, "pointer", 'p', OptionParser::eOptionalArgument, NULL, 0, eArgTypeNone, "Display the module pointer."},
- { LLDB_OPT_SET_1, false, "global", 'g', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Display the modules from the global module list, not just the current target."},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1, false, "address", 'a', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeAddressOrExpression, "Display the image at this address."},
+ { LLDB_OPT_SET_1, false, "arch", 'A', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the architecture when listing images."},
+ { LLDB_OPT_SET_1, false, "triple", 't', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the triple when listing images."},
+ { LLDB_OPT_SET_1, false, "header", 'h', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Display the image header address as a load address if debugging, a file address otherwise."},
+ { LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Display the image header address offset from the header file address (the slide amount)."},
+ { LLDB_OPT_SET_1, false, "uuid", 'u', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Display the UUID when listing images."},
+ { LLDB_OPT_SET_1, false, "fullpath", 'f', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the fullpath to the image object file."},
+ { LLDB_OPT_SET_1, false, "directory", 'd', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the directory with optional width for the image object file."},
+ { LLDB_OPT_SET_1, false, "basename", 'b', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the basename with optional width for the image object file."},
+ { LLDB_OPT_SET_1, false, "symfile", 's', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the fullpath to the image symbol file with optional width."},
+ { LLDB_OPT_SET_1, false, "symfile-unique", 'S', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the symbol file with optional width only if it is different from the executable object file."},
+ { LLDB_OPT_SET_1, false, "mod-time", 'm', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the modification time with optional width of the module."},
+ { LLDB_OPT_SET_1, false, "ref-count", 'r', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeWidth, "Display the reference count if the module is still in the shared module cache."},
+ { LLDB_OPT_SET_1, false, "pointer", 'p', OptionParser::eOptionalArgument, NULL, NULL, 0, eArgTypeNone, "Display the module pointer."},
+ { LLDB_OPT_SET_1, false, "global", 'g', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Display the modules from the global module list, not just the current target."},
+ { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
};
#pragma mark CommandObjectTargetModulesShowUnwind
@@ -3584,7 +3604,7 @@ public:
std::string m_str; // Holds name lookup
lldb::addr_t m_addr; // Holds the address to lookup
};
-
+
CommandObjectTargetModulesShowUnwind (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"target modules show-unwind",
@@ -3597,12 +3617,12 @@ public:
m_options (interpreter)
{
}
-
+
virtual
~CommandObjectTargetModulesShowUnwind ()
{
}
-
+
virtual
Options *
GetOptions ()
@@ -3645,7 +3665,7 @@ protected:
}
SymbolContextList sc_list;
-
+
if (m_options.m_type == eLookupTypeFunctionOrSymbol)
{
ConstString function_name (m_options.m_str.c_str());
@@ -3711,7 +3731,7 @@ protected:
result.GetOutputStream().Printf ("\n");
}
- UnwindPlanSP non_callsite_unwind_plan = func_unwinders_sp->GetUnwindPlanAtNonCallSite(*thread.get());
+ UnwindPlanSP non_callsite_unwind_plan = func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread.get(), -1);
if (non_callsite_unwind_plan.get())
{
result.GetOutputStream().Printf("Asynchronous (not restricted to call-sites) UnwindPlan for %s`%s (start addr 0x%" PRIx64 "):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
@@ -3755,9 +3775,9 @@ protected:
OptionDefinition
CommandObjectTargetModulesShowUnwind::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "name", 'n', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFunctionName, "Show unwind instructions for a function or symbol name."},
- { LLDB_OPT_SET_2, false, "address", 'a', OptionParser::eRequiredArgument, NULL, 0, eArgTypeAddressOrExpression, "Show unwind instructions for a function or symbol containing an address"},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1, false, "name", 'n', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeFunctionName, "Show unwind instructions for a function or symbol name."},
+ { LLDB_OPT_SET_2, false, "address", 'a', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeAddressOrExpression, "Show unwind instructions for a function or symbol containing an address"},
+ { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
};
//----------------------------------------------------------------------
@@ -3766,7 +3786,6 @@ CommandObjectTargetModulesShowUnwind::CommandOptions::g_option_table[] =
class CommandObjectTargetModulesLookup : public CommandObjectParsed
{
public:
-
enum
{
eLookupTypeInvalid = -1,
@@ -3778,29 +3797,28 @@ public:
eLookupTypeType,
kNumLookupTypes
};
-
+
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
OptionParsingStarting();
}
-
+
virtual
~CommandOptions ()
{
}
-
+
virtual Error
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
-
+
const int short_option = m_getopt_table[option_idx].val;
-
+
switch (short_option)
{
case 'a':
@@ -3810,27 +3828,27 @@ public:
m_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
}
break;
-
+
case 'o':
m_offset = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS);
if (m_offset == LLDB_INVALID_ADDRESS)
error.SetErrorStringWithFormat ("invalid offset string '%s'", option_arg);
break;
-
+
case 's':
m_str = option_arg;
m_type = eLookupTypeSymbol;
break;
-
+
case 'f':
m_file.SetFile (option_arg, false);
m_type = eLookupTypeFileLine;
break;
-
+
case 'i':
m_include_inlines = false;
break;
-
+
case 'l':
m_line_number = Args::StringToUInt32(option_arg, UINT32_MAX);
if (m_line_number == UINT32_MAX)
@@ -3839,12 +3857,12 @@ public:
error.SetErrorString ("zero is an invalid line number");
m_type = eLookupTypeFileLine;
break;
-
+
case 'F':
m_str = option_arg;
m_type = eLookupTypeFunction;
break;
-
+
case 'n':
m_str = option_arg;
m_type = eLookupTypeFunctionOrSymbol;
@@ -3854,23 +3872,23 @@ public:
m_str = option_arg;
m_type = eLookupTypeType;
break;
-
+
case 'v':
m_verbose = 1;
break;
-
+
case 'A':
m_print_all = true;
break;
-
+
case 'r':
m_use_regex = true;
break;
}
-
+
return error;
}
-
+
void
OptionParsingStarting ()
{
@@ -3885,15 +3903,15 @@ public:
m_verbose = false;
m_print_all = false;
}
-
+
const OptionDefinition*
GetDefinitions ()
{
return g_option_table;
}
-
+
// Options table: Required for subclasses of Options.
-
+
static OptionDefinition g_option_table[];
int m_type; // Should be a eLookupTypeXXX enum after parsing options
std::string m_str; // Holds name lookup
@@ -3905,9 +3923,8 @@ public:
bool m_include_inlines;// Check for inline entries when looking up by file/line.
bool m_verbose; // Enable verbose lookup info
bool m_print_all; // Print all matches, even in cases where there's a best match.
-
};
-
+
CommandObjectTargetModulesLookup (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"target modules lookup",
@@ -3918,29 +3935,29 @@ public:
{
CommandArgumentEntry arg;
CommandArgumentData file_arg;
-
+
// Define the first (and only) variant of this arg.
file_arg.arg_type = eArgTypeFilename;
file_arg.arg_repetition = eArgRepeatStar;
-
+
// There is only one variant this argument could be; put it into the argument entry.
arg.push_back (file_arg);
-
+
// Push the data for the first argument into the m_arguments vector.
m_arguments.push_back (arg);
}
-
+
virtual
~CommandObjectTargetModulesLookup ()
{
}
-
+
virtual Options *
GetOptions ()
{
return &m_options;
}
-
+
bool
LookupHere (CommandInterpreter &interpreter, CommandReturnObject &result, bool &syntax_error)
{
@@ -3956,17 +3973,17 @@ public:
case eLookupTypeType:
break;
}
-
+
StackFrameSP frame = m_exe_ctx.GetFrameSP();
-
+
if (!frame)
return false;
-
+
const SymbolContext &sym_ctx(frame->GetSymbolContext(eSymbolContextModule));
-
+
if (!sym_ctx.module_sp)
return false;
-
+
switch (m_options.m_type)
{
default:
@@ -3986,10 +4003,10 @@ public:
}
break;
}
-
+
return true;
}
-
+
bool
LookupInModule (CommandInterpreter &interpreter, Module *module, CommandReturnObject &result, bool &syntax_error)
{
@@ -4011,7 +4028,7 @@ public:
}
}
break;
-
+
case eLookupTypeSymbol:
if (!m_options.m_str.empty())
{
@@ -4027,11 +4044,10 @@ public:
}
}
break;
-
+
case eLookupTypeFileLine:
if (m_options.m_file)
{
-
if (LookupFileAndLineInModule (m_interpreter,
result.GetOutputStream(),
module,
@@ -4064,8 +4080,7 @@ public:
}
}
break;
-
-
+
case eLookupTypeType:
if (!m_options.m_str.empty())
{
@@ -4080,17 +4095,17 @@ public:
}
}
break;
-
+
default:
m_options.GenerateOptionUsage (result.GetErrorStream(), this);
syntax_error = true;
break;
}
-
+
result.SetStatus (eReturnStatusFailed);
return false;
}
-
+
protected:
virtual bool
DoExecute (Args& command,
@@ -4112,11 +4127,11 @@ protected:
result.GetOutputStream().SetAddressByteSize(addr_byte_size);
result.GetErrorStream().SetAddressByteSize(addr_byte_size);
// Dump all sections for all modules images
-
+
if (command.GetArgumentCount() == 0)
{
ModuleSP current_module;
-
+
// Where it is possible to look in the current symbol context
// first, try that. If this search was successful and --all
// was not passed, don't print anything else.
@@ -4130,9 +4145,9 @@ protected:
return result.Succeeded();
}
}
-
+
// Dump all sections for all other modules
-
+
const ModuleList &target_modules = target->GetImages();
Mutex::Locker modules_locker(target_modules.GetMutex());
const size_t num_modules = target_modules.GetSize();
@@ -4141,7 +4156,7 @@ protected:
for (i = 0; i<num_modules && syntax_error == false; ++i)
{
Module *module_pointer = target_modules.GetModulePointerAtIndexUnlocked(i);
-
+
if (module_pointer != current_module.get() &&
LookupInModule (m_interpreter, target_modules.GetModulePointerAtIndexUnlocked(i), result, syntax_error))
{
@@ -4184,7 +4199,7 @@ protected:
result.AppendWarningWithFormat("Unable to find an image that matches '%s'.\n", arg_cstr);
}
}
-
+
if (num_successful_lookups > 0)
result.SetStatus (eReturnStatusSuccessFinishResult);
else
@@ -4192,29 +4207,29 @@ protected:
}
return result.Succeeded();
}
-
+
CommandOptions m_options;
};
OptionDefinition
CommandObjectTargetModulesLookup::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, true, "address", 'a', OptionParser::eRequiredArgument, NULL, 0, eArgTypeAddressOrExpression, "Lookup an address in one or more target modules."},
- { LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eRequiredArgument, NULL, 0, eArgTypeOffset, "When looking up an address subtract <offset> from any addresses before doing the lookup."},
+ { LLDB_OPT_SET_1, true, "address", 'a', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeAddressOrExpression, "Lookup an address in one or more target modules."},
+ { LLDB_OPT_SET_1, false, "offset", 'o', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeOffset, "When looking up an address subtract <offset> from any addresses before doing the lookup."},
{ LLDB_OPT_SET_2| LLDB_OPT_SET_4 | LLDB_OPT_SET_5
/* FIXME: re-enable this for types when the LookupTypeInModule actually uses the regex option: | LLDB_OPT_SET_6 */ ,
- false, "regex", 'r', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "The <name> argument for name lookups are regular expressions."},
- { LLDB_OPT_SET_2, true, "symbol", 's', OptionParser::eRequiredArgument, NULL, 0, eArgTypeSymbol, "Lookup a symbol by name in the symbol tables in one or more target modules."},
- { LLDB_OPT_SET_3, true, "file", 'f', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFilename, "Lookup a file by fullpath or basename in one or more target modules."},
- { LLDB_OPT_SET_3, false, "line", 'l', OptionParser::eRequiredArgument, NULL, 0, eArgTypeLineNum, "Lookup a line number in a file (must be used in conjunction with --file)."},
+ false, "regex", 'r', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "The <name> argument for name lookups are regular expressions."},
+ { LLDB_OPT_SET_2, true, "symbol", 's', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeSymbol, "Lookup a symbol by name in the symbol tables in one or more target modules."},
+ { LLDB_OPT_SET_3, true, "file", 'f', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeFilename, "Lookup a file by fullpath or basename in one or more target modules."},
+ { LLDB_OPT_SET_3, false, "line", 'l', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeLineNum, "Lookup a line number in a file (must be used in conjunction with --file)."},
{ LLDB_OPT_SET_FROM_TO(3,5),
- false, "no-inlines", 'i', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Ignore inline entries (must be used in conjunction with --file or --function)."},
- { LLDB_OPT_SET_4, true, "function", 'F', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFunctionName, "Lookup a function by name in the debug symbols in one or more target modules."},
- { LLDB_OPT_SET_5, true, "name", 'n', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFunctionOrSymbol, "Lookup a function or symbol by name in one or more target modules."},
- { LLDB_OPT_SET_6, true, "type", 't', OptionParser::eRequiredArgument, NULL, 0, eArgTypeName, "Lookup a type by name in the debug symbols in one or more target modules."},
- { LLDB_OPT_SET_ALL, false, "verbose", 'v', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Enable verbose lookup information."},
- { LLDB_OPT_SET_ALL, false, "all", 'A', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Print all matches, not just the best match, if a best match is available."},
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ false, "no-inlines", 'i', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Ignore inline entries (must be used in conjunction with --file or --function)."},
+ { LLDB_OPT_SET_4, true, "function", 'F', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeFunctionName, "Lookup a function by name in the debug symbols in one or more target modules."},
+ { LLDB_OPT_SET_5, true, "name", 'n', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeFunctionOrSymbol, "Lookup a function or symbol by name in one or more target modules."},
+ { LLDB_OPT_SET_6, true, "type", 't', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeName, "Lookup a type by name in the debug symbols in one or more target modules."},
+ { LLDB_OPT_SET_ALL, false, "verbose", 'v', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Enable verbose lookup information."},
+ { LLDB_OPT_SET_ALL, false, "all", 'A', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Print all matches, not just the best match, if a best match is available."},
+ { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
};
@@ -4227,7 +4242,6 @@ CommandObjectTargetModulesLookup::CommandOptions::g_option_table[] =
class CommandObjectTargetModulesImageSearchPaths : public CommandObjectMultiword
{
public:
-
CommandObjectTargetModulesImageSearchPaths (CommandInterpreter &interpreter) :
CommandObjectMultiword (interpreter,
"target modules search-paths",
@@ -4240,7 +4254,7 @@ public:
LoadSubCommand ("list", CommandObjectSP (new CommandObjectTargetModulesSearchPathsList (interpreter)));
LoadSubCommand ("query", CommandObjectSP (new CommandObjectTargetModulesSearchPathsQuery (interpreter)));
}
-
+
~CommandObjectTargetModulesImageSearchPaths()
{
}
@@ -4279,7 +4293,7 @@ public:
~CommandObjectTargetModules()
{
}
-
+
private:
//------------------------------------------------------------------
// For CommandObjectTargetModules only
@@ -4307,12 +4321,12 @@ public:
m_option_group.Append (&m_current_frame_option, LLDB_OPT_SET_2, LLDB_OPT_SET_2);
m_option_group.Finalize();
}
-
+
virtual
~CommandObjectTargetSymbolsAdd ()
{
}
-
+
virtual int
HandleArgumentCompletion (Args &input,
int &cursor_index,
@@ -4325,7 +4339,7 @@ public:
{
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
-
+
CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
CommandCompletions::eDiskFileCompletion,
completion_str.c_str(),
@@ -4336,16 +4350,14 @@ public:
matches);
return matches.GetSize();
}
-
+
virtual Options *
GetOptions ()
{
return &m_option_group;
}
-
protected:
-
bool
AddModuleSymbols (Target *target,
ModuleSpec &module_spec,
@@ -4357,7 +4369,7 @@ protected:
{
char symfile_path[PATH_MAX];
symbol_fspec.GetPath (symfile_path, sizeof(symfile_path));
-
+
if (!module_spec.GetUUID().IsValid())
{
if (!module_spec.GetFileSpec() && !module_spec.GetPlatformFileSpec())
@@ -4368,7 +4380,7 @@ protected:
// current target, so we need to find that module in the
// target
ModuleList matching_module_list;
-
+
size_t num_matches = 0;
// First extract all module specs from the symbol file
lldb_private::ModuleSpecList symfile_module_specs;
@@ -4389,7 +4401,7 @@ protected:
num_matches = target->GetImages().FindModules (symfile_uuid_module_spec, matching_module_list);
}
}
-
+
if (num_matches == 0)
{
// No matches yet, iterate through the module specs to find a UUID value that
@@ -4405,7 +4417,7 @@ protected:
ModuleSpec symfile_uuid_module_spec;
symfile_uuid_module_spec.GetUUID() = symfile_module_spec.GetUUID();
num_matches = target->GetImages().FindModules (symfile_uuid_module_spec, matching_module_list);
- }
+ }
}
}
}
@@ -4414,23 +4426,22 @@ protected:
// Just try to match up the file by basename if we have no matches at this point
if (num_matches == 0)
num_matches = target->GetImages().FindModules (module_spec, matching_module_list);
-
+
while (num_matches == 0)
{
ConstString filename_no_extension(module_spec.GetFileSpec().GetFileNameStrippingExtension());
// Empty string returned, lets bail
if (!filename_no_extension)
break;
-
+
// Check if there was no extension to strip and the basename is the same
if (filename_no_extension == module_spec.GetFileSpec().GetFilename())
break;
-
+
// Replace basename with one less extension
module_spec.GetFileSpec().GetFilename() = filename_no_extension;
-
+
num_matches = target->GetImages().FindModules (module_spec, matching_module_list);
-
}
if (num_matches > 1)
@@ -4440,21 +4451,21 @@ protected:
else if (num_matches == 1)
{
ModuleSP module_sp (matching_module_list.GetModuleAtIndex(0));
-
+
// The module has not yet created its symbol vendor, we can just
// give the existing target module the symfile path to use for
// when it decides to create it!
module_sp->SetSymbolFileFileSpec (symbol_fspec);
-
+
SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor(true, &result.GetErrorStream());
if (symbol_vendor)
{
SymbolFile *symbol_file = symbol_vendor->GetSymbolFile();
-
+
if (symbol_file)
{
ObjectFile *object_file = symbol_file->GetObjectFile();
-
+
if (object_file && object_file->GetFileSpec() == symbol_fspec)
{
// Provide feedback that the symfile has been successfully added.
@@ -4462,13 +4473,13 @@ protected:
result.AppendMessageWithFormat("symbol file '%s' has been added to '%s'\n",
symfile_path,
module_fs.GetPath().c_str());
-
+
// Let clients know something changed in the module
// if it is currently loaded
ModuleList module_list;
module_list.Append (module_sp);
target->SymbolsDidLoad (module_list);
-
+
// Make sure we load any scripting resources that may be embedded
// in the debug info files in case the platform supports that.
Error error;
@@ -4674,7 +4685,7 @@ protected:
if (platform_sp->ResolveSymbolFile(*target, module_spec, symfile_spec).Success())
module_spec.GetSymbolFileSpec() = symfile_spec;
}
-
+
ArchSpec arch;
bool symfile_exists = module_spec.GetSymbolFileSpec().Exists();
@@ -4710,13 +4721,11 @@ protected:
}
return result.Succeeded();
}
-
+
OptionGroupOptions m_option_group;
OptionGroupUUID m_uuid_option_group;
OptionGroupFile m_file_option;
OptionGroupBoolean m_current_frame_option;
-
-
};
@@ -4739,13 +4748,13 @@ public:
"target symbols <sub-command> ...")
{
LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetSymbolsAdd (interpreter)));
-
+
}
virtual
~CommandObjectTargetSymbols()
{
}
-
+
private:
//------------------------------------------------------------------
// For CommandObjectTargetModules only
@@ -4780,9 +4789,9 @@ public:
m_one_liner()
{
}
-
+
~CommandOptions () {}
-
+
const OptionDefinition*
GetDefinitions ()
{
@@ -4802,7 +4811,7 @@ public:
m_class_name = option_arg;
m_sym_ctx_specified = true;
break;
-
+
case 'e':
m_line_end = Args::StringToUInt32 (option_arg, UINT_MAX, 0, &success);
if (!success)
@@ -4812,7 +4821,7 @@ public:
}
m_sym_ctx_specified = true;
break;
-
+
case 'l':
m_line_start = Args::StringToUInt32 (option_arg, 0, 0, &success);
if (!success)
@@ -4822,17 +4831,17 @@ public:
}
m_sym_ctx_specified = true;
break;
-
+
case 'i':
m_no_inlines = true;
break;
-
+
case 'n':
m_function_name = option_arg;
m_func_name_type_mask |= eFunctionNameTypeAuto;
m_sym_ctx_specified = true;
break;
-
+
case 'f':
m_file_name = option_arg;
m_sym_ctx_specified = true;
@@ -4890,7 +4899,7 @@ public:
m_thread_index = UINT32_MAX;
m_thread_name.clear();
m_queue_name.clear();
-
+
m_no_inlines = false;
m_sym_ctx_specified = false;
m_thread_specified = false;
@@ -4899,9 +4908,9 @@ public:
m_one_liner.clear();
}
-
+
static OptionDefinition g_option_table[];
-
+
std::string m_class_name;
std::string m_function_name;
uint32_t m_line_start;
@@ -4942,7 +4951,6 @@ public:
}
protected:
-
virtual void
IOHandlerActivated (IOHandler &io_handler)
{
@@ -4953,8 +4961,7 @@ protected:
output_sp->Flush();
}
}
-
-
+
virtual void
IOHandlerInputComplete (IOHandler &io_handler, std::string &line)
{
@@ -4986,12 +4993,12 @@ protected:
}
io_handler.SetIsDone(true);
}
-
+
bool
DoExecute (Args& command, CommandReturnObject &result)
{
m_stop_hook_sp.reset();
-
+
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
if (target)
{
@@ -5002,63 +5009,63 @@ protected:
if (m_options.m_sym_ctx_specified)
{
specifier_ap.reset(new SymbolContextSpecifier(m_interpreter.GetDebugger().GetSelectedTarget()));
-
+
if (!m_options.m_module_name.empty())
{
specifier_ap->AddSpecification (m_options.m_module_name.c_str(), SymbolContextSpecifier::eModuleSpecified);
}
-
+
if (!m_options.m_class_name.empty())
{
specifier_ap->AddSpecification (m_options.m_class_name.c_str(), SymbolContextSpecifier::eClassOrNamespaceSpecified);
}
-
+
if (!m_options.m_file_name.empty())
{
specifier_ap->AddSpecification (m_options.m_file_name.c_str(), SymbolContextSpecifier::eFileSpecified);
}
-
+
if (m_options.m_line_start != 0)
{
specifier_ap->AddLineSpecification (m_options.m_line_start, SymbolContextSpecifier::eLineStartSpecified);
}
-
+
if (m_options.m_line_end != UINT_MAX)
{
specifier_ap->AddLineSpecification (m_options.m_line_end, SymbolContextSpecifier::eLineEndSpecified);
}
-
+
if (!m_options.m_function_name.empty())
{
specifier_ap->AddSpecification (m_options.m_function_name.c_str(), SymbolContextSpecifier::eFunctionSpecified);
}
}
-
+
if (specifier_ap.get())
new_hook_sp->SetSpecifier (specifier_ap.release());
// Next see if any of the thread options have been entered:
-
+
if (m_options.m_thread_specified)
{
ThreadSpec *thread_spec = new ThreadSpec();
-
+
if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
{
thread_spec->SetTID (m_options.m_thread_id);
}
-
+
if (m_options.m_thread_index != UINT32_MAX)
thread_spec->SetIndex (m_options.m_thread_index);
-
+
if (!m_options.m_thread_name.empty())
thread_spec->SetName (m_options.m_thread_name.c_str());
-
+
if (!m_options.m_queue_name.empty())
thread_spec->SetQueueName (m_options.m_queue_name.c_str());
-
+
new_hook_sp->SetThreadSpecifier (thread_spec);
-
+
}
if (m_options.m_use_one_liner)
{
@@ -5082,7 +5089,7 @@ protected:
result.AppendError ("invalid target\n");
result.SetStatus (eReturnStatusFailed);
}
-
+
return result.Succeeded();
}
private:
@@ -5093,29 +5100,29 @@ private:
OptionDefinition
CommandObjectTargetStopHookAdd::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_ALL, false, "one-liner", 'o', OptionParser::eRequiredArgument, NULL, 0, eArgTypeOneLiner,
+ { LLDB_OPT_SET_ALL, false, "one-liner", 'o', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeOneLiner,
"Specify a one-line breakpoint command inline. Be sure to surround it with quotes." },
- { LLDB_OPT_SET_ALL, false, "shlib", 's', OptionParser::eRequiredArgument, NULL, CommandCompletions::eModuleCompletion, eArgTypeShlibName,
+ { LLDB_OPT_SET_ALL, false, "shlib", 's', OptionParser::eRequiredArgument, NULL, NULL, CommandCompletions::eModuleCompletion, eArgTypeShlibName,
"Set the module within which the stop-hook is to be run."},
- { LLDB_OPT_SET_ALL, false, "thread-index", 'x', OptionParser::eRequiredArgument, NULL, 0, eArgTypeThreadIndex,
+ { LLDB_OPT_SET_ALL, false, "thread-index", 'x', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeThreadIndex,
"The stop hook is run only for the thread whose index matches this argument."},
- { LLDB_OPT_SET_ALL, false, "thread-id", 't', OptionParser::eRequiredArgument, NULL, 0, eArgTypeThreadID,
+ { LLDB_OPT_SET_ALL, false, "thread-id", 't', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeThreadID,
"The stop hook is run only for the thread whose TID matches this argument."},
- { LLDB_OPT_SET_ALL, false, "thread-name", 'T', OptionParser::eRequiredArgument, NULL, 0, eArgTypeThreadName,
+ { LLDB_OPT_SET_ALL, false, "thread-name", 'T', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeThreadName,
"The stop hook is run only for the thread whose thread name matches this argument."},
- { LLDB_OPT_SET_ALL, false, "queue-name", 'q', OptionParser::eRequiredArgument, NULL, 0, eArgTypeQueueName,
+ { LLDB_OPT_SET_ALL, false, "queue-name", 'q', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeQueueName,
"The stop hook is run only for threads in the queue whose name is given by this argument."},
- { LLDB_OPT_SET_1, false, "file", 'f', OptionParser::eRequiredArgument, NULL, CommandCompletions::eSourceFileCompletion, eArgTypeFilename,
+ { LLDB_OPT_SET_1, false, "file", 'f', OptionParser::eRequiredArgument, NULL, NULL, CommandCompletions::eSourceFileCompletion, eArgTypeFilename,
"Specify the source file within which the stop-hook is to be run." },
- { LLDB_OPT_SET_1, false, "start-line", 'l', OptionParser::eRequiredArgument, NULL, 0, eArgTypeLineNum,
+ { LLDB_OPT_SET_1, false, "start-line", 'l', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeLineNum,
"Set the start of the line range for which the stop-hook is to be run."},
- { LLDB_OPT_SET_1, false, "end-line", 'e', OptionParser::eRequiredArgument, NULL, 0, eArgTypeLineNum,
+ { LLDB_OPT_SET_1, false, "end-line", 'e', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeLineNum,
"Set the end of the line range for which the stop-hook is to be run."},
- { LLDB_OPT_SET_2, false, "classname", 'c', OptionParser::eRequiredArgument, NULL, 0, eArgTypeClassName,
+ { LLDB_OPT_SET_2, false, "classname", 'c', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeClassName,
"Specify the class within which the stop-hook is to be run." },
- { LLDB_OPT_SET_3, false, "name", 'n', OptionParser::eRequiredArgument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
+ { LLDB_OPT_SET_3, false, "name", 'n', OptionParser::eRequiredArgument, NULL, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
"Set the function name within which the stop hook will be run." },
- { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
+ { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
};
#pragma mark CommandObjectTargetStopHookDelete
@@ -5189,7 +5196,7 @@ protected:
result.AppendError ("invalid target\n");
result.SetStatus (eReturnStatusFailed);
}
-
+
return result.Succeeded();
}
};
@@ -5226,7 +5233,7 @@ protected:
// FIXME: see if we can use the breakpoint id style parser?
size_t num_args = command.GetArgumentCount();
bool success;
-
+
if (num_args == 0)
{
target->SetAllStopHooksActiveState (m_enable);
@@ -5297,7 +5304,7 @@ protected:
result.SetStatus (eReturnStatusFailed);
return result.Succeeded();
}
-
+
size_t num_hooks = target->GetNumStopHooks ();
if (num_hooks == 0)
{
@@ -5367,7 +5374,7 @@ CommandObjectMultiwordTarget::CommandObjectMultiwordTarget (CommandInterpreter &
"A set of commands for operating on debugger targets.",
"target <subcommand> [<subcommand-options>]")
{
-
+
LoadSubCommand ("create", CommandObjectSP (new CommandObjectTargetCreate (interpreter)));
LoadSubCommand ("delete", CommandObjectSP (new CommandObjectTargetDelete (interpreter)));
LoadSubCommand ("list", CommandObjectSP (new CommandObjectTargetList (interpreter)));