When we interrupt a process, it was possible or the thread names
authorJason Molenda <jmolenda@apple.com>
Thu, 8 Dec 2016 06:27:29 +0000 (06:27 +0000)
committerJason Molenda <jmolenda@apple.com>
Thu, 8 Dec 2016 06:27:29 +0000 (06:27 +0000)
commitb3a3cd1f4ebe11abfd2297c535ab0858e6a4818a
tree6a8f7791d57032d014fb2bdcc881b359645a149a
parent6a4eb75c46dc11578c4dd47db82c7a69a8f65839
When we interrupt a process, it was possible or the thread names
to not be set by Process::WillPublicStop() so the driver won't get
access to them.  The fix is straightforward, moving the call to
WillPublicStop above the early return for the interrupt case.  (the
interrupt case does an early return because the rest of the function
is concerned with running stop hooks etc and those are not applicable
when we've interrupted the process).

Also added a test case for it.  The test case is a little complicated
because I needed to drive lldb asynchronously to give the program
a chance to get up and running before I interrupt it.  Running to
a breakpoint was not sufficient to catch this bug.

<rdar://problem/22693778>

llvm-svn: 289026
lldb/packages/Python/lldbsuite/test/macosx/thread-names/Makefile [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py [new file with mode: 0644]
lldb/packages/Python/lldbsuite/test/macosx/thread-names/main.c [new file with mode: 0644]
lldb/source/Target/Process.cpp