Commit Graph

665 Commits

Author SHA1 Message Date
Ed Maste 1ae28dd793 Add stdlib.h for malloc and friends
llvm-svn: 209633
2014-05-26 14:07:26 +00:00
Ed Maste 8c43ed45ef Remove include of obsolete stropts.h header
The header is for POSIX streams functionality, and does not exist on
FreeBSD, OS X, or contemporary Linux distributions.

llvm-svn: 209632
2014-05-26 14:04:29 +00:00
Ed Maste 4c433e5206 Use MIUtilSystemLinux on FreeBSD as well
We should later rename this file (probably MIUtilSystemPOSIX), but
more clean-up is still needed here, and we can wait until we better
understand how this code may be shared between FreeBSD, Linux, and OS X.

llvm-svn: 209631
2014-05-26 13:57:15 +00:00
Ed Maste d60480f7b6 Add missing header
Presumably included by header leakage on other platforms.

llvm-svn: 209630
2014-05-26 13:48:38 +00:00
Todd Fiala 76e1bf53b4 Revert r209142.
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
2014-05-19 18:30:48 +00:00
Todd Fiala 37ba9f5d8a Update Xcode settings for Xcode 5.1 (5B130a) to remove workspace warning.
llvm-svn: 209142
2014-05-19 16:58:52 +00:00
Hafiz Abid Qadeer 31f56816af Build lldb-mi with autotools on Linux.
THe lldb-mi stuff was not being built on Linux with autotools.
I only added Linux now as I have tested that it build fine on Linux.

llvm-svn: 209117
2014-05-19 09:12:15 +00:00
Todd Fiala ff6131a958 Add support for gdb remote $X stop notification.
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
2014-05-19 04:57:23 +00:00
Deepak Panickal 95442c445f Do not require the triple to be hard-coded
llvm-svn: 208982
2014-05-16 13:26:45 +00:00
Deepak Panickal 6f9c468102 Initial commit of LLDB Machine Interface Frontend.
- Tested with Eclipse, likely to work with other GDB/MI compatible GUIs.
- Some but not all MI commands have been implemented. See MIReadme.txt for more info.
- Written from scratch, no GPL code, based on LLDB Public API.
- Built for Linux, Windows and OSX. Tested on Linux and Windows.
- GDB/MI Command Reference, https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html

llvm-svn: 208972
2014-05-16 10:51:01 +00:00
Todd Fiala 9f72b3a1ce Modify debugserver to follow gdb remote $qC protocol definition.
$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
2014-05-07 19:28:21 +00:00
Jason Molenda 018ff31462 Add a simple qSupported packet, fix a bug in decode_binary_data(),
add a new 'x' packet for reading data in binary format.  Document
the 'x' packet.  
<rdar://problem/16032150> 

llvm-svn: 208051
2014-05-06 02:53:43 +00:00
Joerg Sonnenberger 2cd8f5245f Use correct readline header on NetBSD.
llvm-svn: 207861
2014-05-02 18:59:49 +00:00
Greg Clayton bb49289023 Allow for a task port to change when we exec.
llvm-svn: 207699
2014-04-30 20:27:01 +00:00
Greg Clayton 040c560f2c Report the result of waitpid() a little more clearly as well as clearly logging the process status.
llvm-svn: 207698
2014-04-30 20:24:10 +00:00
Jason Molenda f0d5b54030 Correct offsets in the debugserver arm back end for the s and d registers so we get the offsets
of these correct after the changes of r194302.
<rdar://problem/16176270> 

llvm-svn: 207600
2014-04-30 00:30:07 +00:00
Todd Fiala 71afe0b1d5 Make lldb-gdbserver configure/(g)make build parity with cmake.
This now builds lldb-gdbserver on all Linux and FreeBSD architectures
rather than being locked to x86_64 architectures only.

Please note lldb-gdbserver is not yet functional, this just enables
the non-x86_64 Linux/FreeBSD build using the configure/make build
system.

 --This line, and
those below, will be ignored--

M    tools/Makefile

llvm-svn: 207556
2014-04-29 16:57:45 +00:00
Todd Fiala 9164d9b304 Fixed up lldb-gdbserver to match slightly different debugserver listener 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
2014-04-28 06:04:46 +00:00
Greg Clayton 4296c221d3 Fixed an issue where we would try to interrupt a process while it is in the 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
2014-04-24 19:54:32 +00:00
Colin Riley aba2539989 Fixing MSVC windows build. Please respect code order when ifdefing out MSVC specifics :)
llvm-svn: 205211
2014-03-31 15:48:33 +00:00
Jason Molenda a332978b2a lldb arm64 import.
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
2014-03-29 18:54:20 +00:00
Jim Ingham 6c8824d216 Wait for the reply from the 'D' detach packet before tearing down the 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
2014-03-28 20:00:07 +00:00
Todd Fiala 8a5c5a016c Fix cmake build issues on Darwin.
llvm-svn: 203850
2014-03-13 21:16:13 +00:00
Todd Fiala c3ec337e4d Since lldb version doesn’t have to be a valid floating point literal, like x.y.z,
the uses of DEBUGSERVER_VERSION_NUM are invalid and have to be removed.

Change by Kuba Ober.

