History log of /external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4e49a5bfccc0a51185eadf69b3e23f68e70f1676 12-Jul-2013 Jim Ingham <jingham@apple.com> Get debugserver to call task_set_state to prime the control registers so that watchpoints
take for threads created while the program is running. Remove the testcase skips from TestConcurrentEvents.py,
since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem -
so it doesn't artificially break on new thread creation before the watchpoint triggers.

llvm.org/pr16566
<rdar://problem/14383244>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
ac94caa68a4a5fa4bd939d7656a6a12d8fc06a33 12-Jun-2013 Greg Clayton <gclayton@apple.com> Huge performance improvements when one breakpoint contains many locations.

325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.

That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.

Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@183820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
549ce88d2f36e4c0abd942c234761636cc5d5008 27-Feb-2013 Jason Molenda <jmolenda@apple.com> Fix one remaining mach port number/globally unique thread ID mixup which prevented queue names
from being fetched correctly. <rdar://problem/13290877>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
44eb9fb021023027159df55f91c3e95384088970 22-Feb-2013 Jason Molenda <jmolenda@apple.com> Change debugserver from using the mach port number (in debugserver's
own port namepsace) as the thread identifier to using the system-wide
globally unique thread id as the thread identifier number.

MachThread.cpp keeps both the unique id and the mach port number
for each thread. All layers outside MachThread class use the unique
id with three exceptions: (1) Mach exceptions come in with the port
number (thread_port) which needs to be translated, (2) any calls to
low-level thread_get_state/thread_set_state/thread_suspend etc need
to use the mach port number, (3) MachThreadList::UpdateThreadList
which creates the MachThread objects gets the unique id and passes
it to the MachThread ctor as an argument.

In general, any time nub_thread_t is used, it is now referring to a
unique thread id. Any time a thread_t is used, it is now referring
to a mach port number. There was some interchangability of these
types previously. nub_thread_t has also been changed to a 64-bit
type which necessitated some printf specification string changes.

I haven't been able to test these changes extensively yet but want
to checkpoint the work. The scenarios I've been testing are all
working correctly so while there may be some corner cases I haven't
hit yet, I think it is substantially correct.

<rdar://problem/12931414>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
4a379b1194f3e6b308cd6e80b45d6ca5dd0aafd7 17-Jul-2012 Greg Clayton <gclayton@apple.com> Ran the static analyzer on the codebase and found a few things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
5693e875ac7ac8d6ce1614da40e0b56f3f58716c 02-Jun-2012 Johnny Chen <johnny.chen@apple.com> rdar://problem/11320188

Designate MachThreadList as a transaction coordinator when doing Enable/DisableHardwareWatchpoint on the list of threads.
In case the operation (iterating on the threads and doing enable/disable) fails in the middle, we rollback the already
enabled/disabled threads to their checkpointed states. When all the threads succeed in enable/disable, we ask each thread
to finsih the transaction and commit the change of the debug state.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
7cbdcfb0cefcfd877b507ff2d83e51a1bde3fcc7 23-May-2012 Johnny Chen <johnny.chen@apple.com> Add the capability to display the number of supported hardware watchpoints to the "watchpoint list" command.

Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported".
Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
137e5230e8dfb1287dd7c5eaa943a39078e1fd8d 21-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove a ton of implicit narrowing conversions for C++11 compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
3dd956eb7ee3e93df6b68a9c7c528e92359b6026 29-Sep-2011 Johnny Chen <johnny.chen@apple.com> Modify the delegation chain from MachThreadList -> MachThread -> DNBArchProtocol so that when
the watchpoint state is changed, not only does the change propagate to all the thread instances,
it also updates a global debug state, if chosen by the DNBArchProtocol derivative.

Once implemented, the DNBArchProtocol derivative, also makes sure that when new thread comes along,
it tries to inherit from the global debug state, if it is valid.

Modify TestWatchpointMultipleThreads.py to test this functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
48c7756be4ae81d9e524ba23ef89a401bdf9fa31 29-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix a bug in the current MacOSX MachThreadList::EnableHardwareWatchpoint() impl so that
it enables the hardware watchpoint for all existing threads. Add a test file for that.
Also fix MachThreadList::DisableHardwareWatchpoint().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
2c45f5425f35af30efb4f2751890decf292e8eaf 07-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add logic to MachThreadList::GetThreadID() for the use case of setting a watchpoint
(MachThreadList::EnableHardwareWatchpoint()) where the watchpoint is not associated
with a thread and the current thread, if set, is returned, otherwise we return the
first thread.

