Hi Enrico,<div><br></div><div>Shouldn't at least one or two tests actually use the '-O' short option? Just to exercise that code path at least once.</div><div><br></div><div>Thanks,</div><div><br></div><div>  Filipe</div>
<div class="gmail_extra"><br clear="all"><div>  F<br></div><br>
<br><br><div class="gmail_quote">On Tue, Dec 11, 2012 at 7:23 PM, Enrico Granata <span dir="ltr"><<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: enrico<br>
Date: Tue Dec 11 21:23:37 2012<br>
New Revision: 169961<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=169961&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=169961&view=rev</a><br>
Log:<br>
Option changes:<br>
the option to print the runtime-specific description has been modified in the frame variable, memory read and expression command.<br>
<br>
All three commands now support a --object-description option, with a shortcut of -O (uppercase letter o)<br>
<br>
This is a breaking change:<br>
frame variable used --objc as the long option name<br>
expression used -o as a shortcut<br>
memory read uses --objd as the long option name<br>
<br>
Hopefully, most users won't be affected by the change since people tend to access "expression --object-description" under the alias "po" which still works<br>
<br>
The test suite has been tweaked accordingly.<br>
<br>
<br>
Modified:<br>
    lldb/trunk/source/Commands/CommandObjectExpression.cpp<br>
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp<br>
    lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp<br>
    lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py<br>
    lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py<br>
    lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py<br>
<br>
Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)<br>
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Tue Dec 11 21:23:37 2012<br>
@@ -56,7 +56,7 @@<br>
     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "dynamic-value",      'd', required_argument, NULL, 0, eArgTypeBoolean,    "Upcast the value resulting from the expression to its dynamic type if available."},<br>

     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "timeout",            't', required_argument, NULL, 0, eArgTypeUnsignedInteger,  "Timeout value for running the expression."},<br>
     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "unwind-on-error",    'u', required_argument, NULL, 0, eArgTypeBoolean,    "Clean up program state if the expression causes a crash, breakpoint hit or signal."},<br>

-    { LLDB_OPT_SET_2                 , false, "object-description", 'o', no_argument,       NULL, 0, eArgTypeNone,       "Print the object description of the value resulting from the expression."},<br>

+    { LLDB_OPT_SET_2                 , false, "object-description", 'O', no_argument,       NULL, 0, eArgTypeNone,       "Print the object description of the value resulting from the expression."},<br>

 };<br>
<br>
<br>
@@ -113,7 +113,7 @@<br>
         }<br>
         break;<br>
<br>
-    case 'o':<br>
+    case 'O':<br>
         print_object = true;<br>
         break;<br>
<br>
<br>
Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)<br>
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Dec 11 21:23:37 2012<br>
@@ -279,7 +279,7 @@<br>
         AddOrReplaceAliasOptions ("call", alias_arguments_vector_sp);<br>
<br>
         alias_arguments_vector_sp.reset (new OptionArgVector);<br>
-        ProcessAliasOptionsArgs (cmd_obj_sp, "-o --", alias_arguments_vector_sp);<br>
+        ProcessAliasOptionsArgs (cmd_obj_sp, "-O --", alias_arguments_vector_sp);<br>
         AddAlias ("po", cmd_obj_sp);<br>
         AddOrReplaceAliasOptions ("po", alias_arguments_vector_sp);<br>
     }<br>
