[Lldb-commits] [lldb] r133488 - in /lldb/trunk/test/types: AbstractBase.py basic_type.cpp

Johnny Chen johnny.chen at apple.com
Mon Jun 20 17:13:15 PDT 2011


Author: johnny
Date: Mon Jun 20 19:13:15 2011
New Revision: 133488

URL: http://llvm.org/viewvc/llvm-project?rev=133488&view=rev
Log:
Simplify the the generic AbstractBase.py test base for testing variable types.
We still have the the issue where running:

    ./dotest.py -v types

we have test failures where the inferior either runs to exited with status 0 or
the inferior stops but not because of breakpoint (for example):

runCmd: process status
output: Process 90060 stopped
* thread #1: tid = 0x2d03, 0x000000010000e2ca, stop reason = EXC_BAD_ACCESS (code=2, address=0x10000e2ca)
  frame #0: 0x000000010000e2ca

There are two cases where the inferior stops for the breakpoint (good), but the expression parser
prints out the wrong information.  The two failures are:

Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dsym.log
Failure-TestFloatTypesExpr.FloatTypesExprTestCase.test_double_type_with_dwarf.log

I'll file a radar on the two expression parser misbehave, while continue investigating why the
inferior stops for the wrong reason or does not stop at all.

For now, you'll need to do:

    ./dotest.py -v -w types

Modified:
    lldb/trunk/test/types/AbstractBase.py
    lldb/trunk/test/types/basic_type.cpp

Modified: lldb/trunk/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/AbstractBase.py?rev=133488&r1=133487&r2=133488&view=diff
==============================================================================
--- lldb/trunk/test/types/AbstractBase.py (original)
+++ lldb/trunk/test/types/AbstractBase.py Mon Jun 20 19:13:15 2011
@@ -44,14 +44,16 @@
         # Bring the program to the point where we can issue a series of
         # 'frame variable -T' command.
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-        puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out")
+        puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables")
         self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line,
                     BREAKPOINT_CREATED,
             startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" %
                         puts_line)
 
-        self.expect("run", RUN_SUCCEEDED, patterns = [".*"])
-        self.runCmd("thread step-out", STEP_OUT_SUCCEEDED)
+        self.runCmd("run", RUN_SUCCEEDED)
+        self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
+            substrs = [" at basic_type.cpp:%d" % puts_line,
+                       "stop reason = breakpoint"])
 
         #self.runCmd("frame variable -T")
 
@@ -109,17 +111,15 @@
         # Bring the program to the point where we can issue a series of
         # 'expr' command.
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-        #self.runCmd("breakpoint set --name Puts")
-        #self.runCmd("run", RUN_SUCCEEDED)
-        puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on before stepping out")
+        puts_line = line_number ("basic_type.cpp", "// Here is the line we will break on to check variables.")
         self.expect("breakpoint set -f basic_type.cpp -l %d" % puts_line,
                     BREAKPOINT_CREATED,
             startstr = "Breakpoint created: 1: file ='basic_type.cpp', line = %d, locations = 1" %
                         puts_line)
-        self.expect("run", RUN_SUCCEEDED, patterns = [".*"])
-        self.runCmd ("process status")
-
-        self.runCmd("thread step-out", STEP_OUT_SUCCEEDED)
+        self.runCmd("run", RUN_SUCCEEDED)
+        self.expect("process status", STOPPED_DUE_TO_BREAKPOINT,
+            substrs = [" at basic_type.cpp:%d" % puts_line,
+                       "stop reason = breakpoint"])
 
         #self.runCmd("frame variable -T")
 

Modified: lldb/trunk/test/types/basic_type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/types/basic_type.cpp?rev=133488&r1=133487&r2=133488&view=diff
==============================================================================
--- lldb/trunk/test/types/basic_type.cpp (original)
+++ lldb/trunk/test/types/basic_type.cpp Mon Jun 20 19:13:15 2011
@@ -82,11 +82,6 @@
 #include <stdint.h>
 #include <stdio.h>
 
-void Puts(char const *msg)
-{
-    puts(msg);  // Here is the line we will break on before stepping out
-}
-
 int 
 main (int argc, char const *argv[])
 {
@@ -173,6 +168,6 @@
     printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
 
 #endif
-    Puts("About to exit, break here to check values...");
+    puts("About to exit, break here to check values..."); // Here is the line we will break on to check variables.
     return 0;
 }





More information about the lldb-commits mailing list