Plus minor change to RNBRemote::HandlePacket_z() to use the existing macros to check
the validity of break_id/watch_id.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
aa43001dd4d178ca7132801c5af1b878afd970f1 21-Jul-2011 Jim Ingham <jingham@apple.com> If we are telling only one thread to run in debugserver, and that thread has been suspended from outside
the debugger, resume it before running so we will actually make progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
f9f40c20b210eea72ab042c63178ca000f005ed9 08-Feb-2011 Jim Ingham <jingham@apple.com> Rework the RunThreadPlan event handling to use Event Hijacking not stopping the event thread. Also clarify the logic of the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
d330bfd8c5fff8cf2f883f55fa3d2de4a305c48f 24-Jan-2011 Greg Clayton <gclayton@apple.com> One more thing... Resume any threads that we discover were created while we stop as
they may be in sensitive areas and we set breakpoints on the thread creation routines
if we are running expressions, so the threads should quickly get to a safe spot.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
2971e7fc7ede526af9b193f8a9eb10ec4cb2bd62 24-Jan-2011 Greg Clayton <gclayton@apple.com> Discover new threads right before we continue a process since libdispatch has
been known to make threads for us while our process/task is suspended.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
9ace183f4dc5e6b6dae85ed0c197449c495007a2 24-Jan-2011 Greg Clayton <gclayton@apple.com> Added logging for threads that are spawned while we stop. We log their
existence if the "thread" log bit is enabled right before we resume.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
61468e816e879874ee8499ce5a1b4f1d6759b026 19-Jan-2011 Greg Clayton <gclayton@apple.com> Took the timeout for a ClangUserExpression down from a 10 second timeout to
500 ms.

Make MachThreadList more threadsafe.

Added code to make sure the thread register state was properly flushed for x86_64.

Fixed an missing return code for the current thread in the new thread suffix code.

Improved debugserver logging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
97bd5670cdb415a95c84050c20cfacce8ed178e7 01-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed 32 bit debugging after recent architecture changes to debugserver.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
20d338fad87eba91de65aa9bec76e01c04472848 18-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed Process::Halt() as it was broken for "process halt" after recent changes
to the DoHalt down in ProcessGDBRemote. I also moved the functionality that
was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has
to implement a tricky halt/resume on the internal state thread. The
functionality is the same as it was before with two changes:
- when we eat the event we now just reuse the event we consume when the private
state thread is paused and set the interrupted bool on the event if needed
- we also properly update the Process::m_public_state with the state of the
event we consume.

Prior to this, if you issued a "process halt" it would eat the event, not
update the process state, and then produce a new event with the interrupted
bit set and send it. Anyone listening to the event would get the stopped event
with a process that whose state was set to "running".

Fixed debugserver to not have to be spawned with the architecture of the
inferior process. This worked fine for launching processes, but when attaching
to processes by name or pid without a file in lldb, it would fail.

Now debugserver can support multiple architectures for a native debug session
on the current host. This currently means i386 and x86_64 are supported in
the same binary and a x86_64 debugserver can attach to a i386 executable.
This change involved a lot of changes to make sure we dynamically detect the
correct registers for the inferior process.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
02274ed47ccff35a64870331f6e2c88c711ca0f9 12-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed an issue with the MachThread class where we might not get the initial
thread basic info state and not realize that a thread was already suspended
or if a thread was starting up and not ready to be displayed to the user
(in an uninterruptable state). If it is not user ready yet, we don't add it
to our list of threads that can be played with.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
3b2c41c9d12bafdad87cc271fadd1f816081b9a8 18-Oct-2010 Greg Clayton <gclayton@apple.com> Still trying to get detach to work with debugserver. Got a bit closer,
but something is still killing our inferior.

Fixed an issue with darwin-debug where it wasn't passing all needed arguments
to the inferior.

Fixed a race condition with the attach to named process code.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp