<rdar://problem/12552374>
authorEnrico Granata <egranata@apple.com>
Tue, 29 Jan 2013 01:48:30 +0000 (01:48 +0000)
committerEnrico Granata <egranata@apple.com>
Tue, 29 Jan 2013 01:48:30 +0000 (01:48 +0000)
Replacing the address argument type with address-expression in cases where StringToAddress() is used, and hence an expression can be passed where previously only a numeric address was allowed
This makes the documentation more clear and helps users discover that they can truly pass in an expression in these situations.

llvm-svn: 173753

lldb/include/lldb/lldb-enumerations.h
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/source/Commands/CommandObjectDisassemble.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Commands/CommandObjectSource.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Interpreter/CommandObject.cpp

index b4ed1f5..b3feb8e 100644 (file)
@@ -369,6 +369,7 @@ namespace lldb {
     typedef enum CommandArgumentType
     {
         eArgTypeAddress = 0,
+        eArgTypeAddressOrExpression,
         eArgTypeAliasName,
         eArgTypeAliasOptions,
         eArgTypeArchitecture,
index b43cf86..87566ad 100644 (file)
@@ -639,7 +639,7 @@ 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, eArgTypeAddress,
+    { LLDB_OPT_SET_2, true, "address", 'a', required_argument, NULL, 0, eArgTypeAddressOrExpression,
         "Set the breakpoint by address, at the specified address."},
 
     { LLDB_OPT_SET_3, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
index 9f131ac..8478541 100644 (file)
@@ -191,8 +191,8 @@ CommandObjectDisassemble::CommandOptions::g_option_table[] =
 { LLDB_OPT_SET_ALL, false, "plugin"       , 'P', required_argument  , NULL, 0, eArgTypePlugin,      "Name of the disassembler plugin you want to use."},
 { LLDB_OPT_SET_ALL, false, "arch"         , 'a', required_argument  , NULL, 0, eArgTypeArchitecture,"Specify the architecture to use from cross disassembly."},
 { LLDB_OPT_SET_1  |
-  LLDB_OPT_SET_2  , true , "start-address", 's', required_argument  , NULL, 0, eArgTypeStartAddress,"Address at which to start disassembling."},
-{ LLDB_OPT_SET_1  , false, "end-address"  , 'e', required_argument  , NULL, 0, eArgTypeEndAddress,  "Address at which to end disassembling."},
+  LLDB_OPT_SET_2  , true , "start-address", 's', required_argument  , NULL, 0, eArgTypeAddressOrExpression,"Address at which to start disassembling."},
+{ LLDB_OPT_SET_1  , false, "end-address"  , 'e', required_argument  , NULL, 0, eArgTypeAddressOrExpression,  "Address at which to end disassembling."},
 { LLDB_OPT_SET_2  |
   LLDB_OPT_SET_3  |
   LLDB_OPT_SET_4  |
index 26ec9ec..47ddc51 100644 (file)
@@ -317,14 +317,14 @@ public:
         CommandArgumentData end_addr_arg;
         
         // Define the first (and only) variant of this arg.
-        start_addr_arg.arg_type = eArgTypeStartAddress;
+        start_addr_arg.arg_type = eArgTypeAddressOrExpression;
         start_addr_arg.arg_repetition = eArgRepeatPlain;
         
         // There is only one variant this argument could be; put it into the argument entry.
         arg1.push_back (start_addr_arg);
         
         // Define the first (and only) variant of this arg.
-        end_addr_arg.arg_type = eArgTypeEndAddress;
+        end_addr_arg.arg_type = eArgTypeAddressOrExpression;
         end_addr_arg.arg_repetition = eArgRepeatOptional;
         
         // There is only one variant this argument could be; put it into the argument entry.
index f2a2488..0beaadf 100644 (file)
@@ -745,7 +745,7 @@ CommandObjectSourceList::CommandOptions::g_option_table[] =
 { LLDB_OPT_SET_1  , false, "file",   'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, eArgTypeFilename,    "The file from which to display source."},
 { LLDB_OPT_SET_1  , false, "line",   'l', required_argument, NULL, 0, eArgTypeLineNum,    "The line number at which to start the display source."},
 { LLDB_OPT_SET_2  , false, "name",   'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeSymbol,    "The name of a function whose source to display."},
-{ LLDB_OPT_SET_3  , false, "address",'a', required_argument, NULL, 0, eArgTypeAddress, "Lookup the address and display the source information for the corresponding file and line."},
+{ LLDB_OPT_SET_3  , false, "address",'a', required_argument, NULL, 0, eArgTypeAddressOrExpression, "Lookup the address and display the source information for the corresponding file and line."},
 { LLDB_OPT_SET_4, false, "reverse", 'r', no_argument, NULL, 0, eArgTypeNone, "Reverse the listing to look backwards from the last displayed block of source."},
 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
index 64d2684..c3306ff 100644 (file)
@@ -3419,7 +3419,7 @@ protected:
 OptionDefinition
 CommandObjectTargetModulesList::CommandOptions::g_option_table[] =
 {
-    { LLDB_OPT_SET_1, false, "address",    'a', required_argument, NULL, 0, eArgTypeAddress, "Display the image at this address."},
+    { LLDB_OPT_SET_1, false, "address",    'a', required_argument, NULL, 0, eArgTypeAddressOrExpression, "Display the image at this address."},
     { LLDB_OPT_SET_1, false, "arch",       'A', optional_argument, NULL, 0, eArgTypeWidth,   "Display the architecture when listing images."},
     { LLDB_OPT_SET_1, false, "triple",     't', optional_argument, NULL, 0, eArgTypeWidth,   "Display the triple when listing images."},
     { LLDB_OPT_SET_1, false, "header",     'h', no_argument,       NULL, 0, eArgTypeNone,    "Display the image header address as a load address if debugging, a file address otherwise."},
index 391b2f2..c524c98 100644 (file)
@@ -1017,6 +1017,7 @@ CommandObject::ArgumentTableEntry
 CommandObject::g_arguments_data[] =
 {
     { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { NULL, false }, "A valid address in the target program's execution space." },
+    { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { NULL, false }, "A valid address in the target program's execution space or an expression that can be evaluated to an address." },
     { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of an abbreviation (alias) for a debugger command." },
     { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, { NULL, false }, "Command options to be used as part of an alias (abbreviation) definition.  (See 'help commands alias' for more information.)" },
     { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." },