diff options
author | Greg Clayton <gclayton@apple.com> | 2011-10-26 00:56:27 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-10-26 00:56:27 +0000 |
commit | 86edbf41d1ad98b057f0e4e14bbd47eb3b6014f9 (patch) | |
tree | c96760fbcf505ef9bae19c631a55f56523790adb /lldb/source/Interpreter/CommandObject.cpp | |
parent | 2c25d9c0c56fc61be3cbd3cdd5aa0df804329b13 (diff) | |
download | bcm5719-llvm-86edbf41d1ad98b057f0e4e14bbd47eb3b6014f9.tar.gz bcm5719-llvm-86edbf41d1ad98b057f0e4e14bbd47eb3b6014f9.zip |
Cleaned up many error codes. For any who is filling in error strings into
lldb_private::Error objects the rules are:
- short strings that don't start with a capitol letter unless the name is a
class or anything else that is always capitolized
- no trailing newline character
- should be one line if possible
Implemented a first pass at adding "--gdb-format" support to anything that
accepts format with optional size/count.
llvm-svn: 142999
Diffstat (limited to 'lldb/source/Interpreter/CommandObject.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandObject.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 2d3a6b780c8..203a47e1f7d 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -207,7 +207,7 @@ CommandObject::ParseOptions if (error_cstr) { // We got an error string, lets use that - result.GetErrorStream().PutCString(error_cstr); + result.AppendError(error_cstr); } else { @@ -640,16 +640,47 @@ CommandObject::LookupArgumentName (const char *arg_name) static const char * BreakpointIDHelpTextCallback () { - return "Breakpoint ID's consist major and minor numbers; the major number corresponds to the single entity that was created with a 'breakpoint set' command; the minor numbers correspond to all the locations that were actually found/set based on the major breakpoint. A full breakpoint ID might look like 3.14, meaning the 14th location set for the 3rd breakpoint. You can specify all the locations of a breakpoint by just indicating the major breakpoint number. A valid breakpoint id consists either of just the major id number, or the major number, a dot, and the location number (e.g. 3 or 3.2 could both be valid breakpoint ids)."; + return "Breakpoint ID's consist major and minor numbers; the major number " + "corresponds to the single entity that was created with a 'breakpoint set' " + "command; the minor numbers correspond to all the locations that were actually " + "found/set based on the major breakpoint. A full breakpoint ID might look like " + "3.14, meaning the 14th location set for the 3rd breakpoint. You can specify " + "all the locations of a breakpoint by just indicating the major breakpoint " + "number. A valid breakpoint id consists either of just the major id number, " + "or the major number, a dot, and the location number (e.g. 3 or 3.2 could " + "both be valid breakpoint ids)."; } static const char * BreakpointIDRangeHelpTextCallback () { - return "A 'breakpoint id list' is a manner of specifying multiple breakpoints. This can be done through several mechanisms. The easiest way is to just enter a space-separated list of breakpoint ids. To specify all the breakpoint locations under a major breakpoint, you can use the major breakpoint number followed by '.*', eg. '5.*' means all the locations under breakpoint 5. You can also indicate a range of breakpoints by using <start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a range can be any valid breakpoint ids. It is not legal, however, to specify a range using specific locations that cross major breakpoint numbers. I.e. 3.2 - 3.7 is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; + return "A 'breakpoint id list' is a manner of specifying multiple breakpoints. " + "This can be done through several mechanisms. The easiest way is to just " + "enter a space-separated list of breakpoint ids. To specify all the " + "breakpoint locations under a major breakpoint, you can use the major " + "breakpoint number followed by '.*', eg. '5.*' means all the locations under " + "breakpoint 5. You can also indicate a range of breakpoints by using " + "<start-bp-id> - <end-bp-id>. The start-bp-id and end-bp-id for a range can " + "be any valid breakpoint ids. It is not legal, however, to specify a range " + "using specific locations that cross major breakpoint numbers. I.e. 3.2 - 3.7" + " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; } static const char * +GDBFormatHelpTextCallback () +{ + return "A GDB format consists of a repeat count followed by a format letter " + "and a size letter.\n\nFormat letters are o (octal), x (hex), d (decimal), u" + " (unsigned decimal), t (binary), f (float), a (address), i (instruction), " + "c (char) and s (string), T (OSType), A (floating point values in hex).\n\n" + "Size letters are b (byte), h (halfword), w (word), g (giant, 8 bytes).\n\n" + "The specified number of objects of the specified size are printed " + "according to the format.\n\n" + "Defaults for format and size letters are those previously used. Default " + "count is 1."; +} + +static const char * FormatHelpTextCallback () { @@ -803,6 +834,7 @@ CommandObject::g_arguments_data[] = { eArgTypeFrameIndex, "frame-index", CommandCompletions::eNoCompletion, { NULL, false }, "Index into a thread's list of frames." }, { eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a function." }, + { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, NULL }, { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { NULL, false }, "An index into a list." }, { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { NULL, false }, "Line number in a source file." }, { eArgTypeLogCategory, "log-category", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a category within a log channel, e.g. all (try \"log list\" to see a list of all channels and their categories." }, |