llvm-svn: 203828
2014-03-13 18:30:04 +00:00
Hafiz Abid Qadeer d8265d3071 Hide some declarations from mingw.
llvm-svn: 203781
2014-03-13 10:42:28 +00:00
Hafiz Abid Qadeer b4d550a2ca Add Driver to the build for mingw.
llvm-svn: 203653
2014-03-12 10:51:32 +00:00
Hafiz Abid Qadeer 6eff101926 Replace some _MSC_VER with _WIN32.
This allows to use some code for mingw which was previously only
used for MSVC.

llvm-svn: 203651
2014-03-12 10:45:23 +00:00
Hafiz Abid Qadeer bdb515916c Added some missing header files.
They help fix mingw build.

llvm-svn: 203650
2014-03-12 10:39:46 +00:00
Hafiz Abid Qadeer a667875fb9 Fix Mingw build error by using lower case name for windows header files.
llvm-svn: 203505
2014-03-10 22:31:39 +00:00
Todd Fiala 02c11e384d lldb-gdbserver: add support for optional host in connection string and handle other startup errors.
This change addresses the following bug:
http://www.llvm.org/bugs/show_bug.cgi?id=18814

llvm-svn: 202910
2014-03-04 23:41:34 +00:00
Deepak Panickal 627f4ae811 Build liblldb.dll in Windows
llvm-svn: 202724
2014-03-03 15:50:36 +00:00
Deepak Panickal 99fbc07600 Fix Windows build using portable types for formatting the log outputs
llvm-svn: 202723
2014-03-03 15:39:47 +00:00
Greg Clayton 46822c7c72 Fixed the lldb_perf_clang.cpp test case to be able to run correctly.
1 - There were some outdated options being passed to clang
2 - There were some bad paths being passed as options
3 - The path to the main.cpp file ("/tmp/main.cpp") was wrong when the tests were being run, now we create a temp file
4 - Added a new ActionType::eNone to do nothing (no continue, step, or kill)

llvm-svn: 202431
2014-02-27 21:35:49 +00:00
Greg Clayton 1681092f96 Remove an assertion that was being hit due to slow DNS name lookups on MacOSX for "localhost".
Changed all "localhost" to "127.0.0.1" to prevent potentially long name lookups.

<rdar://problem/16154630>

llvm-svn: 202424
2014-02-27 19:38:18 +00:00
Jim Ingham 5689a217e3 Switch debugserver to detach on error by default, and change the flag to 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
2014-02-25 19:57:47 +00:00
Jim Ingham 5881318c88 Allow debugserver to detach from the target if the connection is
unexpectedly closed.

llvm-svn: 202110
2014-02-25 04:53:13 +00:00
Greg Clayton e5671d9cee Add support for the qSpeedTest packet so we can test packet speeds and data throughput.
llvm-svn: 201874
2014-02-21 19:08:33 +00:00
Jim Ingham a524a46fde Convert to codesigning by hand to work around bugs in Xcode cert verification.
llvm-svn: 201595
2014-02-18 19:11:49 +00:00
Greg Clayton f075824998 Don’t leak memory when reading memory and we do an early return for error conditions.
llvm-svn: 201164
2014-02-11 17:49:50 +00:00
Jason Molenda e54a0bfcd3 Change RNBRemote::HandlePacket_m() to store the packet on the heap
instead of on the stack.  Handles larger packet read requests better.

llvm-svn: 201118
2014-02-11 00:48:29 +00:00
Greg Clayton 9c0b64c92d The "-n" and "-p" options to the lldb driver no longer worked after recent IOHandler changes, this is now fixed.
<rdar://problem/15962763>

llvm-svn: 200930
2014-02-06 18:22:44 +00:00
Jim Ingham f0c63b97d6 Fix the --source-quietly option to the driver so that it actually works. Clean up the help
output a bit.

llvm-svn: 200878
2014-02-05 21:35:09 +00:00
Ed Maste f697a1ef94 Enable lldb-gdbserver for FreeBSD in the (g)make build
llvm-svn: 200871
2014-02-05 19:28:47 +00:00
Ed Maste fb29fa3e35 Enable lldb-gdbserver on Linux as well in the cmake build
llvm-svn: 200870
2014-02-05 19:03:18 +00:00
Ed Maste ba7cc706d9 Remove leftover debug printf
llvm-svn: 200866
2014-02-05 18:49:10 +00:00
Ed Maste 29e298a4ce Build lldb-gdbserver on FreeBSD
It passes basic sanity tests so we might as well enable it.

llvm-svn: 200865
2014-02-05 18:37:39 +00:00
Jim Ingham 1c6da87bc9 If we fail to attach, return an error rather than returning the success or failure
of sending the error packet.

llvm-svn: 200732
2014-02-04 01:28:36 +00:00
Deepak Panickal 914b8d989b Fixing the Windows build for the changes brought in from the iohandler merge.
llvm-svn: 200565
2014-01-31 18:48:46 +00:00
Todd Fiala b8b49ec92b Modified GDBProcessCommunicationServer to launch via the platform.
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
2014-01-28 00:34:23 +00:00
Greg Clayton 44d937820b Merging the iohandler branch back into main.
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
2014-01-27 23:43:24 +00:00