diff options
author | emaste <emaste@FreeBSD.org> | 2015-02-06 22:25:21 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-02-06 22:25:21 +0000 |
commit | fa0e7b41694bc598cd3df2405d0384ea29d7537e (patch) | |
tree | 5e5b6a0774e0d93bb4cfa2f9f83b9c41b38c4448 /contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp | |
parent | d2b9c88b24f95cd9f8e7bd621cfa454ce759c687 (diff) | |
parent | 0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (diff) | |
download | FreeBSD-src-fa0e7b41694bc598cd3df2405d0384ea29d7537e.zip FreeBSD-src-fa0e7b41694bc598cd3df2405d0384ea29d7537e.tar.gz |
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp b/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp index 3fdbf99..753e720 100644 --- a/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp +++ b/contrib/llvm/tools/lldb/source/Interpreter/CommandObject.cpp @@ -49,7 +49,7 @@ CommandObject::CommandObject uint32_t flags ) : m_interpreter (interpreter), - m_cmd_name (name), + m_cmd_name (name ? name : ""), m_cmd_help_short (), m_cmd_help_long (), m_cmd_syntax (), @@ -236,19 +236,34 @@ CommandObject::CheckRequirements (CommandReturnObject &result) if ((flags & eFlagRequiresProcess) && !m_exe_ctx.HasProcessScope()) { - result.AppendError (GetInvalidProcessDescription()); + if (!m_exe_ctx.HasTargetScope()) + result.AppendError (GetInvalidTargetDescription()); + else + result.AppendError (GetInvalidProcessDescription()); return false; } if ((flags & eFlagRequiresThread) && !m_exe_ctx.HasThreadScope()) { - result.AppendError (GetInvalidThreadDescription()); + if (!m_exe_ctx.HasTargetScope()) + result.AppendError (GetInvalidTargetDescription()); + else if (!m_exe_ctx.HasProcessScope()) + result.AppendError (GetInvalidProcessDescription()); + else + result.AppendError (GetInvalidThreadDescription()); return false; } if ((flags & eFlagRequiresFrame) && !m_exe_ctx.HasFrameScope()) { - result.AppendError (GetInvalidFrameDescription()); + if (!m_exe_ctx.HasTargetScope()) + result.AppendError (GetInvalidTargetDescription()); + else if (!m_exe_ctx.HasProcessScope()) + result.AppendError (GetInvalidProcessDescription()); + else if (!m_exe_ctx.HasThreadScope()) + result.AppendError (GetInvalidThreadDescription()); + else + result.AppendError (GetInvalidFrameDescription()); return false; } @@ -733,6 +748,22 @@ BreakpointIDRangeHelpTextCallback () } static const char * +BreakpointNameHelpTextCallback () +{ + return "A name that can be added to a breakpoint when it is created, or later " + "on with the \"breakpoint name add\" command. " + "Breakpoint names can be used to specify breakpoints in all the places breakpoint ID's " + "and breakpoint ID ranges can be used. As such they provide a convenient way to group breakpoints, " + "and to operate on breakpoints you create without having to track the breakpoint number. " + "Note, the attributes you set when using a breakpoint name in a breakpoint command don't " + "adhere to the name, but instead are set individually on all the breakpoints currently tagged with that name. Future breakpoints " + "tagged with that name will not pick up the attributes previously given using that name. " + "In order to distinguish breakpoint names from breakpoint ID's and ranges, " + "names must start with a letter from a-z or A-Z and cannot contain spaces, \".\" or \"-\". " + "Also, breakpoint names can only be applied to breakpoints, not to breakpoint locations."; +} + +static const char * GDBFormatHelpTextCallback () { return "A GDB format consists of a repeat count, a format letter and a size letter. " @@ -1003,6 +1034,18 @@ CommandObject::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType return nullptr; } +Target * +CommandObject::GetDummyTarget() +{ + return m_interpreter.GetDebugger().GetDummyTarget(); +} + +Target * +CommandObject::GetSelectedOrDummyTarget(bool prefer_dummy) +{ + return m_interpreter.GetDebugger().GetSelectedOrDummyTarget(prefer_dummy); +} + bool CommandObjectParsed::Execute (const char *args_string, CommandReturnObject &result) { @@ -1085,6 +1128,7 @@ CommandObject::g_arguments_data[] = { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { nullptr, false }, "A Boolean value: 'true' or 'false'" }, { eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, { BreakpointIDHelpTextCallback, false }, nullptr }, { eArgTypeBreakpointIDRange, "breakpt-id-list", CommandCompletions::eNoCompletion, { BreakpointIDRangeHelpTextCallback, false }, nullptr }, + { eArgTypeBreakpointName, "breakpoint-name", CommandCompletions::eNoCompletion, { BreakpointNameHelpTextCallback, false }, nullptr }, { eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, { nullptr, false }, "Number of bytes to use." }, { eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, { nullptr, false }, "Then name of a class from the debug information in the program." }, { eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A debugger command (may be multiple words), without any options or arguments." }, @@ -1103,6 +1147,7 @@ CommandObject::g_arguments_data[] = { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function." }, { eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function or symbol." }, { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, nullptr }, + { eArgTypeHelpText, "help-text", CommandCompletions::eNoCompletion, { nullptr, false }, "Text to be used as help for some other entity in LLDB" }, { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a list." }, { eArgTypeLanguage, "language", CommandCompletions::eNoCompletion, { LanguageTypeHelpTextCallback, true }, nullptr }, { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { nullptr, false }, "Line number in a source file." }, |