Fixed compilation warnings emitted by clang.

Plus make finding the break line number in main.cpp more robust.

llvm-svn: 118832
This commit is contained in:
Johnny Chen 2010-11-11 20:18:36 +00:00
parent ba321cb120
commit c043de11e8
2 changed files with 9 additions and 5 deletions

View File

@ -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.

View File

@ -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;
}