History log of /external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.cpp
59752d199bb19ffde140b67da147b0afa67f2e88 25-Jun-2013 Jason Molenda <jmolenda@apple.com> Remove some unnecessary uses of nub_break_t in the arm specific
support files for debugserver to fix a build failure for arm. Also
remove some of the code used for software-driven single instruction
stepping; this is slowly being yanked out and these particular bits
overlap with the nub_break_t going away.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.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/MachThread.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/MachThread.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/MachThread.cpp
ca28cc392d40ea539408daf46a2b605f71f4183e 10-Jan-2012 Jim Ingham <jingham@apple.com> Check the return value of GetBasicInfo before dereferencing it. <rdar://problem/10568492>

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
0e8147bd867e4cdaae9400f56d02c7aacd40a9b3 29-Oct-2011 Greg Clayton <gclayton@apple.com> Enabled the "printf" attribute on all debugserver logging functions and fixed
the ensuing mayhem.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.cpp
a1cb0f4caeabf20906c5fce4150dbe04c0ac29ef 15-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add comment regarding method call to DNBArchProtocol::NotifyException().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
ba3d6989f48afd8e3f4c6c70db45206efd64d1eb 15-Sep-2011 Johnny Chen <johnny.chen@apple.com> Modify MachThread::NotifyException() to allow the arch specific protocol to process
the passed in (MachException::Data &)exc first before possible reassignment of the
member m_stop_exception with exc. This allows lldb to stop at the watchpoint of
a simple test program.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
8bc9af185a3022aa739a402a4290b60b78d7a2ed 11-Aug-2011 Jim Ingham <jingham@apple.com> In the case where we are trying to resume a thread all the way to 0, if we get


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
716cefbded5b438eeb8d310d3965dd1be86bcc46 09-Aug-2011 Greg Clayton <gclayton@apple.com> Added some logging and did some member renaming.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.cpp
c0fa53324d62a48257c092a3347d6e7236aa3152 23-May-2011 Greg Clayton <gclayton@apple.com> Added new lldb_private::Process memory read/write functions to stop a bunch
of duplicated code from appearing all over LLDB:

lldb::addr_t
Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error);

bool
Process::WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Error &error);

size_t
Process::ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Error &error);

size_t
Process::WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, uint32_t size, Error &error);

in lldb_private::Process the following functions were renamed:

From:
uint64_t
Process::ReadUnsignedInteger (lldb::addr_t load_addr,
size_t byte_size,
Error &error);

To:
uint64_t
Process::ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr,
size_t byte_size,
uint64_t fail_value,
Error &error);

Cleaned up a lot of code that was manually doing what the above functions do
to use the functions listed above.

Added the ability to get a scalar value as a buffer that can be written down
to a process (byte swapping the Scalar value if needed):

uint32_t
Scalar::GetAsMemoryData (void *dst,
uint32_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const;

The "dst_len" can be smaller that the size of the scalar and the least
significant bytes will be written. "dst_len" can also be larger and the
most significant bytes will be padded with zeroes.

Centralized the code that adds or removes address bits for callable and opcode
addresses into lldb_private::Target:

lldb::addr_t
Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;

lldb::addr_t
Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;

All necessary lldb_private::Address functions now use the target versions so
changes should only need to happen in one place if anything needs updating.

Fixed up a lot of places that were calling :

addr_t
Address::GetLoadAddress(Target*);

to call the Address::GetCallableLoadAddress() or Address::GetOpcodeLoadAddress()
as needed. There were many places in the breakpoint code where things could
go wrong for ARM if these weren't used.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
e1f50b9df1299f6b9181b5ac2699ed4a3ad38a59 04-May-2011 Greg Clayton <gclayton@apple.com> Added new OptionGroup classes for UInt64, UUID, File and Boolean values.

Removed the "image" command and moved it to "target modules". Added an alias
for "image" to "target modules".

Added some new target commands to be able to add and load modules to a target:
(lldb) target modules add <path>
(lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...]

So you can load individual sections without running a target:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000

Or you can rigidly slide an entire shared library:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000

This should improve bare board debugging when symbol files need to be slid around manually.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
679c77b1a1956ddff405fdb6e3c40035f0cc20a7 28-Jan-2011 Jim Ingham <jingham@apple.com> The thread_info changes over the life of the thread, so you can't get it once and cache it, you have to fetch it every time you want to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124463 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
cc3e640a1fdfb36a6a67eb04913ba18ac4ea8e3f 25-Jan-2011 Greg Clayton <gclayton@apple.com> Reverting recent thread resume changes as it was causing testing issues.
We will need to try again soon, but this change was causing instability.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
c72af6b67914810cafc34a83c403235de58d2051 25-Jan-2011 Jim Ingham <jingham@apple.com> When we are stepping a thread, force it to resume ALL the way to 0. And of course, when we stop
if we undid some user provided suspends, we need to re-do the suspends.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.cpp
c71899ef308e6134d1b0ca5f30cbc64414855e1a 18-Jan-2011 Greg Clayton <gclayton@apple.com> Thread safety changes in debugserver and also in the process GDB remote plugin.
I added support for asking if the GDB remote server supports thread suffixes
for packets that should be thread specific (register read/write packets) because
the way the GDB remote protocol does it right now is to have a notion of a
current thread for register and memory reads/writes (set via the "$Hg%x" packet)
and a current thread for running ("$Hc%x"). Now we ask the remote GDB server
if it supports adding the thread ID to the register packets and we enable
that feature in LLDB if supported. This stops us from having to send a bunch
of packets that update the current thread ID to some value which is prone to
error, or extra packets.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123762 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
3355d11a95ddf94daf980db031683337bfc96d3f 08-Dec-2010 Greg Clayton <gclayton@apple.com> Bumped lldb Xcode version to 35 for lldb-35, and debugserver to 121 for
debugserver-121.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.cpp
3e783a9d14726f9f3c4308c65b7aa74ed86edd0f 12-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed more thread suspend/resume issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118877 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/tools/debugserver/source/MacOSX/MachThread.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/MachThread.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/MachThread.cpp