summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
Commit message (Collapse)AuthorAgeFilesLines
...
* iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator ↵Greg Clayton2014-05-291-1/+2
| | | | | | | | | | | | | | | | | | 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
* Fix Windows warnings.Todd Fiala2014-05-281-1/+1
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* Add support for gdb remote $X stop notification.Todd Fiala2014-05-191-0/+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
* lldb: gdb remote support always falls back to $qC when no $qProcessInfo.Todd Fiala2014-05-141-15/+12
| | | | | | | | | | | | See thread here: http://lists.cs.uiuc.edu/pipermail/lldb-dev/2014-May/003992.html This is meant to address case 3 that I recently broke with an earlier change to rectify usage of the $qC message for thread ids, specifically: 3. TOT lldb <=> gdbserver (without $qProcessInfo support and not Apple/iOS). llvm-svn: 208741
* Modify debugserver to follow gdb remote $qC protocol definition.Todd Fiala2014-05-072-6/+52
| | | | | | | | | | $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
* Change ProcessGDBRemote::DoReadMemory to use the x packet to readJason Molenda2014-05-062-4/+154
| | | | | | | | | | | | | | | | data if it is available. Change ProcessGDBRemote's maximum read/write packet size from a fixed 512 byte value to asking the remote gdb stub what its maximum is, using up to 128kbyte sizes if that's allowed, and falling back to 512 if the remote gdb stub doesn't advertise a max packet size. Add a new "process plugin packet xfer-size" command that can be used to override the maximum packet size (although not exceeding any packet size maximum published by the remote gdb stub). <rdar://problem/16032150> llvm-svn: 208058
* Add GetxPacketSupported to test if the 'x' packet is supported.Jason Molenda2014-05-062-0/+24
| | | | | | <rdar://problem/16032150> llvm-svn: 208052
* Fixed CTRL+C related issues:Greg Clayton2014-05-021-0/+1
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Missed this file with the r207160 commit.Jason Molenda2014-04-251-0/+3
| | | | llvm-svn: 207161
* Add a new SBThread::GetQueue() method to get the queue that is Jason Molenda2014-04-251-0/+16
| | | | | | | | | | currently associated with a given thread, on relevant targets. Change the queue detection code to verify that the queues associated with all live threads are included in the list. <rdar://problem/16411314> llvm-svn: 207160
* m_interrupt_sent wasn't being initialized, and wasn't being reset after anJim Ingham2014-04-161-0/+3
| | | | | | interrupt. Do both of those. llvm-svn: 206350
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-11/+7
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Add a missing arm64 idef.Jason Molenda2014-04-021-1/+1
| | | | llvm-svn: 205488
* sanitise sign comparisonsSaleem Abdulrasool2014-04-022-5/+5
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* lldb arm64 import.Jason Molenda2014-03-296-73/+460
| | | | | | | | | | | | | | | | 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/+4
| | | | | | | | | | | | 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
* Move calls to DisableAllBreakpointSites() and ↵Andrew MacPherson2014-03-251-4/+0
| | | | | | m_thread_list.DiscardThreadPlans() into base Process::Destroy() instead of in subclass DoDestroy() methods. llvm-svn: 204752
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-0/+1
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Quiet Clang warning about signed/unsigned comparisonEd Maste2014-03-201-1/+1
| | | | llvm-svn: 204360
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-202-25/+5
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Update copy-and-pasted log messageEd Maste2014-03-171-1/+1
| | | | llvm-svn: 204057
* Add a SBQueue::GetKind() method to retrieve the type of libdispatch queue ↵Jason Molenda2014-03-132-0/+22
| | | | | | | | (serial or concurrent). <rdar://problem/7964505> llvm-svn: 203748
* Replace some _MSC_VER with _WIN32.Hafiz Abid Qadeer2014-03-121-1/+1
| | | | | | | This allows to use some code for mingw which was previously only used for MSVC. llvm-svn: 203651
* If you are disabling a hardware breakpoint, use z1 not z0.Jim Ingham2014-03-071-1/+9
| | | | | | <rdar://problem/16256532> llvm-svn: 203232
* Add ProcessGDBRemote::GetAuxvData() and fix multiple-packet concatenation ↵Steve Pucci2014-03-044-6/+38
| | | | | | | | | | for binary data. ProcessGDBRemote::GetAuxvData obtains the auxv from a remote gdbserver (via a binary-data packet), and returns the data as a DataBufferSP. The patch includes a small fix to GDBRemoteCommunicationClient::SendPacketsAndConcatenateResponses() to support binary file format packet returns (by not assuming each binary packet is a null-terminated string when concatenating them). llvm-svn: 202907
* Be sure to propagate the error back out SBTarget::Attach() when we fail to ↵Greg Clayton2014-02-281-22/+25
| | | | | | | | launch debugserver as root. <rdar://problem/15669788> llvm-svn: 202536
* Remove an assertion that was being hit due to slow DNS name lookups on ↵Greg Clayton2014-02-274-13/+21
| | | | | | | | | | MacOSX for "localhost". Changed all "localhost" to "127.0.0.1" to prevent potentially long name lookups. <rdar://problem/16154630> llvm-svn: 202424
* remove useless declarationSylvestre Ledru2014-02-261-2/+0
| | | | llvm-svn: 202281
* Don’t process the stop reply packet as a generic signal if we already ↵Jim Ingham2014-02-241-1/+1
| | | | | | figured out what it was from other data in the packet. llvm-svn: 202066
* Fix handling of gdbserver binary packets with escape characters.Steve Pucci2014-02-241-0/+7
| | | | | | | We were not properly handling the escape character 0x7d ('}') in responses from gdbserver which used the binary protocol. llvm-svn: 202062
* Patch for fixing the handling of hardware breakpoints.Deepak Panickal2014-02-242-59/+97
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2826 llvm-svn: 202028
* Oops, probably ought to turn on that fix...Jim Ingham2014-02-211-1/+1
| | | | llvm-svn: 201897
* We have to call waitpid on the lldb side for Mac OS X (even though we've ↵Jim Ingham2014-02-211-0/+18
| | | | | | | | successfully called it on the debugserver side) when we kill a process or it leaves a zombie around. llvm-svn: 201896
* Improved the GDBRemoteCommunicationClient::TestPacketSpeed() function so it ↵Greg Clayton2014-02-211-32/+68
| | | | | | tests how long it takes to send a 4MB buffer from the REMOTE GDB server to LLDB. llvm-svn: 201875
* Improve the handling of stop-reply packet when it does not containHafiz Abid Qadeer2014-02-201-0/+15
| | | | | | thread information. llvm-svn: 201773
* Fixed deadlocks that could occur when using python for breakpoints, ↵Greg Clayton2014-02-131-1/+5
| | | | | | | | | operating system plugins, and other async python usage. <rdar://problem/16054348> <rdar://problem/16040833> llvm-svn: 201372
* hostname is guarantee to never be null in this branch.Jean-Daniel Dupas2014-02-081-1/+1
| | | | llvm-svn: 201027
* Change the Mac OS X SystemRuntime plugin from using the placeholderJason Molenda2014-02-051-6/+7
| | | | | | | | | | | | | | libldi library to collect extended backtrace information; switch to the libBacktraceRecording library and its APIs. Complete the work of adding QueueItems to Queues and allow for the QueueItems to be interrogated about their extended backtraces in turn. There's still cleanup and documentation to do on this code but the code is functional and I it's a good time to get the work-in-progress checked in. <rdar://problem/15314027> llvm-svn: 200822
* Modified GDBProcessCommunicationServer to launch via the platform.Todd Fiala2014-01-282-2/+25
| | | | | | | | | | | | | | | | | | | GDBProcessCommunicationServer now optionally takes a PlatformSP that defaults to the default platform for the host. GDBProcessCommunicationServer::LaunchProcess () now uses the platform to launch the process. lldb-gdbserver now takes an optional --platform={platform_plugin_name} or -p {platform_plugin_name} command line option. If no platform is specified, the default platform for the host is used; otherwise, if the platform_plugin_name matches a registered platform plugin or matches the default platform's name (which is not necessarily registered by name in the case of 'host'), that platform is used. If the platform name cannot be resolved, lldb-gdbserver exits after printing all the available platform plugin names and the default platform plugin name. llvm-svn: 200266
* Merging the iohandler branch back into main. Greg Clayton2014-01-272-30/+0
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* Change DecodeProcessInfoResponse to set the ProcessInfo's architecture Jason Molenda2014-01-271-0/+31
| | | | | | | | | if the remote stub provided enough information to identify it in the qProcessInfo packet response. (e.g. for an Apple device where we know it is Mach-O, the cpu type & cpu sub type). <rdar://problem/15847901> llvm-svn: 200253
* convert gdb-remote 'A' launch to use LaunchProcess ()Todd Fiala2014-01-271-1/+4
| | | | | | | | | | | | This change modifies the 'A' command handler's launch code to launch with LaunchProcess (). The net effect is that the default process monitoring that LaunchProcess () adds will kick in, allowing the GDBRemoteCommunicationServer to be able to reap processes started with this facility correctly. Later, in the case of lldb-gdbserver, we'll also have the proper process monitoring going on to really debug the inferior process. llvm-svn: 200246
* Support for debugging against a remote stock gdbserver.Steve Pucci2014-01-253-3/+189
| | | | | | | | | | There are a couple of pieces: * some lazy-evaluation members that store info listed in a qSupported response * new method SendPacketsAndConcatenateResponses which is used for fetching fixed-size objects from the remote gdbserver by using multiple packets if necessary (first use will be to fetch shared-library XML files). llvm-svn: 200072
* Initialize the named_pipe_path in ↵Jason Molenda2014-01-251-7/+1
| | | | | | | | | | GDBRemoteCommunication::StartDebugserverProcess right after the space for it is allocated on the stack, instead of trying to initialize it in all the different places in this method. It's too easy for another uninitialized code path to sneak in as it is written right now. llvm-svn: 200066
* Terminate an unused char* buffer correctly so we don't try to openJason Molenda2014-01-241-0/+1
| | | | | | | | it later in GDBRemoteCommunication::StartDebugserverProcess and report an error. <rdar://problem/15820813> llvm-svn: 200047
* Added reaper for commandline-launched processes.Todd Fiala2014-01-242-11/+83
| | | | | | | | | | | | | | | | | | GDBRemoteCommunicationServer::LaunchProcess () now uses the built-up ProcessLaunchArgs rather than clearing and setting items from the function arguments. I added setters for the arguments and launch flags, which lldb-gdbserver uses for its specification of the commandline-specified startup app (if one is specified). LaunchProcess () also adds a new reaper monitor that it applies to the launched process if no process monitor has already been applied. This addresses an issue where the 'k' command would generate (possibly false) warnings about not being able to positively state whether a killed process actually terminated. GDBRemoteCommunicationServer now definitely knows the disposition of its children. llvm-svn: 199959
* Move process launching into GDBRemoteCommunicationServer.Todd Fiala2014-01-232-31/+161
| | | | | | | | | | | | | | | | | | lldb-gdbserver was launching the commandline-specified launch process directly, without GDBRemoteCommunicationServer knowing anything about it. As GDBRemoteCommunicationServer is the piece that manages and knows about processes that the gdb remote protocol discusses with the client end, it is important that it know about launched processes. This change also implements the k gdb remote protocol message, having it kill all known spawned processes when it is received. (Note: in lldb-gdbserver, the spawned processes are not properly monitored yet. The response to the k packet will complain that spawned processes do not really appear to be getting killed even if they are. This will get addressed soon.) llvm-svn: 199945
* Added distribution info to ArchSpec and qHostInfo message.Todd Fiala2014-01-182-1/+19
| | | | | | | | | | | | | | | | | | | ArchSpec now contains an optional distribution_id, with getters and setters. Host::GetArchitecture () sets it on non-Apple platforms using Host::GetDistributionId (). The distribution_id is ignored during ArchSpec comparisons. The gdb remote qHostInfo message transmits it, if set, via the distribution_id={id-value} key/value pair. Updated gdb remote docs to reflect this change. As before, GetDistributionId () returns nothing on non-Linux platforms at this time. On Linux, it is returned only if the lsb_platform command is installed (in /bin or /usr/bin), and only if the distributor id key is returned by 'lsb_platform -i'. This id is lowercased, and whitespace is replaced with underscores. llvm-svn: 199539
* Test new committer permission with one-line trailing whitespace removal.Steve Pucci2014-01-161-1/+1
| | | | llvm-svn: 199432
* Fix return type for WindowsDeepak Panickal2014-01-141-2/+1
| | | | llvm-svn: 199202
OpenPOWER on IntegriCloud