[Lldb-commits] [lldb] r118832 - in /lldb/trunk/test/threads: TestPrintStackTraces.py main.cpp
Johnny Chen
johnny.chen at apple.com
Thu Nov 11 12:18:36 PST 2010
Author: johnny
Date: Thu Nov 11 14:18:36 2010
New Revision: 118832
URL: http://llvm.org/viewvc/llvm-project?rev=118832&view=rev
Log:
Fixed compilation warnings emitted by clang.
Plus make finding the break line number in main.cpp more robust.
Modified:
lldb/trunk/test/threads/TestPrintStackTraces.py
lldb/trunk/test/threads/main.cpp
Modified: lldb/trunk/test/threads/TestPrintStackTraces.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/threads/TestPrintStackTraces.py?rev=118832&r1=118831&r2=118832&view=diff
==============================================================================
--- lldb/trunk/test/threads/TestPrintStackTraces.py (original)
+++ lldb/trunk/test/threads/TestPrintStackTraces.py Thu Nov 11 14:18:36 2010
@@ -12,6 +12,12 @@
mydir = "threads"
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break inside main().
+ self.line = line_number('main.cpp', '// Set break point at this line.')
+
def test_stack_traces(self):
"""Test SBprocess and SBThread APIs with printing of the stack traces."""
self.buildDefault()
@@ -24,7 +30,7 @@
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid(), VALID_TARGET)
- breakpoint = target.BreakpointCreateByLocation("main.cpp", 68)
+ breakpoint = target.BreakpointCreateByLocation("main.cpp", self.line)
self.assertTrue(breakpoint.IsValid(), VALID_BREAKPOINT)
# Now launch the process, and do not stop at entry point.
Modified: lldb/trunk/test/threads/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/threads/main.cpp?rev=118832&r1=118831&r2=118832&view=diff
==============================================================================
--- lldb/trunk/test/threads/main.cpp (original)
+++ lldb/trunk/test/threads/main.cpp Thu Nov 11 14:18:36 2010
@@ -14,8 +14,6 @@
#include <stdlib.h>
#include <unistd.h>
-using namespace std;
-
pthread_t g_thread_1 = NULL;
pthread_t g_thread_2 = NULL;
pthread_t g_thread_3 = NULL;
@@ -65,10 +63,10 @@
long usec = ::random() % 3000000;
printf ("%s (thread = %u) doing a usleep (%li)...\n", __FUNCTION__, thread_index, usec);
::usleep (usec);
- printf ("%s (thread = %u) after usleep ...\n", __FUNCTION__, thread_index);
+ printf ("%s (thread = %u) after usleep ...\n", __FUNCTION__, thread_index); // Set break point at this line.
}
printf ("%s (thread index = %u) exiting...\n", __FUNCTION__, thread_index);
-
+ return NULL;
}
More information about the lldb-commits
mailing list