summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix warning that not all control-paths return from function.Zachary Turner2015-02-181-1/+1
| | | | llvm-svn: 229718
* Merge lldb-platform and lldb-gdbserver into a single binaryTamas Berghammer2015-02-181-2/+7
| | | | | | | | | | | | | This commit merges lldb-platform and lldb-gdbserver into a single binary of the same size as each of the previous individual binaries. Execution mode is controlled by the first argument being either platform or gdbserver. Patch from: flackr <flackr@google.com> Differential revision: http://reviews.llvm.org/D7545 llvm-svn: 229683
* Remove alias template from GDBRemoteCommunicationServerCommonTamas Berghammer2015-02-181-5/+2
| | | | | | | It is required because MSVC 2013 doesn't generate correct code for template aliases. llvm-svn: 229666
* Send default register number instead of GDB register number in StopReplyPacket.Chaoren Lin2015-02-171-19/+5
| | | | | | | | | | | | | | | | Summary: Using GDB register numbers confuses ProcessGDBRemote since the rest of LLGS (qRegisterInfo, p, P) uses the default register numbers instead. Test Plan: dosep.py --options --arch x86 ... Reviewers: ovyalov, vharron, sivachandra Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7635 llvm-svn: 229505
* Fix small assignment mistake.Chaoren Lin2015-02-171-2/+2
| | | | llvm-svn: 229503
* Fix TestProcessIO.py when run against a remote targetVince Harron2015-02-133-34/+32
| | | | | | | | | | | | | Fixed test case to copy redirected stdout/stderr files from remote target to host llgs wasn't bothering to put the pty master file handle in the right place if stdout/stderr were redirected to a file. It is still needed for stdin. Corrected some log message text llvm-svn: 229141
* Fix windows build (broken by r228823)Tamas Berghammer2015-02-111-0/+3
| | | | llvm-svn: 228828
* Separate monolithic GDBRemoteCommunicationServer class into 4 partTamas Berghammer2015-02-1114-4945/+4957
| | | | | | | | | | | GDBRemoteCommunicationServer: Basic packet handling, handler registration LLDBCommonPacketHandler: Common packet handling for lldb-platform and lldb-gdbserver LLDBPlatformPacketHandler: lldb-platform specific packet handling LLGSPacketHandler: lldb-gdbserver specific packet handling Differential Revision: http://reviews.llvm.org/D7538 llvm-svn: 228823
* Fix 'process launch -i' for remote processesVince Harron2015-02-101-22/+28
| | | | | | | | | | | | | | | | | | We want to forward stdin when stdio is not disabled and when we're not redirecting stdin from a file. renamed m_stdio_disable to m_stdin_forward and inverted value because that's what we want to remember. There was previously a bug that if you redirected stdin from a file, stdout and stderr would also be redirected to /dev/null Adds support for remote target to TestProcessIO.py Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote Linux targets llvm-svn: 228744
* Make lldb-platform to clear m_process_launch_info when hanlding qProcessInfo ↵Oleksiy Vyalov2015-02-061-0/+1
| | | | | | request - otherwise subsequent process launches will reuse data from previous launch. llvm-svn: 228430
* Add support for SBProcess::PutSTDIN to remote processesVince Harron2015-02-065-0/+84
| | | | | | | | | | | | | | Processes running on a remote target can already send $O messages to send stdout but there is no way to send stdin to a remote inferior. This allows processes using the API to pump stdin into a remote inferior process. It fixes a hang in TestProcessIO.py when running against a remote target. llvm-svn: 228419
* Fix warning about the use of mktemp and make platform agnostic by adding and ↵Oleksiy Vyalov2015-02-051-25/+11
| | | | | | | | using PipeBase::CreateWithUniqueName - on behalf of flackr. http://reviews.llvm.org/D7348 llvm-svn: 228307
* Extend SBPlatform with capability to launch/terminate a process remotely. ↵Oleksiy Vyalov2015-02-043-31/+42
| | | | | | | | Integrate this change into test framework in order to spawn processes on a remote target. http://reviews.llvm.org/D7263 llvm-svn: 228230
* Fix TestThreadStepOut on Linux with LLGSChaoren Lin2015-02-031-4/+0
| | | | | | | | Remove implicit stop action on $vCont package for threads where no explicit action or default action specified based on the specification (they have to stay in there original state). llvm-svn: 227933
* Add missing switch cases to silence warnings.Chaoren Lin2015-02-033-9/+13
| | | | llvm-svn: 227931
* Implement setting and clearing watchpoints.Chaoren Lin2015-02-035-70/+156
| | | | llvm-svn: 227930
* Moving header files from source/Host/common to proper location.Chaoren Lin2015-02-032-4/+4
| | | | llvm-svn: 227929
* Share crash information between LLGS and local POSIX debugging withChaoren Lin2015-02-032-33/+37
| | | | | | | CrashReason class. Deliver crash information from LLGS to lldb via description field of thread stop packet. llvm-svn: 227926
* Added support for writing registers larger than 64 bitsChaoren Lin2015-02-031-5/+9
| | | | llvm-svn: 227919
* Launch lldb-gdbserver in same process group when launched remotely using ↵Oleksiy Vyalov2015-01-283-4/+13
| | | | | | | | lldb-platform - commit on behalf of flackr. http://reviews.llvm.org/D7211 llvm-svn: 227329
* Fixing TestRegisters on Linux with LLGSVince Harron2015-01-231-5/+5
| | | | | | | | | | | | | | This patch fixes TestRegisters on Linux with LLGS Introduce GetUserRegisterCount on RegisterInfoInterface to distinguish lldb internal registers (e.g.: DR0-DR7) during register counting. Update GDBRemoteCommunicationServer to skip lldb internal registers on read/write register and on discover register. Submitted for Tamas Berghammer llvm-svn: 226959
* This patch gets remote-linux platform able to run processesVince Harron2015-01-214-4/+21
| | | | | | | | | | | | | | | | Make sure the selected platform is always used Make sure that the host uses the connect://hostname to connect to both the lldb-platform and the lldb-gdbserver rather than what the platform reports as the hostname of the lldb-gdbserver Make sure that lldb-platform uses the IP address on it's connection back to the host instead of the hostname that the host sends to it when launching lldb-gdbserver with the remote host information Tested on OSX and Linux llvm-svn: 226712
* Moved Args::StringToXIntYZ to StringConvert::ToXIntYZVince Harron2015-01-154-44/+48
| | | | | | | | | | The refactor was motivated by some comments that Greg made http://reviews.llvm.org/D6918 and also to break a dependency cascade that caused functions linking in string->int conversion functions to pull in most of lldb llvm-svn: 226199
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-141-3/+2
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver - include reviews fixes. http://reviews.llvm.org/D6954 llvm-svn: 225923
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-131-18/+36
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver. http://reviews.llvm.org/D6954 llvm-svn: 225849
* Add D request handler to GDBRemoteCommunicationServer in order to support ↵Oleksiy Vyalov2014-12-102-1/+73
| | | | | | detach from inferior. llvm-svn: 223901
* Add Linux support for HostInfo::GetOSBuildString and ↵Oleksiy Vyalov2014-12-091-2/+0
| | | | | | HostInfo::GetOSKernelDescription. llvm-svn: 223737
* Revert "Use timeout when reading debugserver's port from a named pipe."Zachary Turner2014-12-041-55/+12
| | | | | | | | | | This reverts commit 4a5ad2c077166cc3d6e7ab4cc6e3dcbbe922af86. Windows doesn't support select() for pipe objects, and this also fails to compile on Windows. Reverting this until we can get it sorted out to keep the windows build working. llvm-svn: 223392
* Use timeout when reading debugserver's port from a named pipe.Oleksiy Vyalov2014-12-031-12/+55
| | | | | | http://reviews.llvm.org/D6490 llvm-svn: 223251
* for Oleksiy Vyalov - Redirect stdin, stdout and stderr to /dev/null when ↵Shawn Best2014-11-051-2/+6
| | | | | | launching LLGS process. Differential Revision: http://reviews.llvm.org/D6105 llvm-svn: 221324
* Fix one more [-Werror,-Winconsistent-missing-override] error.Eric Christopher2014-11-041-1/+1
| | | | llvm-svn: 221232
* Fix a bunch of [-Werror,-Winconsistent-missing-override] errors.Eric Christopher2014-11-041-42/+42
| | | | llvm-svn: 221231
* The change previously committed as 220983 broke large binary memory reads. I ↵Greg Clayton2014-11-031-58/+55
| | | | | | | | | | kept the "idx - 1" fix from 220983, but reverted the while loop that was incorrectly added. The details are: large packets (like large memory reads (m packets) or large binary memory reads (x packet)) can get responses that come in across multiple read() calls. The while loop that was added meant that if only a partial packet came in (like only "$abc" coming for a response) GDBRemoteCommunication::CheckForPacket() was called, it would deadlock in the while loop because no more data is going to come in as this function needs to be called again with more data from another read. So the original fix will need to be corrected and resubmitted. <rdar://problem/18853744> llvm-svn: 221181
* commit on behalf of Oleksiy Vyalov Fix junk content handling within ↵Shawn Best2014-10-311-55/+58
| | | | | | GDBRemoteCOmmunication::CheckForPacket 1. Avoid removing of an extra symbol from m_bytes. 2. iterate over m_bytes until useful content is found. Differential Revision: http://reviews.llvm.org/D6042 llvm-svn: 220983
* llgs: fixes to PTY/gdb-remote inferior stdout/stderr handling, logging addtions.Todd Fiala2014-10-113-21/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, both local-process llgs and remote-target llgs stdout/stderr handling from inferior work correctly. Several log lines have been added around PTY and stdout/stderr redirection logic on the lldb client side. Regarding remote llgs execution, see the following: With these changes, remote llgs with $O now works properly: $ lldb (lldb) platform select remote-linux (lldb) target create ~/some/inferior/exe (lldb) gdb-remote {some-target}:{port} (lldb) run The sequence above will correctly redirect stdout/stderr over gdb-remote $O, as is needed for remote debugging. That sequence assumes there is a lldb-gdbserver exe running on the target with {some-host}:{port}. You can replace the gdb-remote command with a '(lldb) platform connect connect://{target-ip}:{target-port}'. If you do this and have a lldb-platform running on the remote end, it will go ahead and launch llgs for lldb for each target instance that is run/attached. For local debugging with llgs, the following sequence also works, and uses local PTYs instead to avoid $O and extra gdb-remote messages: $ lldb (lldb) settings set platform.plugin.linux.use-llgs true (lldb) target create ~/some/inferior/exe (lldb) run The above will run the inferior using llgs on the local host, and will use PTYs rather than $O redirection. This change also removes the logging that happened after the fork but before the exec when llgs is launching a new inferior process. Some aspect of the file handling during that portion of code would not do the right thing with log handling. We might want to go back later and have that communicate over a pipe from the child to parent to pass along any messages that previously were logged in that section of code. llvm-svn: 219578
* Added a bit of logging around ↵Todd Fiala2014-10-091-0/+5
| | | | | | GDBRemoteCommunicationClient::SendGDBStoppointTypePacket. llvm-svn: 219374
* Move ConnectionFileDescriptor to platform-specific Host directory.Zachary Turner2014-10-064-4/+4
| | | | | | | | | | | | As part of getting ConnectionFileDescriptor working on Windows, there is going to be alot of platform specific work to be done. As a result, the implementation is moving into Host. This patch performs the code move and fixes up call-sites appropriately. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5548 llvm-svn: 219143
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-271-1/+0
| | | | | | | | | | | | lldb/llvm/clang/compiler-rt repos. See http://reviews.llvm.org/D5495 for more details. These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}. llvm-svn: 218568
* Fix up the HostThread interface, making the interface simpler.Zachary Turner2014-09-232-21/+10
| | | | | | | Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5417 llvm-svn: 218325
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+1
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* llgs: removed some wait-for-stop code in inferior process launch pipeline.Todd Fiala2014-09-182-31/+8
| | | | | | | | | | | | | The $A handler was unnecessarily waiting for the launched app to hit a stop before returning. Removed this code. Renamed the llgs inferior launching code to LaunchProcessForDebugging () to prevent it from possibly being mistaken as code that lldb-platform uses to launch a debugserver process. We probably want to look at breaking out llgs-specific and lldb-platform-specific code into separate derived classes, with common code in a shared base class. llvm-svn: 218075
* Hex encode the triple values in case they contain special characters.Greg Clayton2014-09-182-5/+17
| | | | llvm-svn: 218001
* Add better logging for the "$vFile:pwrite:" packet so we can show binary ↵Greg Clayton2014-09-181-5/+33
| | | | | | data instead of nothing or unprintable characters. This can easily be extended for other packets that have binary data. llvm-svn: 218000
* use std::atomic<> to protect variables being accessed by multiple threadsTodd Fiala2014-09-151-1/+1
| | | | | | | | | | There are several places where multiple threads are accessing the same variables simultaneously without any kind of protection. I propose using std::atomic<> to make it safer. I did a special build of lldb, using the google tool 'thread sanitizer' which identified many cases of multiple threads accessing the same memory. std::atomic is low overhead and does not use any locks for simple types such as int/bool. See http://reviews.llvm.org/D5302 for more details. Change by Shawn Best. llvm-svn: 217818
* Properly decode architecture type in ↵Todd Fiala2014-09-151-1/+21
| | | | | | | | | | | | | | | | | | | GDBRemoteCommunicationClient::GetCurrentProcessInfo. Instead of forcing the remote arch type to MachO all the time, we inspect the OS/vendor that the remote debug server reports and use it to set the arch type to MachO, ELF or COFF accordingly. See thread here for more context: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140915/012968.html Change by Stephane Sezer. Tested: MacOSX 10.9.4 x86_64 Ubuntu 14.04 x86_64 llvm-svn: 217779
* Check for byte order correctness in ↵Todd Fiala2014-09-151-4/+14
| | | | | | | | | | | | | | GDBRemoteCommunicationClient::GetCurrentProcessInfo. This is useful for checking inconsistencies between what the remote debug server thinks we are debugging and we think we are debugging. This follows the check for pointer byte size done just above. Change by Stephane Sezer. Tested: Ubuntu 14.04 x86_64, llvm-3.5-built lldb MacOSX 10.9.4, Xcode-Beta(2014-09-09)-built lldb. llvm-svn: 217773
* llgs: fix thread names broken by recent native thread changes.Todd Fiala2014-09-121-6/+6
| | | | | | | | * Fixes the local stack variable return pointer usage in NativeThreadLinux::GetName(). * Changes NativeThreadProtocol::GetName() to return a std::string. * Adds a unit test to verify thread names don't regress in the future. Currently only run on Linux since I know default thread names there. llvm-svn: 217717
* llgs: fix Ctrl-C inferior interrupt handling to do the right thing.Todd Fiala2014-09-111-4/+2
| | | | | | | | | | | | | | | | * Sends a SIGSTOP to the process. * Fixes busted SIGSTOP handling. Now builds a list of non-stopped that we wait for the PTRACE group-stop for. When the final must-stop tid gets its group stop, we propagate the process state change. Only the signal receiving the notification of the pending SIGSTOP is marked with the SIGSTOP signal. All the rest, if they weren't already stopped, are marked as stopped with signal 0. * Fixes a few broken tests. * Marks the Linux test I added earlier as expect-pass (no longer XFAIL). Implements fix for http://llvm.org/bugs/show_bug.cgi?id=20908. llvm-svn: 217647
* llgs: implement qThreadStopInfo.Todd Fiala2014-09-102-2/+27
| | | | | | | | | | | This change implements this ticket: http://llvm.org/bugs/show_bug.cgi?id=20899 Adds the qThreadStopInfo RSP command for llgs and includes a test that verifies both debugserver and llgs respond with something reasonable on a multithreaded app. llvm-svn: 217549
* Create a HostThread abstraction.Zachary Turner2014-09-094-42/+23
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
OpenPOWER on IntegriCloud