History log of /external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
97abb6ddae805a91ccf28a3a91fa68252dcf1fe2 16-Jul-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13793059>

Added a setting to control timeout for kdp response packets. While I was at it, I also added a way to control the response timeout for gdb-remote packets.

KDP defaults to 5 seconds, and GDB defaults to 1 second. These were the default values that were in the code prior to adding these settings.

(lldb) settings set plugin.process.gdb-remote.packet-timeout 10
(lldb) settings set plugin.process.kdp-remote.packet-timeout 10



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186360 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
f0c0882ff3fd98456c1814b495888092da2f13f6 11-May-2013 Jason Molenda <jmolenda@apple.com> Update ProcessKDP and ProcessMachCore to use ConstString plugin
names when specifying the DynamicLoaderDarwinKernel.

ProcessGDBRemote wasn't setting the dyld string any more; remove
the remaining code tracking the dyld plugin name altogether from
that process plugin.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
0e191607adcb0ea8ebd06c278be648a7f5c0097f 10-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13854277>
<rdar://problem/13594769>

Main changes in this patch include:
- cleanup plug-in interface and use ConstStrings for plug-in names
- Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp
- Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging

The plug-in interface changes:

Modified the lldb_private::PluginInterface class that all plug-ins inherit from:

Changed:

virtual const char * GetPluginName() = 0;

To:

virtual ConstString GetPluginName() = 0;

Removed:

virtual const char * GetShortPluginName() = 0;

- Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names.
- Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc.






git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
4e75e3533bddc7cf7264c6c7f7b4d812d4466e96 07-May-2013 Andrew Kaylor <andrew.kaylor@intel.com> Reinstating r181091 and r181106 with fix for Linux regressions.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
95bea1dfb166a1816ee36a3453aa3ebeca248844 07-May-2013 Ashok Thirumurthi <ashok.thirumurthi@intel.com> Temporarily reverting r181091 and r181106 due to the vast test breakage on the Linux buildbots
while we develop a better understanding of how to manage the thread lists in a platform-independant fashion.

Reviewed by: Daniel Malea


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
7bee8abf1678cb4dade06add9036981f7249ba09 04-May-2013 Greg Clayton <gclayton@apple.com> After recent OperatingsSystem plug-in changes, the lldb_private::Process and lldb_private::Thread subclasses were changed and the API was not respected properly.

This checkin aims to fix this. The process now has two thread lists: a real thread list for threads that are created by the lldb_private::Process subclass, and the user visible threads. The user visible threads are the same as the real threas when no OS plug-in in used. But when an OS plug-in is used, the user thread can be a combination of real and "memory" threads. Real threads can be placed inside of memory threads so that a thread appears to be different, but is still controlled by the actual real thread. When the thread list needs updating, the lldb_private::Process class will call the: lldb_private::Process::UpdateThreadList() function with the old real thread list, and the function is expected to fill in the new real thread list with the current state of the process. After this function, the process will check if there is an OS plug-in being used, and if so, it will give the old user thread list, the new real thread list and the OS plug-in will create the new user thread list from both of these lists. If there is no OS plug-in, the real thread list is the user thread list.

These changes keep the lldb_private::Process subclasses clean and no changes are required.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
761afb822b18c46b2ad84be03f372e90ac1e6143 02-May-2013 Jim Ingham <jingham@apple.com> Recommitting r180831 with trivial fix - remember to return errors if you compute.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
411ab47806a478d932926ef7a309ea37edf1f7e7 01-May-2013 Daniel Malea <daniel.malea@intel.com> Reverting 180831 as it crashes TestDefaultConstructorForAPIObjects.py



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
b4e08abf4972befc8412bc83a0205fbdc547290e 01-May-2013 Jim Ingham <jingham@apple.com> Added an option to "process detach" to keep the process stopped, if the process plugin (or in the
case of ProcessGDBRemote the stub we are talking to) know how to do that.

rdar://problem/13680832


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
eb17530206e3f501476a32c5d28c8dc36bac419a 01-Mar-2013 Jim Ingham <jingham@apple.com> Move m_destroy_in_process to Process (from ProcessKDP) since it is generally useful,
and use it to keep from doing the OS Plugin UpdateThreadList while destroying, since
if that does anything that requires the API lock it may deadlock against whoever is
running the Process::Destroy.

<rdar://problem/13308627>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
efb4aeba2bd8411ac0aee9934f08959094d50711 15-Feb-2013 Jim Ingham <jingham@apple.com> A little cleanup. {Disable/Enable}Breakpoint actually disables/enables BreakpointSites not breakpoints, it is confusing
to have it not named appropriately. Also in StopInfoMachException, we aren't testing for software or not software, just
whether the thing is a breakpoint we set. So don't use "software"...


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
9c970a371511a0e31ba9360aa841d445792c1ab0 18-Dec-2012 Jim Ingham <jingham@apple.com> Adding events when watchpoints are set or changed.

