Commit Graph

735 Commits

Author SHA1 Message Date
Todd Fiala eeb023cf76 Fix codesigning of MacOSX debugserver when built with cmake.
This patch fixes the codesigning of debugserver on OSX when built with
cmake.  Without this you get this error when debugging:
    error: process launch failed: unable to locate debugserver

Note: you also need to set LLDB_DEBUGSERVER_PATH to point to your built debugserver.
e.g. export LLDB_DEBUGSERVER_PATH=`pwd`/bin/debugserver

Change by dawn@burble.org.

Tested on MacOSX 10.9.5 and Xcode 6.1 Beta using cmake/ninja.
Verified no build break on Linux Ubuntu cmake/ninja and Xcode 6.1 canonical build.

llvm-svn: 218890
2014-10-02 16:59:30 +00:00
Todd Fiala cacde7df6d Enable llgs to build against experimental Android AOSP 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
2014-09-27 16:54:22 +00:00
Zachary Turner acee96ae52 Fix up the HostThread interface, making the interface simpler.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D5417

llvm-svn: 218325
2014-09-23 18:32:09 +00:00
Todd Fiala 21130fbc04 Fix lldb-gdbserver build.
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
2014-09-20 17:34:48 +00:00
Greg Clayton 615eb7e609 Test suite runs better again after recent fixes that would select a platform 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
2014-09-19 20:11:50 +00:00
Ed Maste def0dae250 Build lldb-mi on all platforms with Makefile builds
CMake builds already do so.

llvm-svn: 217931
2014-09-17 00:28:31 +00:00
Todd Fiala b82ad2a8b8 Fix build break in Xcode build of lldb-tool.
llvm-svn: 217772
2014-09-15 15:17:13 +00:00
Deepak Panickal 428ab6e0ff Fix lldb-mi driver for running on OSX.
llvm-svn: 217668
2014-09-12 12:17:21 +00:00
Zachary Turner 40a069adcd Fix Windows build.
* ssize_t isn't defined by default on Windows.
* New public API files need to be defined in a different file for
  Windows.

llvm-svn: 217624
2014-09-11 20:26:49 +00:00
Zachary Turner 39de311071 Create a HostThread abstraction.
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
2014-09-09 20:54:56 +00:00
Eric Christopher 94c13b5779 Remove unused class variable and its initialization.
llvm-svn: 217425
2014-09-09 06:37:18 +00:00
Eric Christopher fa0f79207c Remove a pair of default values from fully covered switches.
llvm-svn: 217424
2014-09-09 06:35:14 +00:00
Eric Christopher e551d183db Add a newline to the end of the file.
llvm-svn: 217423
2014-09-09 06:32:02 +00:00
Eric Christopher db1c183422 Compare against the right size integer.
llvm-svn: 217422
2014-09-09 06:30:09 +00:00
Eric Christopher 13f091af85 Remove two default cases out of fully covered switches.
llvm-svn: 217421
2014-09-09 06:26:36 +00:00
Eric Christopher 2af274e675 Remove two unused class variables.
llvm-svn: 217420
2014-09-09 06:20:57 +00:00
Saleem Abdulrasool 9e5b49831c driver: handle write error better
We would previously simply assume that the write would always succeed.  However,
write(2) may return -1 for error as well as fail to perform a complete write (in
which case the returned number of bytes will be less than the requested bytes).

Explicitly check if an error condition is encountered.  This would previously
not be caught as we default initialized success to true.  Add an assertion that
we always perform a complete write (a continuous retry could be added to ensure
that we finish writing completely).

This was caught by GCC's signed comparison warning and manual inspection.

llvm-svn: 217355
2014-09-08 02:47:13 +00:00
Han Ming Ong cd2d797a79 rdar://problem/18221417
Include compressed memory as part of gauge memory.

llvm-svn: 217084
2014-09-03 22:33:37 +00:00
Todd Fiala 737f43628a llgs: remove all Initialize() calls except for Debugger::Initialize().
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
2014-08-27 19:56:58 +00:00
Jason Molenda fb700b58cc Bump the verison number in the xcode project files.
llvm-svn: 216245
2014-08-21 23:27:02 +00:00
Todd Fiala 3e9af0dd1d Add missing HostInfo::Initialize() in llgs.
This fixes an llgs segfault on startup.

llvm-svn: 216238
2014-08-21 22:41:25 +00:00
Greg Clayton baac2afccf Cleanup how we listen for process events by using the broadcaster class name instead of having to catch each process instance as it comes alive.
llvm-svn: 215937
2014-08-18 21:09:50 +00:00
Hafiz Abid Qadeer eba7eb7b3f Fix 'pid' and 'executable' fields in the list-thread-group.
The documentation says that these fields should be generated when 
we have proper process or target file. Current implementation did not
check for this. Eclipse seem to use list-thread-group command even
before setting the executable in which case current implementation
can return garbage data.

llvm-svn: 215658
2014-08-14 16:45:50 +00:00
Hafiz Abid Qadeer 6cd101a325 Implementation of exec-run using lldb API.
Previously it was using run command which did not set the process
pointer in the sessionInfo. This commit also sends the proper
out-of-band data.

llvm-svn: 215656
2014-08-14 16:40:27 +00:00
Deepak Panickal f92dc58f0d Fix command "gdb-set" to handle long option --threadgroup and accept --longOption type words as just words for string types.
For example, MI command "17-gdb-set --thread-group i1 args --interpreter" is now acceptable, "--interpreter" was previous not valid.

