summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectAppend.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectApropos.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp81
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.h6
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp9
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectCrossref.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectHelp.cpp7
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp13
-rw-r--r--lldb/source/Commands/CommandObjectSyntax.cpp48
-rw-r--r--lldb/source/Commands/CommandObjectSyntax.h11
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp2
-rw-r--r--lldb/source/Commands/Makefile14
15 files changed, 106 insertions, 116 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 39bb1f46093..85470164f61 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -161,7 +161,7 @@ DiskFilesOrDirectories
// but for completeness sake we'll resolve the user name and only put a slash
// on the end if it exists.
char resolved_username[PATH_MAX];
- int resolved_username_len = FileSpec::ResolveUsername (partial_name_copy, resolved_username,
+ size_t resolved_username_len = FileSpec::ResolveUsername (partial_name_copy, resolved_username,
sizeof (resolved_username));
// Not sure how this would happen, a username longer than PATH_MAX? Still...
@@ -238,7 +238,7 @@ DiskFilesOrDirectories
if (*partial_name_copy == '~')
{
- int resolved_username_len = FileSpec::ResolveUsername(containing_part, containing_part, sizeof (containing_part));
+ size_t resolved_username_len = FileSpec::ResolveUsername(containing_part, containing_part, sizeof (containing_part));
// User name doesn't exist, we're not getting any further...
if (resolved_username_len == 0 || resolved_username_len >= sizeof (containing_part))
return matches.GetSize();
@@ -591,7 +591,7 @@ CommandCompletions::SymbolCompleter::SearchCallback (
SymbolContext sc;
// Now add the functions & symbols to the list - only add if unique:
- for (int i = 0; i < func_list.GetSize(); i++)
+ for (uint32_t i = 0; i < func_list.GetSize(); i++)
{
if (func_list.GetContextAtIndex(i, sc))
{
@@ -602,7 +602,7 @@ CommandCompletions::SymbolCompleter::SearchCallback (
}
}
- for (int i = 0; i < sym_list.GetSize(); i++)
+ for (uint32_t i = 0; i < sym_list.GetSize(); i++)
{
if (sym_list.GetContextAtIndex(i, sc))
{
diff --git a/lldb/source/Commands/CommandObjectAppend.cpp b/lldb/source/Commands/CommandObjectAppend.cpp
index 6bdbc36572e..89d5cee71e4 100644
--- a/lldb/source/Commands/CommandObjectAppend.cpp
+++ b/lldb/source/Commands/CommandObjectAppend.cpp
@@ -73,7 +73,7 @@ CommandObjectAppend::Execute
{
if (var->GetType() == StateVariable::eTypeString)
{
- for (int i = 0; i < command.GetArgumentCount(); ++i)
+ for (size_t i = 0; i < command.GetArgumentCount(); ++i)
var->AppendStringValue (command.GetArgumentAtIndex(i));
result.SetStatus (eReturnStatusSuccessFinishNoResult);
}
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index 3987f452dfb..59621af5f24 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -69,14 +69,14 @@ CommandObjectApropos::Execute
result.AppendMessageWithFormat ("The following commands may relate to '%s':\n", search_word);
size_t max_len = 0;
- for (int i = 0; i < commands_found.GetSize(); ++i)
+ for (size_t i = 0; i < commands_found.GetSize(); ++i)
{
- int len = strlen (commands_found.GetStringAtIndex (i));
+ size_t len = strlen (commands_found.GetStringAtIndex (i));
if (len > max_len)
max_len = len;
}
- for (int i = 0; i < commands_found.GetSize(); ++i)
+ for (size_t i = 0; i < commands_found.GetSize(); ++i)
interpreter.OutputFormattedHelpText (result.GetOutputStream(),
commands_found.GetStringAtIndex(i),
"--", commands_help.
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 830fbec6fbc..30f99f0c65a 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -56,11 +56,11 @@ CommandObjectBreakpointSet::CommandOptions::CommandOptions() :
m_func_regexp (),
m_modules (),
m_load_addr(),
+ m_ignore_count (0),
m_thread_id(LLDB_INVALID_THREAD_ID),
- m_thread_index (-1),
+ m_thread_index (UINT32_MAX),
m_thread_name(),
- m_queue_name(),
- m_ignore_count (-1)
+ m_queue_name()
{
}
@@ -190,8 +190,8 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons
}
case 'k':
{
- m_ignore_count = Args::StringToSInt32(optarg, -1, 0);
- if (m_ignore_count == -1)
+ m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+ if (m_ignore_count == UINT32_MAX)
error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", optarg);
}
break;
@@ -210,8 +210,8 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons
break;
case 'x':
{
- m_thread_index = Args::StringToUInt64(optarg, -1, 0);
- if (m_thread_id == -1)
+ m_thread_index = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+ if (m_thread_id == UINT32_MAX)
error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
}
@@ -237,9 +237,9 @@ CommandObjectBreakpointSet::CommandOptions::ResetOptionValues ()
m_func_regexp.clear();
m_load_addr = LLDB_INVALID_ADDRESS;
m_modules.clear();
- m_ignore_count = -1;
+ m_ignore_count = 0;
m_thread_id = LLDB_INVALID_THREAD_ID;
- m_thread_index = -1;
+ m_thread_index = UINT32_MAX;
m_thread_name.clear();
m_queue_name.clear();
}
@@ -469,7 +469,7 @@ CommandObjectBreakpointSet::Execute
if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
bp->SetThreadID (m_options.m_thread_id);
- if (m_options.m_thread_index != -1)
+ if (m_options.m_thread_index != UINT32_MAX)
bp->GetOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
if (!m_options.m_thread_name.empty())
@@ -478,7 +478,7 @@ CommandObjectBreakpointSet::Execute
if (!m_options.m_queue_name.empty())
bp->GetOptions()->GetThreadSpec()->SetQueueName(m_options.m_queue_name.c_str());
- if (m_options.m_ignore_count != -1)
+ if (m_options.m_ignore_count != 0)
bp->GetOptions()->SetIgnoreCount(m_options.m_ignore_count);
}
@@ -558,7 +558,7 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
// NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual BreakpointIDList:
- valid_ids->InsertStringArray ((const char **) temp_args.GetArgumentVector(), temp_args.GetArgumentCount(), result);
+ valid_ids->InsertStringArray (temp_args.GetConstArgumentVector(), temp_args.GetArgumentCount(), result);
// At this point, all of the breakpoint ids that the user passed in have been converted to breakpoint IDs
// and put into valid_ids.
@@ -568,7 +568,8 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
// Now that we've converted everything from args into a list of breakpoint ids, go through our tentative list
// of breakpoint id's and verify that they correspond to valid/currently set breakpoints.
- for (int i = 0; i < valid_ids->Size(); ++i)
+ const size_t count = valid_ids->GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_ids->GetBreakpointIDAtIndex (i);
Breakpoint *breakpoint = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
@@ -578,9 +579,10 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
if (cur_bp_id.GetLocationID() > num_locations)
{
StreamString id_str;
- BreakpointID::GetCanonicalReference (&id_str, cur_bp_id.GetBreakpointID(),
- cur_bp_id.GetLocationID());
- i = valid_ids->Size() + 1;
+ BreakpointID::GetCanonicalReference (&id_str,
+ cur_bp_id.GetBreakpointID(),
+ cur_bp_id.GetLocationID());
+ i = valid_ids->GetSize() + 1;
result.AppendErrorWithFormat ("'%s' is not a currently valid breakpoint/location id.\n",
id_str.GetData());
result.SetStatus (eReturnStatusFailed);
@@ -588,7 +590,7 @@ CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (Args &args, Target *targe
}
else
{
- i = valid_ids->Size() + 1;
+ i = valid_ids->GetSize() + 1;
result.AppendErrorWithFormat ("'%d' is not a currently valid breakpoint id.\n", cur_bp_id.GetBreakpointID());
result.SetStatus (eReturnStatusFailed);
}
@@ -731,7 +733,7 @@ CommandObjectBreakpointList::Execute
{
// No breakpoint selected; show info about all currently set breakpoints.
result.AppendMessage ("Current breakpoints:");
- for (int i = 0; i < num_breakpoints; ++i)
+ for (size_t i = 0; i < num_breakpoints; ++i)
{
Breakpoint *breakpoint = breakpoints.GetBreakpointByIndex (i).get();
AddBreakpointDescription (&output_stream, breakpoint, m_options.m_level);
@@ -746,7 +748,7 @@ CommandObjectBreakpointList::Execute
if (result.Succeeded())
{
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ for (size_t i = 0; i < valid_bp_ids.GetSize(); ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
Breakpoint *breakpoint = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
@@ -834,7 +836,8 @@ CommandObjectBreakpointEnable::Execute
{
int enable_count = 0;
int loc_count = 0;
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
@@ -933,7 +936,8 @@ CommandObjectBreakpointDisable::Execute
{
int disable_count = 0;
int loc_count = 0;
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
@@ -1035,7 +1039,8 @@ CommandObjectBreakpointDelete::Execute
{
int delete_count = 0;
int disable_count = 0;
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
@@ -1074,12 +1079,15 @@ CommandObjectBreakpointDelete::Execute
CommandObjectBreakpointModify::CommandOptions::CommandOptions() :
Options (),
+ m_ignore_count (0),
m_thread_id(LLDB_INVALID_THREAD_ID),
- m_thread_index (-1),
+ m_thread_index (UINT32_MAX),
m_thread_name(),
m_queue_name(),
- m_ignore_count (-1),
- m_enable_passed (false)
+ m_enable_passed (false),
+ m_enable_value (false),
+ m_name_passed (false),
+ m_queue_passed (false)
{
}
@@ -1139,8 +1147,8 @@ CommandObjectBreakpointModify::CommandOptions::SetOptionValue (int option_idx, c
break;
case 'k':
{
- m_ignore_count = Args::StringToSInt32(optarg, -1, 0);
- if (m_ignore_count == -1)
+ m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0);
+ if (m_ignore_count == UINT32_MAX)
error.SetErrorStringWithFormat ("Invalid ignore count '%s'.\n", optarg);
}
break;
@@ -1167,8 +1175,8 @@ CommandObjectBreakpointModify::CommandOptions::SetOptionValue (int option_idx, c
break;
case 'x':
{
- m_thread_index = Args::StringToUInt64(optarg, -1, 0);
- if (m_thread_id == -1)
+ m_thread_index = Args::StringToUInt32 (optarg, UINT32_MAX, 0);
+ if (m_thread_id == UINT32_MAX)
error.SetErrorStringWithFormat ("Invalid thread index string '%s'.\n", optarg);
}
@@ -1186,9 +1194,9 @@ CommandObjectBreakpointModify::CommandOptions::ResetOptionValues ()
{
Options::ResetOptionValues();
- m_ignore_count = -1;
+ m_ignore_count = 0;
m_thread_id = LLDB_INVALID_THREAD_ID;
- m_thread_index = -1;
+ m_thread_index = UINT32_MAX;
m_thread_name.clear();
m_queue_name.clear();
m_enable_passed = false;
@@ -1249,7 +1257,8 @@ CommandObjectBreakpointModify::Execute
if (result.Succeeded())
{
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
@@ -1264,7 +1273,7 @@ CommandObjectBreakpointModify::Execute
if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
location->SetThreadID (m_options.m_thread_id);
- if (m_options.m_thread_index != -1)
+ if (m_options.m_thread_index != UINT32_MAX)
location->GetLocationOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
if (m_options.m_name_passed)
@@ -1273,7 +1282,7 @@ CommandObjectBreakpointModify::Execute
if (m_options.m_queue_passed)
location->GetLocationOptions()->GetThreadSpec()->SetQueueName(m_options.m_queue_name.c_str());
- if (m_options.m_ignore_count != -1)
+ if (m_options.m_ignore_count != 0)
location->GetLocationOptions()->SetIgnoreCount(m_options.m_ignore_count);
if (m_options.m_enable_passed)
@@ -1285,7 +1294,7 @@ CommandObjectBreakpointModify::Execute
if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID)
bp->SetThreadID (m_options.m_thread_id);
- if (m_options.m_thread_index != -1)
+ if (m_options.m_thread_index != UINT32_MAX)
bp->GetOptions()->GetThreadSpec()->SetIndex(m_options.m_thread_index);
if (m_options.m_name_passed)
@@ -1294,7 +1303,7 @@ CommandObjectBreakpointModify::Execute
if (m_options.m_queue_passed)
bp->GetOptions()->GetThreadSpec()->SetQueueName(m_options.m_queue_name.c_str());
- if (m_options.m_ignore_count != -1)
+ if (m_options.m_ignore_count != 0)
bp->GetOptions()->SetIgnoreCount(m_options.m_ignore_count);
if (m_options.m_enable_passed)
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h
index 20f2c3b994a..b998e3d07c3 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.h
+++ b/lldb/source/Commands/CommandObjectBreakpoint.h
@@ -104,9 +104,9 @@ public:
std::string m_func_name;
uint32_t m_func_name_type_mask;
std::string m_func_regexp;
- lldb::addr_t m_load_addr;
STLStringArray m_modules;
- int32_t m_ignore_count;
+ lldb::addr_t m_load_addr;
+ uint32_t m_ignore_count;
lldb::tid_t m_thread_id;
uint32_t m_thread_index;
std::string m_thread_name;
@@ -164,7 +164,7 @@ public:
// Instance variables to hold the values for command options.
- int32_t m_ignore_count;
+ uint32_t m_ignore_count;
lldb::tid_t m_thread_id;
uint32_t m_thread_index;
std::string m_thread_name;
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index 547192dc68a..123a5ade061 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -244,7 +244,8 @@ CommandObjectBreakpointCommandAdd::Execute
if (result.Succeeded())
{
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
@@ -441,7 +442,8 @@ CommandObjectBreakpointCommandRemove::Execute
if (result.Succeeded())
{
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
@@ -526,7 +528,8 @@ CommandObjectBreakpointCommandList::Execute
if (result.Succeeded())
{
- for (int i = 0; i < valid_bp_ids.Size(); ++i)
+ const size_t count = valid_bp_ids.GetSize();
+ for (size_t i = 0; i < count; ++i)
{
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index b2c4ec32808..0db3c3a6818 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -205,14 +205,14 @@ public:
CommandReturnObject &result
)
{
- const int argc = args.GetArgumentCount();
+ const size_t argc = args.GetArgumentCount();
if (argc < 2)
- {
+ {
result.AppendError ("'alias' requires at least two arguments");
result.SetStatus (eReturnStatusFailed);
return false;
- }
+ }
const std::string alias_command = args.GetArgumentAtIndex(0);
const std::string actual_command = args.GetArgumentAtIndex(1);
@@ -236,7 +236,7 @@ public:
if (command_obj_sp.get())
{
CommandObject *cmd_obj = command_obj_sp.get();
- CommandObject *sub_cmd_obj;
+ CommandObject *sub_cmd_obj = NULL;
OptionArgVectorSP option_arg_vector_sp = OptionArgVectorSP (new OptionArgVector);
OptionArgVector *option_arg_vector = option_arg_vector_sp.get();
@@ -299,7 +299,7 @@ public:
}
else
{
- for (int i = 0; i < args.GetArgumentCount(); ++i)
+ for (size_t i = 0; i < argc; ++i)
option_arg_vector->push_back (OptionArgPair ("<argument>",
std::string (args.GetArgumentAtIndex (i))));
}
diff --git a/lldb/source/Commands/CommandObjectCrossref.cpp b/lldb/source/Commands/CommandObjectCrossref.cpp
index 0d11369c6e7..a9e833e3a4d 100644
--- a/lldb/source/Commands/CommandObjectCrossref.cpp
+++ b/lldb/source/Commands/CommandObjectCrossref.cpp
@@ -74,7 +74,8 @@ CommandObjectCrossref::GenerateHelpText (CommandReturnObject &result)
{
result.AppendMessage ("This command can be called on the following types of objects:");
- for (int i = 0; i < m_crossref_object_types.GetArgumentCount(); ++i)
+ const size_t count = m_crossref_object_types.GetArgumentCount();
+ for (size_t i = 0; i < count; ++i)
{
const char *obj_name = m_crossref_object_types.GetArgumentAtIndex(i);
result.AppendMessageWithFormat (" %s (e.g. '%s %s')\n", obj_name,
diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp
index 37802a85b2a..4bf8a30edba 100644
--- a/lldb/source/Commands/CommandObjectHelp.cpp
+++ b/lldb/source/Commands/CommandObjectHelp.cpp
@@ -27,8 +27,8 @@ using namespace lldb_private;
CommandObjectHelp::CommandObjectHelp () :
CommandObject ("help",
- "Shows a list of all debugger commands, or give details about specific commands.",
- "help [<cmd-name>]")
+ "Shows a list of all debugger commands, or give details about specific commands.",
+ "help [<cmd-name>]")
{
}
@@ -123,7 +123,8 @@ CommandObjectHelp::Execute (CommandInterpreter &interpreter, Args& command, Comm
{
Stream &output_strm = result.GetOutputStream();
output_strm.Printf("Help requested with ambiguous command name, possible completions:\n");
- for (int i = 0; i < matches.GetSize(); i++)
+ const uint32_t match_count = matches.GetSize();
+ for (uint32_t i = 0; i < match_count; i++)
{
output_strm.Printf("\t%s\n", matches.GetStringAtIndex(i));
}
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index c835aa311a6..0b61816fbcb 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -469,7 +469,7 @@ public:
OptionElementVector &opt_element_vector,
int match_start_point,
int max_return_elements,
- bool word_complete,
+ bool &word_complete,
StringList &matches)
{
// Arguments are the standard source file completer.
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 9400200070a..30dfe2a0bd5 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -462,11 +462,20 @@ public:
return false;
}
- size_t item_byte_size = m_options.m_byte_size ? m_options.m_byte_size : 1;
StreamString buffer (Stream::eBinary,
process->GetAddressByteSize(),
process->GetByteOrder());
+ size_t item_byte_size = m_options.m_byte_size;
+
+ if (m_options.m_byte_size == 0)
+ {
+ if (m_options.m_format == eFormatPointer)
+ item_byte_size = buffer.GetAddressByteSize();
+ else
+ item_byte_size = 1;
+ }
+
lldb::addr_t addr = Args::StringToUInt64(command.GetArgumentAtIndex(0), LLDB_INVALID_ADDRESS, 0);
if (addr == LLDB_INVALID_ADDRESS)
@@ -513,6 +522,8 @@ public:
case eFormatDefault:
case eFormatBytes:
case eFormatHex:
+ case eFormatPointer:
+
// Decode hex bytes
uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 16, &success);
if (!success)
diff --git a/lldb/source/Commands/CommandObjectSyntax.cpp b/lldb/source/Commands/CommandObjectSyntax.cpp
index 3279da2c1d6..072ae29777e 100644
--- a/lldb/source/Commands/CommandObjectSyntax.cpp
+++ b/lldb/source/Commands/CommandObjectSyntax.cpp
@@ -40,62 +40,20 @@ CommandObjectSyntax::~CommandObjectSyntax()
bool
-CommandObjectSyntax::OldExecute
+CommandObjectSyntax::Execute
(
+ CommandInterpreter &interpreter,
Args& command,
- Debugger *context,
- CommandInterpreter *interpreter,
CommandReturnObject &result
)
{
- CommandObject *cmd_obj;
-
- if (command.GetArgumentCount() != 0)
- {
- cmd_obj = interpreter->GetCommandObject(command.GetArgumentAtIndex(0));
- if (cmd_obj)
- {
- Stream &output_strm = result.GetOutputStream();
- if (cmd_obj->GetOptions() != NULL)
- {
- output_strm.Printf ("\nSyntax: %s\n", cmd_obj->GetSyntax());
- //cmd_obj->GetOptions()->GenerateOptionUsage (output_strm, cmd_obj);
- output_strm.Printf ("(Try 'help %s' for more information on command options syntax.)\n",
- cmd_obj->GetCommandName());
- result.SetStatus (eReturnStatusSuccessFinishNoResult);
- }
- else
- {
- output_strm.Printf ("\nSyntax: %s\n", cmd_obj->GetSyntax());
- result.SetStatus (eReturnStatusSuccessFinishNoResult);
- }
- }
- else
- {
- result.AppendErrorWithFormat ("'%s' is not a known command.\n", command.GetArgumentAtIndex(0));
- result.AppendError ("Try 'help' to see a current list of commands.");
- result.SetStatus (eReturnStatusFailed);
- }
- }
- else
- {
- result.AppendError ("Must call 'syntax' with a valid command.");
- result.SetStatus (eReturnStatusFailed);
- }
- return result.Succeeded();
-}
-
-bool
-CommandObjectSyntax::Execute (Args &command, Debugger *context, CommandInterpreter *interpreter,
- CommandReturnObject &result)
-{
CommandObject::CommandMap::iterator pos;
CommandObject *cmd_obj;
const int argc = command.GetArgumentCount();
if (argc > 0)
{
- cmd_obj = interpreter->GetCommandObject (command.GetArgumentAtIndex(0));
+ cmd_obj = interpreter.GetCommandObject (command.GetArgumentAtIndex(0));
bool all_okay = true;
for (int i = 1; i < argc; ++i)
{
diff --git a/lldb/source/Commands/CommandObjectSyntax.h b/lldb/source/Commands/CommandObjectSyntax.h
index 3caf533fed8..47b3e8e1033 100644
--- a/lldb/source/Commands/CommandObjectSyntax.h
+++ b/lldb/source/Commands/CommandObjectSyntax.h
@@ -30,17 +30,10 @@ public:
virtual
~CommandObjectSyntax ();
-
- bool
- OldExecute (Args& command,
- Debugger *context,
- CommandInterpreter *interpreter,
- CommandReturnObject &result);
virtual bool
- Execute (Args& command,
- Debugger *context,
- CommandInterpreter *interpreter,
+ Execute (CommandInterpreter &interpreter,
+ Args& command,
CommandReturnObject &result);
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 97387584d5f..85829124b41 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -173,7 +173,7 @@ lldb_private::DisplayFramesForExecutionContext
strm.IndentMore();
StackFrameSP frame_sp;
- int frame_idx = 0;
+ uint32_t frame_idx = 0;
if (ascending)
{
diff --git a/lldb/source/Commands/Makefile b/lldb/source/Commands/Makefile
new file mode 100644
index 00000000000..dbef40c520b
--- /dev/null
+++ b/lldb/source/Commands/Makefile
@@ -0,0 +1,14 @@
+##===- source/Commands/Makefile ----------------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LLDB_LEVEL := ../..
+LIBRARYNAME := lldbCommands
+BUILD_ARCHIVE = 1
+
+include $(LLDB_LEVEL)/Makefile
OpenPOWER on IntegriCloud