<rdar://problem/11597849>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
307c7fdc58d19f734991a176db972cc61d9ada16 20-Oct-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12491387>

Added commands to the KDP plug-in that allow sending raw commands through the KDP protocol. You specify a command byte and a payload as ASCII hex bytes, and the packet is created with a valid header/sequenceID/length and sent. The command responds with a raw ASCII hex string that contains all bytes in the reply including the header.

An example of sending a read register packet for the GPR on x86_64:

(lldb) process plugin packet send --command 0x07 --payload 0100000004000000



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@166346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
b46937c86ca4551b2fc9813d848b1a0a2bf2e636 03-Oct-2012 Jason Molenda <jmolenda@apple.com> The kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
remove the duplicates of this code in ProcessGDBRemote and ProcessKDP.
These two Process plugins will hardcode their DynamicLoader name to be
the DynamicLoaderDarwinKernel so the correct DynamicLoader is picked,
and return the kernel load address as the ImageInfosAddress.
<rdar://problem/12417038>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
fac2e62f08719ba800a440b7ad0d5a55a26dc620 29-Sep-2012 Jason Molenda <jmolenda@apple.com> Add support for debugging KASLR kernels via kdp (the kernel being
loaded at a random offset).

To get the kernel's UUID and load address I need to send a kdp
packet so I had to implement the kernel relocation (and attempt to
find the kernel if none was provided to lldb already) in ProcessKDP
-- but this code really properly belongs in DynamicLoaderDarwinKernel.

I also had to add an optional Stream to ConnectRemote so
ProcessKDP::DoConnectRemote can print feedback about the remote kernel's
UUID, load address, and notify the user if we auto-loaded the kernel via
the UUID.

<rdar://problem/7714201>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
3acaa926c8f0d32da48db61a5fcb95276e6a4006 25-Sep-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/9959501>

More KDP debugging process. We can not set breakpoints, hit them, resume, step and detach while running.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
e76f8c408632e2479cbaa1abdcd10a7958fa4846 21-Sep-2012 Greg Clayton <gclayton@apple.com> Full KDP process control with per CPU resume and step.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164378 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
ae932359b80098532f3c3766fa9e6527352fbb67 10-Apr-2012 Greg Clayton <gclayton@apple.com> Trying to solve our disappearing thread issues by making thread list updates safer.

The current ProcessGDBRemote function that updates the threads could end up with an empty list if any other thread had the sequence mutex. We now don't clear the thread list when we can't access it, and we also have changed how lldb_private::Process handles the return code from the:

virtual bool
Process::UpdateThreadList (lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &new_thread_list) = 0;

A bool is now returned to indicate if the list was actually updated or not and the lldb_private::Process class will only update the stop ID of the validity of the thread list if "true" is returned.

The ProcessGDBRemote also got an extra assertion that will hopefully assert when running debug builds so we can find the source of this issue.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
d1040dd360c07305a30d33b5d4501cb9dfb03114 25-Feb-2012 Han Ming Ong <hanming@apple.com> <rdar://problem/3535148>

Added ability to debug root processes on OS X. This uses XPC service that is available on Lion and above only.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
46c9a355af9b39db78c006b2a5cbf97d3c58d947 09-Feb-2012 Greg Clayton <gclayton@apple.com> First pass at mach-o core file support is in. It currently works for x86_64
user space programs. The core file support is implemented by making a process
plug-in that will dress up the threads and stack frames by using the core file
memory.

Added many default implementations for the lldb_private::Process functions so
that plug-ins like the ProcessMachCore don't need to override many many
functions only to have to return an error.

Added new virtual functions to the ObjectFile class for extracting the frozen
thread states that might be stored in object files. The default implementations
return no thread information, but any platforms that support core files that
contain frozen thread states (like mach-o) can make a module using the core
file and then extract the information. The object files can enumerate the
threads and also provide the register state for each thread. Since each object
file knows how the thread registers are stored, they are responsible for
creating a suitable register context that can be used by the core file threads.

