summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp115
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.h5
-rw-r--r--lldb/source/Commands/CommandObjectCall.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectImage.cpp9
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp10
7 files changed, 100 insertions, 47 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 01d29fbd81b..830fbec6fbc 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -52,6 +52,7 @@ CommandObjectBreakpointSet::CommandOptions::CommandOptions() :
m_column (0),
m_ignore_inlines (false),
m_func_name (),
+ m_func_name_type_mask (0),
m_func_regexp (),
m_modules (),
m_load_addr(),
@@ -70,31 +71,28 @@ CommandObjectBreakpointSet::CommandOptions::~CommandOptions ()
lldb::OptionDefinition
CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>",
+ { LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>",
"Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."},
- { LLDB_OPT_SET_ALL, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL,
- "Ignore inlined subroutines when setting the breakppoint." },
-
- { LLDB_OPT_SET_ALL, false, "ignore_count", 'k', required_argument, NULL, 0, NULL,
+ { LLDB_OPT_SET_ALL, false, "ignore_count", 'k', required_argument, NULL, 0, "<n>",
"Set the number of times this breakpoint is sKipped before stopping." },
- { LLDB_OPT_SET_ALL, false, "thread_index", 'x', required_argument, NULL, NULL, "<thread_index>",
+ { LLDB_OPT_SET_ALL, false, "thread_index", 'x', required_argument, NULL, NULL, "<thread_index>",
"The breakpoint stops only for the thread whose indeX matches this argument."},
- { LLDB_OPT_SET_ALL, false, "thread_id", 't', required_argument, NULL, NULL, "<thread_id>",
+ { LLDB_OPT_SET_ALL, false, "thread_id", 't', required_argument, NULL, NULL, "<thread_id>",
"The breakpoint stops only for the thread whose TID matches this argument."},
- { LLDB_OPT_SET_ALL, false, "thread_name", 'T', required_argument, NULL, NULL, "<thread_name>",
+ { LLDB_OPT_SET_ALL, false, "thread_name", 'T', required_argument, NULL, NULL, "<thread_name>",
"The breakpoint stops only for the thread whose thread name matches this argument."},
- { LLDB_OPT_SET_ALL, false, "queue_name", 'q', required_argument, NULL, NULL, "<queue_name>",
+ { LLDB_OPT_SET_ALL, false, "queue_name", 'q', required_argument, NULL, NULL, "<queue_name>",
"The breakpoint stops only for threads in the queue whose name is given by this argument."},
- { LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<filename>",
+ { LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<filename>",
"Set the breakpoint by source location in this particular file."},
- { LLDB_OPT_SET_1, true, "line", 'l', required_argument, NULL, 0, "<linenum>",
+ { LLDB_OPT_SET_1, true, "line", 'l', required_argument, NULL, 0, "<linenum>",
"Set the breakpoint by source location at this particular line."},
// Comment out this option for the moment, as we don't actually use it, but will in the future.
@@ -102,12 +100,24 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] =
// { 0, false, "column", 'c', required_argument, NULL, "<column>",
// "Set the breakpoint by source location at this particular column."},
- { LLDB_OPT_SET_2, true, "address", 'a', required_argument, NULL, 0, "<address>",
+ { LLDB_OPT_SET_2, true, "address", 'a', required_argument, NULL, 0, "<address>",
"Set the breakpoint by address, at the specified address."},
- { LLDB_OPT_SET_3, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<function-name>",
+ { LLDB_OPT_SET_3, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<name>",
"Set the breakpoint by function name." },
+ { LLDB_OPT_SET_3, false, "basename", 'b', no_argument, NULL, 0, NULL,
+ "Used in conjuction with --name <name> to search function basenames." },
+
+ { LLDB_OPT_SET_3, false, "fullname", 'F', no_argument, NULL, 0, NULL,
+ "Used in conjuction with --name <name> to search fully qualified function names. For C++ this means namespaces and all arguemnts, and for Objective C this means a full function prototype with class and selector." },
+
+ { LLDB_OPT_SET_3, false, "selector", 'S', no_argument, NULL, 0, NULL,
+ "Used in conjuction with --name <name> to search objective C selector names." },
+
+ { LLDB_OPT_SET_3, false, "method", 'm', no_argument, NULL, 0, NULL,
+ "Used in conjuction with --name <name> to search objective C selector C++ method names." },
+
{ LLDB_OPT_SET_4, true, "func_regex", 'r', required_argument, NULL, 0, "<regular-expression>",
"Set the breakpoint by function name, evaluating a regular-expression to find the function name(s)." },
@@ -140,21 +150,39 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons
case 'c':
m_column = Args::StringToUInt32 (option_arg, 0);
break;
+
case 'f':
m_filename = option_arg;
break;
- case 'i':
- m_ignore_inlines = true;
- break;
+
case 'l':
m_line_num = Args::StringToUInt32 (option_arg, 0);
break;
+
case 'n':
m_func_name = option_arg;
break;
+
+ case 'b':
+ m_func_name_type_mask |= eFunctionNameTypeBase;
+ break;
+
+ case 'F':
+ m_func_name_type_mask |= eFunctionNameTypeFull;
+ break;
+
+ case 'S':
+ m_func_name_type_mask |= eFunctionNameTypeSelector;
+ break;
+
+ case 'm':
+ m_func_name_type_mask |= eFunctionNameTypeMethod;
+ break;
+
case 'r':
m_func_regexp = option_arg;
break;
+
case 's':
{
m_modules.push_back (std::string (option_arg));
@@ -204,8 +232,8 @@ CommandObjectBreakpointSet::CommandOptions::ResetOptionValues ()
m_filename.clear();
m_line_num = 0;
m_column = 0;
- m_ignore_inlines = false;
m_func_name.clear();
+ m_func_name_type_mask = 0;
m_func_regexp.clear();
m_load_addr = LLDB_INVALID_ADDRESS;
m_modules.clear();
@@ -357,32 +385,50 @@ CommandObjectBreakpointSet::Execute
case eSetTypeAddress: // Breakpoint by address
bp = target->CreateBreakpoint (m_options.m_load_addr, false).get();
break;
+
case eSetTypeFunctionName: // Breakpoint by function name
- if (use_module)
{
- for (int i = 0; i < num_modules; ++i)
+ uint32_t name_type_mask = m_options.m_func_name_type_mask;
+
+ if (name_type_mask == 0)
{
- module.SetFile(m_options.m_modules[i].c_str());
- bp = target->CreateBreakpoint (&module, m_options.m_func_name.c_str()).get();
- if (bp)
- {
- StreamString &output_stream = result.GetOutputStream();
- output_stream.Printf ("Breakpoint created: ");
- bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief);
- output_stream.EOL();
- result.SetStatus (eReturnStatusSuccessFinishResult);
- }
+
+ if (m_options.m_func_name.find('(') != std::string::npos ||
+ m_options.m_func_name.find("-[") == 0 ||
+ m_options.m_func_name.find("+[") == 0)
+ name_type_mask |= eFunctionNameTypeFull;
else
+ name_type_mask |= eFunctionNameTypeBase;
+ }
+
+
+ if (use_module)
+ {
+ for (int i = 0; i < num_modules; ++i)
{
- result.AppendErrorWithFormat("Breakpoint creation failed: No breakpoint created in module '%s'.\n",
- m_options.m_modules[i].c_str());
- result.SetStatus (eReturnStatusFailed);
+ module.SetFile(m_options.m_modules[i].c_str());
+ bp = target->CreateBreakpoint (&module, m_options.m_func_name.c_str(), name_type_mask, Breakpoint::Exact).get();
+ if (bp)
+ {
+ StreamString &output_stream = result.GetOutputStream();
+ output_stream.Printf ("Breakpoint created: ");
+ bp->GetDescription(&output_stream, lldb::eDescriptionLevelBrief);
+ output_stream.EOL();
+ result.SetStatus (eReturnStatusSuccessFinishResult);
+ }
+ else
+ {
+ result.AppendErrorWithFormat("Breakpoint creation failed: No breakpoint created in module '%s'.\n",
+ m_options.m_modules[i].c_str());
+ result.SetStatus (eReturnStatusFailed);
+ }
}
}
+ else
+ bp = target->CreateBreakpoint (NULL, m_options.m_func_name.c_str(), name_type_mask, Breakpoint::Exact).get();
}
- else
- bp = target->CreateBreakpoint (NULL, m_options.m_func_name.c_str()).get();
break;
+
case eSetTypeFunctionRegexp: // Breakpoint by regular expression function name
{
RegularExpression regexp(m_options.m_func_regexp.c_str());
@@ -412,6 +458,7 @@ CommandObjectBreakpointSet::Execute
bp = target->CreateBreakpoint (NULL, regexp).get();
}
break;
+
default:
break;
}
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h
index 92bea698847..20f2c3b994a 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.h
+++ b/lldb/source/Commands/CommandObjectBreakpoint.h
@@ -98,10 +98,11 @@ public:
// Instance variables to hold the values for command options.
std::string m_filename;
- unsigned int m_line_num;
- unsigned int m_column;
+ uint32_t m_line_num;
+ uint32_t m_column;
bool m_ignore_inlines;
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;
diff --git a/lldb/source/Commands/CommandObjectCall.cpp b/lldb/source/Commands/CommandObjectCall.cpp
index a2cbc05ce13..12281b361cb 100644
--- a/lldb/source/Commands/CommandObjectCall.cpp
+++ b/lldb/source/Commands/CommandObjectCall.cpp
@@ -295,7 +295,7 @@ CommandObjectCall::Execute
lldb::OptionDefinition
CommandObjectCall::CommandOptions::g_option_table[] =
{
-{ LLDB_OPT_SET_1, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."},
+{ LLDB_OPT_SET_1, false, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."},
{ LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."},
{ LLDB_OPT_SET_1, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."},
{ LLDB_OPT_SET_1, false, "noexecute", 'n', no_argument, NULL, 0, "no execute", "Only JIT and copy the wrapper & arguments, but don't execute."},
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index c2abeee702c..c5fbbea0b41 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -389,7 +389,9 @@ CommandObjectDisassemble::Execute
{
SymbolContextList sc_list;
- if (target->GetImages().FindFunctions(name, sc_list))
+ if (target->GetImages().FindFunctions(name,
+ eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector,
+ sc_list))
{
Disassemble (interpreter, result, disassembler, sc_list);
}
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 7ddd3a176be..e98303c739e 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -456,7 +456,7 @@ CommandObjectExpression::ExecuteRawCommandString
lldb::OptionDefinition
CommandObjectExpression::CommandOptions::g_option_table[] =
{
-{ LLDB_OPT_SET_ALL, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."},
+{ LLDB_OPT_SET_ALL, false, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."},
{ LLDB_OPT_SET_ALL, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."},
{ LLDB_OPT_SET_ALL, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."},
{ LLDB_OPT_SET_ALL, false, "use-ir", 'i', no_argument, NULL, 0, NULL, "[Temporary] Instructs the expression evaluator to use IR instead of ASTs."},
diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp
index 38a04ecf5f0..cb717c41bbd 100644
--- a/lldb/source/Commands/CommandObjectImage.cpp
+++ b/lldb/source/Commands/CommandObjectImage.cpp
@@ -227,9 +227,12 @@ LookupAddressInModule (CommandInterpreter &interpreter, Stream &strm, Module *mo
strm.Printf("0x%llx: ", addr);
ExecutionContextScope *exe_scope = interpreter.GetDebugger().GetExecutionContext().GetBestExecutionContextScope();
- if (so_addr.Dump (&strm, exe_scope, Address::DumpStyleSectionNameOffset))
- strm.PutCString(": ");
+ strm.IndentMore();
+ strm.Indent (" Address: ");
+ so_addr.Dump (&strm, exe_scope, Address::DumpStyleSectionNameOffset);
+ strm.EOL();
so_addr.Dump (&strm, exe_scope, Address::DumpStyleResolvedDescription);
+ strm.IndentLess();
return true;
}
@@ -347,7 +350,7 @@ LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *m
else
{
ConstString function_name(name);
- num_matches = symbol_vendor->FindFunctions(function_name, true, sc_list);
+ num_matches = symbol_vendor->FindFunctions(function_name, eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeMethod | eFunctionNameTypeSelector, true, sc_list);
}
if (num_matches)
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index bf4843da67f..0fd53fe9c78 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -619,8 +619,8 @@ g_duo_running_mode[] =
lldb::OptionDefinition
CommandObjectThreadStepWithTypeAndScope::CommandOptions::g_option_table[] =
{
-{ LLDB_OPT_SET_1, true, "avoid_no_debug", 'a', required_argument, NULL, 0, "<avoid_no_debug>", "Should step-in step over functions with no debug information"},
-{ LLDB_OPT_SET_1, true, "run_mode", 'm', required_argument, g_tri_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"},
+{ LLDB_OPT_SET_1, false, "avoid_no_debug", 'a', required_argument, NULL, 0, "<avoid_no_debug>", "Should step-in step over functions with no debug information"},
+{ LLDB_OPT_SET_1, false, "run_mode", 'm', required_argument, g_tri_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"},
{ 0, false, NULL, 0, 0, NULL, 0, NULL, NULL }
};
@@ -1060,9 +1060,9 @@ protected:
lldb::OptionDefinition
CommandObjectThreadUntil::CommandOptions::g_option_table[] =
{
-{ LLDB_OPT_SET_1, true, "frame", 'f', required_argument, NULL, 0, "<frame>", "Frame index for until operation - defaults to 0"},
-{ LLDB_OPT_SET_1, true, "thread", 't', required_argument, NULL, 0, "<thread>", "Thread index for the thread for until operation"},
-{ LLDB_OPT_SET_1, true, "run_mode", 'm', required_argument, g_duo_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"},
+{ LLDB_OPT_SET_1, false, "frame", 'f', required_argument, NULL, 0, "<frame>", "Frame index for until operation - defaults to 0"},
+{ LLDB_OPT_SET_1, false, "thread", 't', required_argument, NULL, 0, "<thread>", "Thread index for the thread for until operation"},
+{ LLDB_OPT_SET_1, false, "run_mode",'m', required_argument, g_duo_running_mode, 0, "<run_mode>","Determine how to run other threads while stepping this one"},
{ 0, false, NULL, 0, 0, NULL, 0, NULL, NULL }
};
OpenPOWER on IntegriCloud