diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2010-11-11 20:18:36 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2010-11-11 20:18:36 +0000 |
| commit | c043de11e8d8e8a9925d96d6294e3b9b19dbf030 (patch) | |
| tree | 8c10b3cd724659c50050f9462a4090d9b7c2b008 | |
| parent | ba321cb1206221bfa570fbd59c05a692e1cd6d63 (diff) | |
| download | bcm5719-llvm-c043de11e8d8e8a9925d96d6294e3b9b19dbf030.tar.gz bcm5719-llvm-c043de11e8d8e8a9925d96d6294e3b9b19dbf030.zip | |
Fixed compilation warnings emitted by clang.
Plus make finding the break line number in main.cpp more robust.
llvm-svn: 118832
| -rw-r--r-- | lldb/test/threads/TestPrintStackTraces.py | 8 | ||||
| -rw-r--r-- | lldb/test/threads/main.cpp | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lldb/test/threads/TestPrintStackTraces.py b/lldb/test/threads/TestPrintStackTraces.py index 7e985aae650..1d028249287 100644 --- a/lldb/test/threads/TestPrintStackTraces.py +++ b/lldb/test/threads/TestPrintStackTraces.py @@ -12,6 +12,12 @@ class ThreadsStackTracesTestCase(TestBase): 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 @@ class ThreadsStackTracesTestCase(TestBase): 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. diff --git a/lldb/test/threads/main.cpp b/lldb/test/threads/main.cpp index f0af0d110b9..ae0ccfe2506 100644 --- a/lldb/test/threads/main.cpp +++ b/lldb/test/threads/main.cpp @@ -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 @@ thread_func (void *arg) 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; } |