Changed the process CreateInstace callbacks to return a shared pointer and
to also take an "const FileSpec *core_file" parameter to allow for core file
support. This will also allow for lldb_private::Process subclasses to be made
that could load crash logs. This should be possible on darwin where the crash
logs contain all of the stack frames for all of the threads, yet the crash
logs only contain the registers for the crashed thrad. It should also allow
some variables to be viewed for the thread that crashed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
36bc5ea5a48c19421d44f559e2165c105657b809 03-Nov-2011 Greg Clayton <gclayton@apple.com> Modified all Process::Launch() calls to use a ProcessLaunchInfo structure
on internal only (public API hasn't changed) to simplify the paramter list
to the launch calls down into just one argument. Also all of the argument,
envronment and stdio things are now handled in a much more centralized fashion.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143656 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
ecd4feb5111432d2878e95461220c720cb2d24c8 14-Oct-2011 Johnny Chen <johnny.chen@apple.com> SBValue::Watch() and SBValue::WatchPointee() are now the official API for creating
a watchpoint for either the variable encapsulated by SBValue (Watch) or the pointee
encapsulated by SBValue (WatchPointee).

Removed SBFrame::WatchValue() and SBFrame::WatchLocation() API as a result of that.

Modified the watchpoint related test suite to reflect the change.

Plus replacing WatchpointLocation with Watchpoint throughout the code base.

There are still cleanups to be dome. This patch passes the whole test suite.
Check it in so that we aggressively catch regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@141925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
37f962e785be99dc4f0c5e9d02416992ff03bbd0 22-Aug-2011 Greg Clayton <gclayton@apple.com> Added a new plug-in type: lldb_private::OperatingSystem. The operating system
plug-ins are add on plug-ins for the lldb_private::Process class that can add
thread contexts that are read from memory. It is common in kernels to have
a lot of threads that are not currently executing on any cores (JTAG debugging
also follows this sort of thing) and are context switched out whose state is
stored in memory data structures. Clients can now subclass the OperatingSystem
plug-ins and then make sure their Create functions correcltly only enable
themselves when the right binary/target triple are being debugged. The
operating system plug-ins get a chance to attach themselves to processes just
after launching or attaching and are given a lldb_private::Process object
pointer which can be inspected to see if the main executable, target triple,
or any shared libraries match a case where the OS plug-in should be used.
Currently the OS plug-ins can create new threads, define the register contexts
for these threads (which can all be different if desired), and populate and
manage the thread info (stop reason, registers in the register context) as
the debug session goes on.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
234981a4559db084f9c90612660e40f19915b89c 20-Jul-2011 Greg Clayton <gclayton@apple.com> Added KDP resume, suspend, set/remove breakpoint, and kernel version support.
Also we now display a live update of the kexts that we are loading.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
0fa512447e00da09d300fbabd18b5ce94f52fdaa 19-Jul-2011 Greg Clayton <gclayton@apple.com> Modified the LocateMacOSXFilesUsingDebugSymbols(...) function to locate
an executable file if it is right next to a dSYM file that is found using
DebugSymbols. The code also looks into a bundle if the dSYM file is right
next to a bundle.

Modified the MacOSX kernel dynamic loader plug-in to correctly set the load
address for kext sections. This is a tad tricky because of how LLDB chooses
to treat mach-o segments with no name. Also modified the loader to properly
handle the older version 1 kext summary info.

Fixed a crasher in the Mach-o object file parser when it is trying to set
the section size correctly for dSYM sections.

Added packet dumpers to the CommunicationKDP class. We now also properly
detect address byte sizes based on the cpu type and subtype that is provided.
Added a read memory and read register support to CommunicationKDP. Added a
ThreadKDP class that now uses subclasses of the RegisterContextDarwin_XXX for
arm, i386 and x86_64.

Fixed some register numbering issues in the RegisterContextDarwin_arm class
and added ARM GDB numbers to the ARM_GCC_Registers.h file.

Change the RegisterContextMach_XXX classes over to subclassing their
RegisterContextDarwin_XXX counterparts so we can share the mach register
contexts between the user and kernel plug-ins.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
8d2ea2888a4acb7f140f9af64ddd2b16b2dee870 17-Jul-2011 Greg Clayton <gclayton@apple.com> Added a boolean to the pure virtual lldb_private::Process::CanDebug(...)
method so process plug-ins that are requested by name can answer yes when
asked if they can debug a target that might not have any file in the target.

Modified the ConnectionFileDescriptor to have both a read and a write file
descriptor. This allows us to support UDP, and eventually will allow us to
support pipes. The ConnectionFileDescriptor class also has a file descriptor
type for each of the read and write file decriptors so we can use the correct
read/recv/recvfrom call when reading, or write/send/sendto for writing.

Finished up an initial implementation of UDP where you can use the "udp://"
URL to specify a host and port to connect to:

(lldb) process connect --plugin kdp-remote udp://host:41139

This will cause a ConnectionFileDescriptor to be created that can send UDP
packets to "host:41139", and it will also bind to a localhost port that can
be given out to receive the connectionless UDP reply.

Added the ability to get to the IPv4/IPv6 socket port number from a
ConnectionFileDescriptor instance if either file descriptor is a socket.

The ProcessKDP can now successfully connect to a remote kernel and detach
using the above "processs connect" command!!! So far we have the following
packets working:
KDP_CONNECT
KDP_DISCONNECT
KDP_HOSTINFO
KDP_VERSION
KDP_REATTACH

Now that the packets are working, adding new packets will go very quickly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
269f91e066c5991a4d4aa2945ea2c285f8589b12 15-Jul-2011 Greg Clayton <gclayton@apple.com> Fixed the comment lines in the file comment headers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
363be3fc515bea8baf2c5031f3c62f6326d9e1b8 15-Jul-2011 Greg Clayton <gclayton@apple.com> Hollowed out process plug-in to do KDP darwin kernel debugging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h