[Lldb-commits] [lldb] r156337 - in /lldb/trunk: include/lldb/lldb-defines.h source/Commands/CommandObjectBreakpoint.cpp test/help/TestHelp.py

Johnny Chen johnny.chen at apple.com
Mon May 7 16:04:49 PDT 2012


Author: johnny
Date: Mon May  7 18:04:49 2012
New Revision: 156337

URL: http://llvm.org/viewvc/llvm-project?rev=156337&view=rev
Log:
Fix the problem that 'help breakpoint set' is printing a lot of redundant lines.
Correctly specify the LLDB_OPT_SET's that the 'shlib' command option belongs to by using a newly added macro like this:

    #define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM(1, 10) & ~LLDB_OPT_SET_10 )

rdar://problem/11393864

Modified:
    lldb/trunk/include/lldb/lldb-defines.h
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/test/help/TestHelp.py

Modified: lldb/trunk/include/lldb/lldb-defines.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-defines.h?rev=156337&r1=156336&r2=156337&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-defines.h (original)
+++ lldb/trunk/include/lldb/lldb-defines.h Mon May  7 18:04:49 2012
@@ -103,6 +103,7 @@
 #define LLDB_OPT_SET_8                  (1U << 7)
 #define LLDB_OPT_SET_9                  (1U << 8)
 #define LLDB_OPT_SET_10                 (1U << 9)
+#define LLDB_OPT_SET_FROM(A, B)         (((1U << (B)) - 1) ^ (1U << ((A)-1) - 1))
 
 #if defined(__cplusplus)
 

Modified: lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp?rev=156337&r1=156336&r2=156337&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp Mon May  7 18:04:49 2012
@@ -74,8 +74,8 @@
 {
 }
 
-#define LLDB_OPT_FILE ( LLDB_OPT_SET_1 | LLDB_OPT_SET_3 | LLDB_OPT_SET_4 | LLDB_OPT_SET_5 | LLDB_OPT_SET_6 | LLDB_OPT_SET_7 | LLDB_OPT_SET_8 | LLDB_OPT_SET_9 )
-#define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_ALL & ~LLDB_OPT_SET_10 )
+#define LLDB_OPT_FILE ( LLDB_OPT_SET_FROM(1, 9) & ~LLDB_OPT_SET_2 )
+#define LLDB_OPT_NOT_10 ( LLDB_OPT_SET_FROM(1, 10) & ~LLDB_OPT_SET_10 )
 
 OptionDefinition
 CommandObjectBreakpointSet::CommandOptions::g_option_table[] =

Modified: lldb/trunk/test/help/TestHelp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/help/TestHelp.py?rev=156337&r1=156336&r2=156337&view=diff
==============================================================================
--- lldb/trunk/test/help/TestHelp.py (original)
+++ lldb/trunk/test/help/TestHelp.py Mon May  7 18:04:49 2012
@@ -86,6 +86,12 @@
         self.expect("help",
             startstr = 'The following is a list of built-in, permanent debugger commands')
 
+    def test_help_breakpoint_set(self):
+        """Test that 'help breakpoint set' does not print out redundant lines of:
+        'breakpoint set [-s <shlib-name>] ...'."""
+        self.expect("help breakpoint set", matching=False,
+            substrs = ['breakpoint set [-s <shlib-name>]'])
+
     def test_help_image_dump_symtab_should_not_crash(self):
         """Command 'help image dump symtab' should not crash lldb."""
         # 'image' is an alias for 'target modules'.





More information about the lldb-commits mailing list