[Lldb-commits] [lldb] r144717 - in /lldb/trunk/test/expression_command/two-files: Makefile TestObjCTypeQueryFromOtherCompileUnit.py main.c main.m

Johnny Chen johnny.chen at apple.com
Tue Nov 15 14:42:53 PST 2011


Author: johnny
Date: Tue Nov 15 16:42:53 2011
New Revision: 144717

URL: http://llvm.org/viewvc/llvm-project?rev=144717&view=rev
Log:
Fix objc runtime warnings from the inferior program.

Added:
    lldb/trunk/test/expression_command/two-files/main.m
      - copied, changed from r144698, lldb/trunk/test/expression_command/two-files/main.c
Removed:
    lldb/trunk/test/expression_command/two-files/main.c
Modified:
    lldb/trunk/test/expression_command/two-files/Makefile
    lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py

Modified: lldb/trunk/test/expression_command/two-files/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/two-files/Makefile?rev=144717&r1=144716&r2=144717&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/two-files/Makefile (original)
+++ lldb/trunk/test/expression_command/two-files/Makefile Tue Nov 15 16:42:53 2011
@@ -1,7 +1,6 @@
 LEVEL = ../../make
 
-C_SOURCES := main.c
-OBJC_SOURCES := foo.m
+OBJC_SOURCES := main.m foo.m
 
 include $(LEVEL)/Makefile.rules
 

Modified: lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py?rev=144717&r1=144716&r2=144717&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py (original)
+++ lldb/trunk/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py Tue Nov 15 16:42:53 2011
@@ -15,8 +15,8 @@
     def setUp(self):
         # Call super's setUp().
         TestBase.setUp(self)
-        # Find the line number to break for main.c.
-        self.line = line_number('main.c',
+        # Find the line number to break for main.m.
+        self.line = line_number('main.m',
                                 "// Set breakpoint here, then do 'expr (NSArray*)array_token'.")
 
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
@@ -34,14 +34,14 @@
         """The expression parser's type search should be wider than the current compilation unit."""
         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
 
-        self.expect("breakpoint set -f main.c -l %d" % self.line,
+        self.expect("breakpoint set -f main.m -l %d" % self.line,
                     BREAKPOINT_CREATED,
-            startstr = "Breakpoint created: 1: file ='main.c', line = %d" %
+            startstr = "Breakpoint created: 1: file ='main.m', line = %d" %
                         self.line)
 
         self.runCmd("run", RUN_SUCCEEDED)
 
-        # Now do a NSArry type query from the 'main.c' compile uint.
+        # Now do a NSArry type query from the 'main.m' compile uint.
         self.expect("expression (NSArray*)array_token",
             substrs = ['(NSArray *) $0 = 0x'])
         # (NSArray *) $0 = 0x00007fff70118398

Removed: lldb/trunk/test/expression_command/two-files/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/two-files/main.c?rev=144716&view=auto
==============================================================================
--- lldb/trunk/test/expression_command/two-files/main.c (original)
+++ lldb/trunk/test/expression_command/two-files/main.c (removed)
@@ -1,19 +0,0 @@
-#include <stdio.h>
-
-extern int AddElement (char *value);
-extern char *GetElement (int idx);
-extern void *GetArray();
-
-int
-main ()
-{
-
-  int idx = AddElement ("some string");
-  void *array_token = GetArray();
-
-  char *string = GetElement (0); // Set breakpoint here, then do 'expr (NSArray*)array_token'.
-  if (string)
-    printf ("This: %s.\n", string);
-
-  return 0;
-}  

Copied: lldb/trunk/test/expression_command/two-files/main.m (from r144698, lldb/trunk/test/expression_command/two-files/main.c)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/two-files/main.m?p2=lldb/trunk/test/expression_command/two-files/main.m&p1=lldb/trunk/test/expression_command/two-files/main.c&r1=144698&r2=144717&rev=144717&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/two-files/main.c (original)
+++ lldb/trunk/test/expression_command/two-files/main.m Tue Nov 15 16:42:53 2011
@@ -1,3 +1,4 @@
+#import <Foundation/Foundation.h>
 #include <stdio.h>
 
 extern int AddElement (char *value);
@@ -7,6 +8,7 @@
 int
 main ()
 {
+  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
   int idx = AddElement ("some string");
   void *array_token = GetArray();
@@ -15,5 +17,6 @@
   if (string)
     printf ("This: %s.\n", string);
 
+  [pool release];
   return 0;
 }  





More information about the lldb-commits mailing list