<br>
Modified: lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original)<br>
+++ lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp Tue Dec 11 21:23:37 2012<br>
@@ -33,17 +33,17 @@<br>
 static OptionDefinition<br>
 g_option_table[] =<br>
 {<br>
-    { LLDB_OPT_SET_1, false, "dynamic-type",     'd', required_argument, g_dynamic_value_types, 0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},<br>

-    { LLDB_OPT_SET_1, false, "synthetic-type",   'S', required_argument, NULL, 0, eArgTypeBoolean,   "Show the object obeying its synthetic provider, if available."},<br>
-    { LLDB_OPT_SET_1, false, "depth",            'D', required_argument, NULL, 0, eArgTypeCount,     "Set the max recurse depth when dumping aggregate types (default is infinity)."},<br>
-    { LLDB_OPT_SET_1, false, "flat",             'F', no_argument,       NULL, 0, eArgTypeNone,      "Display results in a flat format that uses expression paths for each variable or member."},<br>

-    { LLDB_OPT_SET_1, false, "location",         'L', no_argument,       NULL, 0, eArgTypeNone,      "Show variable location information."},<br>
-    { LLDB_OPT_SET_1, false, "objc",             'O', no_argument,       NULL, 0, eArgTypeNone,      "Print as an Objective-C object."},<br>
-    { LLDB_OPT_SET_1, false, "ptr-depth",        'P', required_argument, NULL, 0, eArgTypeCount,     "The number of pointers to be traversed when dumping values (default is zero)."},<br>
-    { LLDB_OPT_SET_1, false, "show-types",       'T', no_argument,       NULL, 0, eArgTypeNone,      "Show variable types when dumping values."},<br>
-    { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set the depth at which omitting summary information stops (default is 1)."},<br>
-    { LLDB_OPT_SET_1, false, "raw-output",       'R', no_argument,       NULL, 0, eArgTypeNone,      "Don't use formatting options."},<br>
-    { LLDB_OPT_SET_1, false, "show-all-children",'A', no_argument,       NULL, 0, eArgTypeNone,      "Ignore the upper bound on the number of children to show."},<br>
+    { LLDB_OPT_SET_1, false, "dynamic-type",       'd', required_argument, g_dynamic_value_types, 0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},<br>

+    { LLDB_OPT_SET_1, false, "synthetic-type",     'S', required_argument, NULL, 0, eArgTypeBoolean,   "Show the object obeying its synthetic provider, if available."},<br>
+    { LLDB_OPT_SET_1, false, "depth",              'D', required_argument, NULL, 0, eArgTypeCount,     "Set the max recurse depth when dumping aggregate types (default is infinity)."},<br>
+    { LLDB_OPT_SET_1, false, "flat",               'F', no_argument,       NULL, 0, eArgTypeNone,      "Display results in a flat format that uses expression paths for each variable or member."},<br>

+    { LLDB_OPT_SET_1, false, "location",           'L', no_argument,       NULL, 0, eArgTypeNone,      "Show variable location information."},<br>
+    { LLDB_OPT_SET_1, false, "object-description", 'O', no_argument,       NULL, 0, eArgTypeNone,      "Print as an Objective-C object."},<br>
+    { LLDB_OPT_SET_1, false, "ptr-depth",          'P', required_argument, NULL, 0, eArgTypeCount,     "The number of pointers to be traversed when dumping values (default is zero)."},<br>
+    { LLDB_OPT_SET_1, false, "show-types",         'T', no_argument,       NULL, 0, eArgTypeNone,      "Show variable types when dumping values."},<br>
+    { LLDB_OPT_SET_1, false, "no-summary-depth",   'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set the depth at which omitting summary information stops (default is 1)."},<br>
+    { LLDB_OPT_SET_1, false, "raw-output",         'R', no_argument,       NULL, 0, eArgTypeNone,      "Don't use formatting options."},<br>
+    { LLDB_OPT_SET_1, false, "show-all-children",  'A', no_argument,       NULL, 0, eArgTypeNone,      "Ignore the upper bound on the number of children to show."},<br>
     { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }<br>
 };<br>
<br>
<br>
Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)<br>
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Tue Dec 11 21:23:37 2012<br>
@@ -420,9 +420,9 @@<br>
         self.expect('expr -d true -- @"Hello"',<br>
             substrs = ['Hello'])<br>
<br>
-        self.expect('expr -d true -o -- @"Hello"',<br>
+        self.expect('expr -d true --object-description -- @"Hello"',<br>
             substrs = ['Hello'])<br>
-        self.expect('expr -d true -o -- @"Hello"', matching=False,<br>
+        self.expect('expr -d true --object-description -- @"Hello"', matching=False,<br>
             substrs = ['@"Hello" Hello'])<br>
<br>
<br>
<br>
Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py (original)<br>
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py Tue Dec 11 21:23:37 2012<br>
@@ -204,7 +204,7 @@<br>
         #<br>
         # Test new feature with r115115:<br>
         # Add "-o" option to "expression" which prints the object description if available.<br>
-        self.expect("expression -o -- my", "Object description displayed correctly",<br>
+        self.expect("expression --object-description -- my", "Object description displayed correctly",<br>
             patterns = ["Hello from.*a.out.*with timestamp: "])<br>
<br>
     # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets<br>
<br>
Modified: lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=169961&r1=169960&r2=169961&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=169961&r1=169960&r2=169961&view=diff</a><br>

==============================================================================<br>
--- lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)<br>
+++ lldb/trunk/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Tue Dec 11 21:23:37 2012<br>
@@ -64,62 +64,62 @@<br>
<br>
         self.common_setup()<br>
<br>
-        self.expect("expr -o -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["foo"])<br>
<br>
-        self.expect("expr -o -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["foo"])<br>
<br>
-        self.expect("expr -o -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["bar"])<br>
<br>
-        self.expect("expr -o -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["bar"])<br>
<br>
-        self.expect("expr -o -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["value"])<br>
<br>
-        self.expect("expr -o -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["value"])<br>
<br>
-        self.expect("expr -o -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["object"])<br>
<br>
-        self.expect("expr -o -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["object"])<br>
<br>
-        self.expect("expr -o -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSArray", "foo", "bar"])<br>
<br>
-        self.expect("expr -o -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSDictionary", "key", "object"])<br>
<br>
-        self.expect("expr -o -- @'a'", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @'a'", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", str(ord('a'))])<br>
<br>
-        self.expect("expr -o -- @1", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @1", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "1"])<br>
<br>
-        self.expect("expr -o -- @1l", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @1l", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "1"])<br>
<br>
-        self.expect("expr -o -- @1ul", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @1ul", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "1"])<br>
<br>
-        self.expect("expr -o -- @1ll", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @1ll", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "1"])<br>
<br>
-        self.expect("expr -o -- @1ull", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @1ull", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "1"])<br>
<br>
-        self.expect("expr -o -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "123.45"])<br>
-        self.expect("expr -o -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "123.45"])<br>
<br>
-        self.expect("expr -o -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSNumber", "4"])<br>
-        self.expect("expr -o -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,<br>
+        self.expect("expr --object-description -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,<br>
             substrs = ["NSString", "world"])<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a><br>
</blockquote></div><br></div>