<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I'm running into an issue on Linux where hitting a breakpoint won't
change the currently selected thread index to that thread:<br>
Notice in this example how the current thread is #1, even though the
breakpoint hit on thread #2. I only have one breakpoint set, and
thread #2 is the only thread anywhere near that breakpoint.<br>
<blockquote>
<pre>(lldb) b main.c:21
(lldb) run
Process 12353 stopped
thread #2: tid = 12357, 0x000000000040076a a.out`fn_static(param=0x0000000000000000) + 30 at main.c:21, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x000000000040076a a.out`fn_static(param=0x0000000000000000) + 30 at main.c:21
18 {
19 var_static *= 2;
20 for(;;)
-> 21 usleep(1); // thread breakpoint
22 }
23
24 int main (int argc, char const *argv[])
(lldb) thread list
Process 12353 stopped
* thread #1: tid = 12353, 0x00007f0d8e31cd3d libc.so.6`nanosleep + 45, name = 'a.out'
thread #2: tid = 12357, 0x000000000040076a a.out`fn_static(param=0x0000000000000000) + 30 at main.c:21, name = 'a.out', stop reason = breakpoint 1.1
</pre>
</blockquote>
Somewhat annoyingly, this only fails when inside a unit test, and
works fine from the command-line.<br>
Has anyone seen anything like this before?<br>
<pre class="moz-signature" cols="72">--
Richard Mitton
<a class="moz-txt-link-abbreviated" href="mailto:richard@codersnotes.com">richard@codersnotes.com</a></pre>
</body>
</html>