llvm-svn: 215655
2014-08-14 16:40:15 +00:00
Jason Molenda cfe8fc3e28 Add comment explaining the dwarf v. eh_frame register numbering used
on i386 darwin.

llvm-svn: 215484
2014-08-13 00:21:31 +00:00
Sylvestre Ledru f6102892ef Fix some typos:
* transfered => transferred
* unkown => unknown
* sucessfully => successfully

llvm-svn: 215367
2014-08-11 18:06:28 +00:00
Sylvestre Ledru fca534444b Also build lldb-gdbserver under KFreeBSD
llvm-svn: 215345
2014-08-11 06:29:06 +00:00
Deepak Panickal 7f6edd52c9 Restore some reverted fixes for spelling, newlines and __linux__ macro.
llvm-svn: 215234
2014-08-08 17:39:47 +00:00
Deepak Panickal d249928b84 Add new MI commands, features and fixes to the lldb-mi driver.
- Can now load an executable directly as an argument.
- Fixes towards supporting local debugging.
- Fixes for stack-list-arguments, data-evaluate-expression, environment-cd, stack-list-locals, interpreter-exec.
- Fix breakpoint event handling.
- Support dynamic loading of libraries using the search paths provided by Eclipse.

llvm-svn: 215223
2014-08-08 16:47:42 +00:00
Jim Ingham 5b1fe95dd7 Restore the handling of the --arch argument passed to the Driver that was inadvertently
removed in r214319.

<rdar://problem/17948431>

llvm-svn: 215165
2014-08-07 23:01:31 +00:00
Zachary Turner 98688922b7 Creates a socket host object.
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
2014-08-06 18:16:26 +00:00
Greg Clayton 4966876597 Convert over to using pipes for the initial LLDB commands in the Driver.
This will avoid having to use a temp file and adding temp file related calls to the public API.

llvm-svn: 214536
2014-08-01 18:32:07 +00:00
Ed Maste f8314536ec Fix build: remove bogus ./ at end of line
llvm-svn: 214326
2014-07-30 19:26:11 +00:00
Greg Clayton 06357c930c (no commit message)
llvm-svn: 214319
2014-07-30 17:38:47 +00:00
Sylvestre Ledru 3b6c466e96 Use __linux__ macro throughout, instead of ocasional __linux.
__linux is not universally defined across all standards versions, compilers and architectures. Specifically at C99 and up, it's not defined in GCC on powerpc platform.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28314

Bugzilla: http://llvm.org/bugs/show_bug.cgi?id=20380

Patch by Dimitri John Ledkov <dimitri.ledkov@canonical.com>

llvm-svn: 214291
2014-07-30 08:33:21 +00:00
Todd Fiala 31bde322f3 llgs: add --reverse-connect support.
Also includes --reverse-connect tests for llgs and debugserver.

llvm-svn: 214031
2014-07-26 20:39:17 +00:00
Jason Molenda 36a216eefc Increase the gdb-remote packet timeout for the first packet we send
to the remote side (QStartNoAckMode) - it may take a little longer
than normal to get a reply.

In debugserver, hardcode the priority for several threads so they
aren't de-prioritized when a user app is using system resources.
Also, set the names of the threads.

<rdar://problem/17509866>

llvm-svn: 213828
2014-07-24 01:36:24 +00:00
Sean Callanan 2683aca12e Fixed our install-headers script to set version
numbers correctly.

<rdar://problem/17708687>

llvm-svn: 213284
2014-07-17 17:26:38 +00:00
Ed Maste c25d5cc777 Fix lldb-gdbserver build
s_listen_thread had the wrong type.

llvm-svn: 212884
2014-07-12 21:46:39 +00:00
Todd Fiala a6a362a086 llgs: modify to accept --native-regs flag.
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
2014-07-12 17:34:24 +00:00
Todd Fiala 289ca249f0 llgs: implement --setsid.
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
2014-07-12 01:12:44 +00:00
Todd Fiala 67041194b9 Added llgs --named-pipe support and program_name-version_number printout 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
2014-07-11 22:50:13 +00:00
Todd Fiala 013434e547 __arm64__ and __aarch64__ #ifdef adjustments
Change by Paul Osmialowski

See http://reviews.llvm.org/D4379 for details.

llvm-svn: 212583
2014-07-09 01:29:05 +00:00
Greg Clayton 389be9558f Make sure that qProcessInfo packet returns correct cpu type/subtype for processes on Haswell machines with a Haswell enabled kernel.
<rdar://problem/17332107>

llvm-svn: 212567
2014-07-08 21:45:21 +00:00
Bruce Mitchener aaa0ba31a9 Fix typos.
llvm-svn: 212553
2014-07-08 18:05:41 +00:00
Bruce Mitchener d93c4a3339 Fix typos.
llvm-svn: 212132
2014-07-01 21:22:11 +00:00
Todd Fiala af245d115b Add lldb-gdbserver support for Linux x86_64.
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
2014-06-30 21:05:18 +00:00
Todd Fiala 6d6b55d153 Pull ProcessInfo and ProcessLaunchInfo out of Target/Process.
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
2014-06-30 00:30:53 +00:00
Jim Ingham c1fdb889a9 Revert the debugserver part of r211868. While formally a fine change, 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
2014-06-27 16:02:55 +00:00