summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure that qProcessInfo packet returns correct cpu type/subtype for ↵Greg Clayton2014-07-081-12/+17
| | | | | | | | processes on Haswell machines with a Haswell enabled kernel. <rdar://problem/17332107> llvm-svn: 212567
* Fix typos.Bruce Mitchener2014-07-088-14/+14
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-014-14/+14
| | | | llvm-svn: 212132
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Pull ProcessInfo and ProcessLaunchInfo out of Target/Process.Todd Fiala2014-06-301-3/+3
| | | | | | | | | | | | | | | Elevate ProcessInfo and ProcessLaunchInfo into their own headers. llgs will be using ProcessLaunchInfo but doesn't need to pull in the rest of Process.h. This also moves a bunch of implementation details from the header declarations into ProcessInfo.cpp and ProcessLaunchInfo.cpp. Tested on Ubuntu 14.04 Cmake and MacOSX Xcode. Related to https://github.com/tfiala/lldb/issues/26. llvm-svn: 212005
* Revert the debugserver part of r211868. While formally a fine change, ↵Jim Ingham2014-06-278-42/+27
| | | | | | | | | debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. llvm-svn: 211903
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-278-27/+42
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Fix a few typos.Bruce Mitchener2014-06-274-7/+7
| | | | llvm-svn: 211851
* Added an option to turn OFF the "detach on error" behavior that was addedJim Ingham2014-06-252-0/+21
| | | | | | | | to debugserver when launching processes. <rdar://problem/16216199> llvm-svn: 211658
* Rework fix in r201744. You really DO need to waitpid twice to get theJim Ingham2014-06-241-1/+1
| | | | | | | | | | | process fully reaped. The race & bad behavior was because we were letting the reaping thread in LLDB to also set the Process exit status, so debugserver would sometimes be shut down before it got a chance to report the exit status, and then we got confused. <rdar://problem/16555850> llvm-svn: 211636
* Add an option for debugserver to propagate its environment to programs it ↵Greg Clayton2014-06-181-0/+18
| | | | | | | | | | | | | | | | launches using the --forward-env or -F: % ./debugserver --forward-env localhost:1234 -- /bin/ls % ./debugserver -F localhost:1234 -- /bin/ls Also allow new environment variables to be set using the "--env" or "-e": % ./debugserver --env FOO=1 --env BAR=2 localhost:1234 -- /bin/ls % ./debugserver -e FOO=1 -e BAR=2 localhost:1234 -- /bin/ls <rdar://problem/17350654> llvm-svn: 211200
* Those were not the right defines for memory errors, and the right defines aren'tJim Ingham2014-06-171-8/+1
| | | | | | | | available. So going back to a generic error instead. <rdar://problem/17058708> llvm-svn: 211124
* Don't hardcode path to codesign_allocate.Kuba Brecka2014-06-161-1/+5
| | | | | | | | Building OS X debugserver assumes you have an Xcode installation at /Application/Xcode.app. Let's instead detect where Xcode is using xcrun. See http://reviews.llvm.org/D4152 llvm-svn: 211074
* whitespace cleanupJason Molenda2014-06-131-3/+3
| | | | llvm-svn: 210875
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-1321-154/+1425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Added the ability to save core files:Greg Clayton2014-06-131-3/+4
| | | | | | | | | | | (lldb) file /bin/ls (lldb) b malloc (lldb) run (lldb) process save-core /tmp/ls.core Each ObjectFile plug-in now has the option to save core files by registering a new static callback. llvm-svn: 210864
* iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator ↵Greg Clayton2014-05-291-1/+55
| | | | | | | | | | | | | | | | | | apps and binaries. Changes include: - ObjectFileMachO can now determine if a binary is "*-apple-ios" or "*-apple-macosx" by checking the min OS and SDK load commands - ArchSpec now says "<arch>-apple-macosx" is equivalent to "<arch>-apple-ios" since the simulator mixes and matches binaries (some from the system and most from the iOS SDK). - Getting process inforamtion on MacOSX now correctly classifies iOS simulator processes so they have "*-apple-ios" architectures in the ProcessInstanceInfo - PlatformiOSSimulator can now list iOS simulator processes correctly instead of showing nothing by using: (lldb) platform select ios-simulator (lldb) platform process list - debugserver can now properly return "*-apple-ios" for the triple in the process info packets for iOS simulator executables - GDBRemoteCommunicationClient now correctly passes along the triples it gets for process info by setting the OS in the llvm::Triple correctly <rdar://problem/17060217> llvm-svn: 209852
* Revert r209142.Todd Fiala2014-05-192-10/+2
| | | | | | | Need to spend a little more time with suppressing the debugserver 64-to-32 bit warnings. Will re-submit after I get the warnings properly suppressed. llvm-svn: 209151
* Update Xcode settings for Xcode 5.1 (5B130a) to remove workspace warning.Todd Fiala2014-05-192-2/+10
| | | | llvm-svn: 209142
* Add support for gdb remote $X stop notification.Todd Fiala2014-05-191-1/+1
| | | | | | | | | | | | | | debugserver now returns $X09 as the immediate response to a $k kill process request rather than $W09. ProcessGDBRemote now properly handles X as indication of a process exit state. The @debugserver_test and @lldb_test for $k now properly expects an X notification (signal-caused exit) after killing a just-attached inferior that was still in the stopped state. llvm-svn: 209108
* Modify debugserver to follow gdb remote $qC protocol definition.Todd Fiala2014-05-071-5/+11
| | | | | | | | | | $qC from debugserver now returns the current thread's thread-id (and, like $?, will set a current thread if one is not already selected). Previously it was returning the current process id. lldb will now query $qProcessInfo to retrieve the process id. The process id is now cached lazily and reset like other cached values. Retrieval of the process id will fall back to the old $qC method for vendor==Apple and os==iOS if the qProcessInfo retrieval fails. Added a gdb remote protocol-level test to verify that $qProcessInfo reports a valid process id after launching a process, while the process is in the initial stopped state. Verifies the given process id is a currently valid process on host OSes for which we know how to check (MacOSX, Linux, {Free/Net}BSD). Ignores the live process check for OSes where we don't know how to do this. (I saw no portable way to do this in stock Python without pulling in other libs). llvm-svn: 208241
* Add a simple qSupported packet, fix a bug in decode_binary_data(), Jason Molenda2014-05-062-8/+107
| | | | | | | | add a new 'x' packet for reading data in binary format. Document the 'x' packet. <rdar://problem/16032150> llvm-svn: 208051
* Allow for a task port to change when we exec. Greg Clayton2014-04-304-11/+33
| | | | llvm-svn: 207699
* Report the result of waitpid() a little more clearly as well as clearly ↵Greg Clayton2014-04-301-13/+55
| | | | | | logging the process status. llvm-svn: 207698
* Correct offsets in the debugserver arm back end for the s and d registers so ↵Jason Molenda2014-04-301-4/+4
| | | | | | | | | we get the offsets of these correct after the changes of r194302. <rdar://problem/16176270> llvm-svn: 207600
* Fixed an issue where we would try to interrupt a process while it is in the ↵Greg Clayton2014-04-245-7/+110
| | | | | | | | | | process of naturally stopping due to another reason (breakpoint, or step). Added a new MachProcess::Interrupt() which correctly tracks such cases and "does the right thing". <rdar://problem/16593556> llvm-svn: 207139
* lldb arm64 import.Jason Molenda2014-03-2927-301/+3722
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Wait for the reply from the 'D' detach packet before tearing down the ↵Jim Ingham2014-03-281-2/+10
| | | | | | | | | | | | debugger. Avoids a race condition where we could end up killing debugserver (and thus the target) before it had a chance to detach. Also fix debugserver to send the OK AFTER it detaches to avoid the same race condition. <rdar://problem/16202713> llvm-svn: 205043
* Fix cmake build issues on Darwin.Todd Fiala2014-03-134-1/+9
| | | | llvm-svn: 203850
* Since lldb version doesn’t have to be a valid floating point literal, like ↵Todd Fiala2014-03-133-6/+5
| | | | | | | | | | x.y.z, the uses of DEBUGSERVER_VERSION_NUM are invalid and have to be removed. Change by Kuba Ober. llvm-svn: 203828
* Remove an assertion that was being hit due to slow DNS name lookups on ↵Greg Clayton2014-02-271-2/+2
| | | | | | | | | | MacOSX for "localhost". Changed all "localhost" to "127.0.0.1" to prevent potentially long name lookups. <rdar://problem/16154630> llvm-svn: 202424
* Switch debugserver to detach on error by default, and change the flag to ↵Jim Ingham2014-02-251-5/+10
| | | | | | | | | kill-on-error. Also fix the bug where lldb prints: "Got a connection and launched debugserver" rather than the name of the process it actually launched. llvm-svn: 202189
* Allow debugserver to detach from the target if the connection is Jim Ingham2014-02-255-7/+43
| | | | | | unexpectedly closed. llvm-svn: 202110
* Add support for the qSpeedTest packet so we can test packet speeds and data ↵Greg Clayton2014-02-212-3/+26
| | | | | | throughput. llvm-svn: 201874
* Convert to codesigning by hand to work around bugs in Xcode cert verification.Jim Ingham2014-02-181-3/+17
| | | | llvm-svn: 201595
* Don’t leak memory when reading memory and we do an early return for error ↵Greg Clayton2014-02-111-4/+3
| | | | | | conditions. llvm-svn: 201164
* Change RNBRemote::HandlePacket_m() to store the packet on the heapJason Molenda2014-02-111-1/+6
| | | | | | instead of on the stack. Handles larger packet read requests better. llvm-svn: 201118
* If we fail to attach, return an error rather than returning the success or ↵Jim Ingham2014-02-041-1/+3
| | | | | | | | failure of sending the error packet. llvm-svn: 200732
* Add support for Haswell on x86_64.Greg Clayton2014-01-221-1/+1
| | | | | | <rdar://problem/15312873> llvm-svn: 199854
* Make lldb build with Makefiles on OS X.Todd Fiala2014-01-187-1/+173
| | | | | | | | | | | | | | | | | | This change does the following: * Adds Makefile build scripts to debug server. * Fixes a few small mistakes in the other makefiles. * Modifies generate-vers.pl slightly to also work for debugserver. * Changes the OS X, non-framework python search path from libdir to libdir/python2.X/site-packages where it is installed by the build system (also where it is installed on other operating systems). Patch by Keno Fischer. llvm-svn: 199543
* Fix CMake build of debugserver on Mac OS X.Filipe Cabecinhas2014-01-101-1/+1
| | | | llvm-svn: 198970
* Update the lldb version number in the xcode project files from 310.99.0 to ↵Jason Molenda2014-01-101-8/+8
| | | | | | 320.99.0. llvm-svn: 198917
* Remove stuff from debugserver Xcode project that didn't belong.Greg Clayton2013-12-121-13/+0
| | | | llvm-svn: 197188
* Add the "--unix-socket" opton back as it was being used.Greg Clayton2013-12-101-8/+90
| | | | | | <rdar://problem/15622900> llvm-svn: 196952
* Replace all in_port_t with uint16_t to avoid compilation issues on different ↵Greg Clayton2013-12-063-4/+4
| | | | | | systems. llvm-svn: 196586
* Modified local spawning in debugserver processes to use a new ↵Greg Clayton2013-12-051-24/+42
| | | | | | | | | | | | | | | | | | --reverse-connect option so that debugserver actually connects back to LLDB instead of LLDB connecting to debugserver. This gets rid of our hacky "get_random_port()" which would grab a random port and tell debugserver to open that port. Now LLDB creates, binds, listens and accepts a connection by binding to port zero and sending the correctly bound port down as the host:port to connect back to. Fixed the "ConnectionFileDescriptor" to be able to correctly listen for connections from a specified host, localhost, or any host. Prior to this fix "listen://" only accepted the following format: listen://<port> But now it can accept: listen://<port> // Listen for connection from localhost on port <port> listen://<host>:<port> // Listen for connection from <host> and <port> listen://*:<port> // Listen for connection from any host on port <port> llvm-svn: 196547
* Remove log line that was left in accidentally.Greg Clayton2013-12-041-1/+0
| | | | llvm-svn: 196403
* Switch local launching of debugserver over to always use a FIFO in order to ↵Greg Clayton2013-12-043-76/+41
| | | | | | | | | | handshake with the launched debugserver. This helps ensure that the launched debugserver is ready and listening for a connection. Prior to this we had a race condition. Consolidate the launching of debugserver into a single place: a static function in GDBRemoteCommunication. llvm-svn: 196401
* Make sure the getopt variables are correctly initialized for any option parsing.Greg Clayton2013-11-221-0/+8
| | | | | | Added a new "--port-offset PORT" option to lldb-platform so it can be used with USB mux type scenarios. llvm-svn: 195486
* Fixes to get the arm native debugserver building again.Jason Molenda2013-11-216-13/+20
| | | | | | Fix a small typeo in the i386/x86_64 debugserver plugins. llvm-svn: 195308
OpenPOWER on IntegriCloud