summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-gdbserver
Commit message (Collapse)AuthorAgeFilesLines
* Add missing exports file and remove unused onesTamas Berghammer2015-02-181-0/+0
| | | | | | | | These files required by the excode project Patch from: flackr <flackr@google.com> llvm-svn: 229691
* Merge lldb-platform and lldb-gdbserver into a single binaryTamas Berghammer2015-02-183-766/+0
| | | | | | | | | | | | | 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
* Separate monolithic GDBRemoteCommunicationServer class into 4 partTamas Berghammer2015-02-111-9/+8
| | | | | | | | | | | 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
* This patch gets remote-linux platform able to run processesVince Harron2015-01-211-1/+10
| | | | | | | | | | | | | | | | 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-151-1/+2
| | | | | | | | | | 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
* Fixes compilation/run error with BUILD_SHARED_LIBS=TRUEVince Harron2015-01-141-16/+23
| | | | | | | | | | | | BUILD_SHARED_LIBS=TRUE currently isn't working for Linux x86_64 This patch fixes the link errors and also some runtime errors Test Plan: CC=clang CXX=clang++ cmake -GNinja -DBUILD_SHARED_LIBS=TRUE -DCMAKE_LINKER=ld.gold -DCMAKE_BUILD_TYPE=Debug ../../llvm ninja ninja check-lldb llvm-svn: 226039
* Extend PipePosix with support for named pipes/timeout-based IO and integrate ↵Oleksiy Vyalov2015-01-131-14/+9
| | | | | | | | it with GDBRemoteCommunication / lldb-gdbserver. http://reviews.llvm.org/D6954 llvm-svn: 225849
* Make LLGS to open a named pipe and write a listening port to it only when a ↵Oleksiy Vyalov2014-11-271-14/+31
| | | | | | proper port value is received. llvm-svn: 222902
* LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best2014-11-081-1/+29
| | | | llvm-svn: 221570
* Move ConnectionFileDescriptor to platform-specific Host directory.Zachary Turner2014-10-061-1/+1
| | | | | | | | | | | | 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-2/+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-231-5/+2
| | | | | | | Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5417 llvm-svn: 218325
* Fix lldb-gdbserver build.Todd Fiala2014-09-201-3/+3
| | | | | | | | Build break change by Paul Osmialowski. Minor changes to argument passing (converted unintentional pass-by-value to pass-by-ref) by Todd. llvm-svn: 218186
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-5/+5
| | | | | | | | | | | | | 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
* Create a HostThread abstraction.Zachary Turner2014-09-091-6/+8
| | | | | | | | | | | | | 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
* llgs: remove all Initialize() calls except for Debugger::Initialize().Todd Fiala2014-08-271-18/+2
| | | | | | | | | | | | | | | | | | | See thread here: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012580.html The original change I made there was due to a segfault. That was caused by me directly calling PluginManager::Initialize (), with PluginManager::Initialize() depending on HostInfo::Initialize () to have been called already (which it wasn't). The call to PluginManager::Initialize () was erroneous (at least at the current time) since that method is already called by Debugger::Initialize()'s implementation. We will want to revisit initializing a smaller core of the debugger suitable for lldb-gdbserver and lldb-platform. llvm-svn: 216581
* Add missing HostInfo::Initialize() in llgs.Todd Fiala2014-08-211-1/+3
| | | | | | This fixes an llgs segfault on startup. llvm-svn: 216238
* Creates a socket host object.Zachary Turner2014-08-061-3/+7
| | | | | | | | | | | | | | | | | | This patch moves the logic of many common socket operations into its own class lldb_private::Socket. It then modifies the ConnectionFileDescriptor class, and a few users of that class, to use this new Socket class instead of hardcoding socket logic directly. Finally, this patch creates a common interface called IOObject for any objects that support reading and writing, so that endpoints such as sockets and files can be treated the same. Differential Revision: http://reviews.llvm.org/D4641 Reviewed by: Todd Fiala, Greg Clayton llvm-svn: 214984
* llgs: add --reverse-connect support.Todd Fiala2014-07-261-46/+91
| | | | | | Also includes --reverse-connect tests for llgs and debugserver. llvm-svn: 214031
* Fix lldb-gdbserver build Ed Maste2014-07-121-1/+1
| | | | | | s_listen_thread had the wrong type. llvm-svn: 212884
* llgs: modify to accept --native-regs flag.Todd Fiala2014-07-121-10/+13
| | | | | | | | | | | | | | | | This is the last flag sent by lldb-platform that was not accepted by llgs and is accepted by debugserver. Conditionalized out a bit more code in prep for Windows support one day based on _WIN32 define. Updated the lldb-gdbserver usage string to represent recent updates to command line arguments (and some older ones like --attach pid). Implements https://github.com/tfiala/lldb/issues/37 llvm-svn: 212879
* llgs: implement --setsid.Todd Fiala2014-07-121-0/+28
| | | | | | | | | | | | | The --setsid (-S) option changes the session id for the lldb-gdbserver process. This is used by tools such as lldb-platform and allows the user to prevent llgs from being in the same session as a calling terminal session. This will prevents terminal group control signals from affecting lldb-gdbserver. See also: https://github.com/tfiala/lldb/issues/38 llvm-svn: 212873
* Added llgs --named-pipe support and program_name-version_number printout ↵Todd Fiala2014-07-111-51/+161
| | | | | | | | | | | support. Added a unit test to test debugserver and llgs compliance on --named-pipe support. Modified llgs to implement --named-pipe support. (Note: need to revisit with new generic pipe support). llvm-svn: 212854
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-144/+241
| | | | | | | | | | | | | | | | | | | | | 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
* Fixed up lldb-gdbserver to match slightly different debugserver listener ↵Todd Fiala2014-04-281-1/+10
| | | | | | | | host:port message. Fixed up typo in lldb-gdbserver name missed when working on the OS X side earlier today for debugserver support. llvm-svn: 207398
* lldb-gdbserver: add support for optional host in connection string and ↵Todd Fiala2014-03-041-3/+22
| | | | | | | | | handle other startup errors. This change addresses the following bug: http://www.llvm.org/bugs/show_bug.cgi?id=18814 llvm-svn: 202910
* Remove leftover debug printfEd Maste2014-02-051-1/+0
| | | | llvm-svn: 200866
* Modified GDBProcessCommunicationServer to launch via the platform.Todd Fiala2014-01-281-4/+83
| | | | | | | | | | | | | | | | | | | 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
* Added reaper for commandline-launched processes.Todd Fiala2014-01-241-1/+15
| | | | | | | | | | | | | | | | | | 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-231-17/+8
| | | | | | | | | | | | | | | | | | 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
* Add --lldb-command command-line option to lldb-gdbserverTodd Fiala2014-01-211-16/+37
| | | | | | | | | | | | | | | | | | lldb-gdbserver now takes zero or more --lldb-command {command} options that get executed by the command interpreter prior to starting up a child debuggee process. The short form is -c {command}. This is similar to how lldb-platform works. This command can be used to enable logging in more than just the gdb-remote log channel. Here is an example startup sequence that allows logging of lldb host and process log categories to one file and gdb-remote packets to another file: lldb-gdbserver -c 'log enable -f lgs.log lldb process host' \ -c 'log enable -f lgs_packets.log gdb-remote packets' \ localhost:5432 ./some_exe llvm-svn: 199761
* Enable Linux distribution in vendor portion of host triple.Todd Fiala2014-01-171-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does the following: * enables building lldb-gdbserver on linux_x86-64 platforms. Note - it builds but it has several run-time issues where many gdb remote protocol features are not properly implemented yet. I'm working on these one at a time. * lldb-gdbserver: does not enable the eLaunchFlagDebug launch flag on Linux. Currently the POSIX launch routine will assert if that flag is passed in, presumably because that launch mode is not yet available. This prevents lldb-gdbserver from asserting the moment it launches the debuggee process. * Adds ConstString& Host::GetDistributionId () This method is defined to return an empty result on all platforms except for Linux. On Linux, it makes one attempt to execute 'lsb_release -i' (both /usr/bin/lsb_release, where it appears on ubuntu, and /bin/lsb_release, where it appears on fedora if the redhat-lsb package is installed). If lsb_release is not found in either of those locations, or if 'lsb_release -i' does not return the first line starting with "Distributor ID:\t", then the distribution id is empty. The method will lower-case the id and replace whitespace with underscores. * Modify Host::GetArchitecture () so that linux replaces an unknown vendor portion with the results of GetDistributionId () if that is non-empty. This shows up now in qHostInfo remote packet responses and on the lldb host side. Tested with ubuntu and fedora (the latter both with the default of not having lsb_release installed, and with having lsb_release installed via the redhat-lsb package). Examples of triples on Linux after this change: # x86_64 Unbuntu 12.04 LTS: x86_64-ubuntu-linux-gnu # x86_64 Fedora 20 Desktop with redhat-lsb package installed x86_64-fedora-linux-gnu # x86_64 Fedora 20 Desktop without redhat-lsb-core installed # (i.e. no /bin/lsb_release available) # same as before the change x86_64--linux-gnu Note I intend to have Android respond with: {arch}-android-linux when I get to implementing Android lldb-gdbserver support. llvm-svn: 199510
* Modified local spawning in debugserver processes to use a new ↵Greg Clayton2013-12-051-11/+7
| | | | | | | | | | | | | | | | | | --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
* Fixed internal code to not link against and code from "lldb/API/*". Greg Clayton2013-12-022-1/+1
| | | | | | | | | | lldb_private::Debugger was #including some "lldb/API" header files which causes tools (lldb-platform and lldb-gdbserver) that link against the internals only (no API layer) to fail to link depending on which calls were being used. Also fixed the current working directory so that it gets set correctly for remote test suite runs. Now the remote working directory is set to: "ARCH/TESTNUM/..." where ARCH is the current architecture name and "TESTNUM" is the current test number. Fixed the "lldb-platform" and "lldb-gdbserver" to not warn about mismatched visibility settings by having each have their own exports file which contains nothing. This forces all symbols to not be exported, and also quiets the linker warnings. llvm-svn: 196141
* Improved platform support.Greg Clayton2013-11-231-1/+5
| | | | | | | | | | | | Improved the detection of a valid GDB server where we actually can connect to a socket, but then it doesn't read or write anything (which happens with some USB mux software). Host::MakeDirectory() now can make as many intermediate directories as needed. The testsuite now has very initial support for remote test suite running. When running on a remote platform, the setUp function for the test will make a new directory and select it as the working directory on the remote host. Added a common function that can be used to create the short option string for getopt_long calls. llvm-svn: 195541
* Make sure the getopt variables are correctly initialized for any option parsing.Greg Clayton2013-11-221-0/+6
| | | | | | Added a new "--port-offset PORT" option to lldb-platform so it can be used with USB mux type scenarios. llvm-svn: 195486
* Exit if launch doesn't succeed.Greg Clayton2013-11-211-0/+1
| | | | llvm-svn: 195371
* Added the ability to launch the program that was specified on the command ↵Greg Clayton2013-11-211-2/+20
| | | | | | line and have it waiting for a NativeProcessProtocol to attach. llvm-svn: 195370
* Start the correct host abstraction of process and thread.Greg Clayton2013-11-213-0/+277
Added a new "Host/Debug.h" which contains the pure virtual class definitions for NativeProcessProtocol and NativeThreadProtocol. These classes are host layer classes that, over time, every host that supports debugging will implement once. Then the new "lldb-gdbserver" binary in the tools directory will be able to make a remote debugging binary from these native classes, and we will also be able to have a new lldb_private::Process class that implements native debugging using these classes. So as soon as linux and MacOSX switch over to using this layer, everyone will get native and remote debugging. This check-in is primarily to get the needed code in so that poeple can start trying to implement the NativeProcessProtocol and NativeThreadProtocol and use it in the GDBRemoteCommunicationServer class to implement a GDB server for remote debugging. llvm-svn: 195369
OpenPOWER on IntegriCloud