Commit Graph

686 Commits

Author SHA1 Message Date
Jason Molenda 3874ee6869 Bump the version # in the xcode proj file from major number 340 to 350.
The SB API for major version 340 won't be changing any more.

llvm-svn: 243943
2015-08-04 03:14:49 +00:00
Zachary Turner 2c1f46dcc6 Convert the ScriptInterpreter system to a plugin-based one.
Previously embedded interpreters were handled as ad-hoc source
files compiled into source/Interpreter.  This made it hard to
disable a specific interpreter, or to add support for other
interpreters and allow the developer to choose which interpreter(s)
were enabled for a particular build.

This patch converts script interpreters over to a plugin-based system.
Script interpreters now live in source/Plugins/ScriptInterpreter, and
the canonical LLDB interpreter, ScriptInterpreterPython, is moved there
as well.

Any new code interfacing with the Python C API must live in this location
from here on out.  Additionally, generic code should never need to
reference or make assumptions about the presence of a specific interpreter
going forward.

Differential Revision: http://reviews.llvm.org/D11431
Reviewed By: Greg Clayton

llvm-svn: 243681
2015-07-30 20:28:07 +00:00
Ed Maste 5bfed4a77f Update xcode for r243427
llvm-svn: 243432
2015-07-28 16:11:12 +00:00
Enrico Granata ccc025b9fe Add an Either<T,U> type to lldb_utility which represents a type-safe payload of either one type or another, à la Haskell
llvm-svn: 242867
2015-07-22 02:06:37 +00:00
Jason Molenda 86a86cf725 Build ValueObjectConstResultCast.cpp.
llvm-svn: 242379
2015-07-16 03:38:17 +00:00
Ewan Crawford cf388ccfbc Fix LLDB Xcode build broken in r242137
llvm-svn: 242143
2015-07-14 13:29:03 +00:00
Ewan Crawford 90ff791141 Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function call on target via register manipulation
For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support. 
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.

In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation. 
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter. 

The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.

Reviewers: jingham, spyffe

Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427

Differential Revision: http://reviews.llvm.org/D9404

llvm-svn: 242137
2015-07-14 10:56:58 +00:00
Chaoren Lin 98d0a4b39a Refactor Unix signals.
Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.

Reviewers: ovyalov, clayborg

Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11094

llvm-svn: 242101
2015-07-14 01:09:28 +00:00
Pavel Labath 77dc9569c6 Introduce a MainLoop class and switch llgs to use it
Summary:
This is the first part of our effort to make llgs single threaded. Currently, llgs consists of
about three threads and the synchronisation between them is a major source of latency when
debugging linux and android applications.

In order to be able to go single threaded, we must have the ability to listen for events from
multiple sources (primarily, client commands coming over the network and debug events from the
inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop.
A main loop has the ability to register callback's which will be invoked upon receipt of certain
events. MainLoopPosix has the ability to listen for file descriptors and signals.

For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop
instead of waiting on the network socket directly, but the other threads still remain. In the
followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining
threads.

Reviewers: ovyalov, clayborg, amccarth, zturner, emaste

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D11066

llvm-svn: 242018
2015-07-13 10:44:55 +00:00
Greg Clayton 1eb778fc2b Unbreak the MacOSX build.
llvm-svn: 241749
2015-07-08 22:21:22 +00:00
Jason Molenda 27467eab81 For the "ios" target add a shell script phase at the end which
removes the LLDB.framework/Resources and LLDB.framework/Swift
directories.  This isn't a deep bundle on ios builds; it is shallow.
    
<rdar://problem/16676101>

llvm-svn: 241540
2015-07-07 03:38:42 +00:00
Tamas Berghammer 3937bc650c Add new bugreport command to lldb
The new command add functionality to print out domain specific
information for reporting a bug. Currently the only supported
domain is stack unwinding (with "bugreport unwind") but adding
new domains is fairly easy.

Differential revision: http://reviews.llvm.org/D10868

llvm-svn: 241252
2015-07-02 10:03:37 +00:00
Greg Clayton 63cacd7b79 Make sure that SharingPtr.h appears in the LLDB.framework by making it a public header in the LLDB framework target.
This fixes test issues with building lldb/test/api/multithreaded and a few other tests that build against the LLDB.framework in our build directory.

llvm-svn: 240993
2015-06-29 20:42:28 +00:00
Greg Clayton 164a6098a9 Xcode project cleanups.
- Don't have any header files claim to be part of the lldb-core target. If they are part of the lldb-core target then any file can just #include the header file name without the prefix (#include "Foo.h") when the cmake/make/other builds would require a full path (#include "lldb/Core/Foo.h"). This will help make sure the builds succeed on all platforms when changes are made on MacOSX.
- Add the Hexagon dynamic loader to the DynamicLoader plug-in folder so it gets compiled in MacOSX. There was a recent build bot failure that wasn't caught due to this code not being compile in the MacOSX build

llvm-svn: 240714
2015-06-25 22:47:02 +00:00
Greg Clayton b289cba50e Submitting patch from Abhishek for:
http://reviews.llvm.org/D10309

llvm-svn: 240663
2015-06-25 17:50:15 +00:00
Jason Molenda 0c36c27543 xcode project file updates for the movement of the POSIX files into the FreeBSD process subdir.
llvm-svn: 240621
2015-06-25 03:03:47 +00:00
Greg Clayton 9350f0ddac Fix the MacOSX build to include the Mips64 ABI plug-in.
llvm-svn: 240173
2015-06-19 20:08:36 +00:00
Jason Molenda 91ffe0a570 Add a new wart, I mean feature, on to gdb-remote protocol: compression.
For some communication channels, sending large packets can be very 
slow.  In those cases, it may be faster to compress the contents of
the packet on the target device and decompress it on the debug host
system.  For instance, communicating with a device using something
like Bluetooth may be an environment where this tradeoff is a good one.

This patch adds a new field to the response to the "qSupported" packet
(which returns a "qXfer:features:" response) -- SupportedCompressions
and DefaultCompressionMinSize.  These tell you what the remote
stub can support.

lldb, if it wants to enable compression and can handle one of those 
algorithms, it can send a QEnableCompression packet specifying the
algorithm and optionally the minimum packet size to use compression
on.  lldb may have better knowledge about the best tradeoff for
a given communication channel.

I added support to debugserver an lldb to use the zlib APIs
(if -DHAVE_LIBZ=1 is in CFLAGS and -lz is in LDFLAGS) and the
libcompression APIs on Mac OS X 10.11 and later 
(if -DHAVE_LIBCOMPRESSION=1).  libz "zlib-deflate" compression.
libcompression can support deflate, lz4, lzma, and a proprietary
lzfse algorithm.  libcompression has been hand-tuned for Apple
hardware so it should be preferred if available.

debugserver currently only adds the SupportedCompressions when
it is being run on an Apple watch (TARGET_OS_WATCH).  Comment
that #if out from RNBRemote.cpp if you want to enable it to
see how it works.  I haven't tested this on a native system
configuration but surely it will be slower to compress & decompress
the packets in a same-system debug session.

I haven't had a chance to add support for this to 
GDBRemoteCommunciationServer.cpp yet.

<rdar://problem/21090180> 

llvm-svn: 240066
2015-06-18 21:46:06 +00:00
Jason Molenda 651f4e6e1e Add ABISysV_mips.cpp to the xcode project file.
llvm-svn: 240000
2015-06-18 07:32:14 +00:00
Enrico Granata 55d36e2b83 Add a ThreadSafe adapter over llvm::DenseSet
llvm-svn: 239865
2015-06-16 23:20:12 +00:00
Pavel Labath c7c30eb528 Revert "Introduce a TypeSystem interface to support adding non-clang languages."
This seems to break expression evaluation on the linux build.

llvm-svn: 239366
2015-06-08 23:38:06 +00:00
Pavel Labath c33ae024a6 Introduce a TypeSystem interface to support adding non-clang languages.
Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8712
Original Author: Ryan Brown <ribrdb@google.com>

llvm-svn: 239360
2015-06-08 22:27:10 +00:00
Greg Clayton 2d7ab874c1 Fix the Xcode build after the recent new demangling files were added.
llvm-svn: 238493
2015-05-28 20:57:55 +00:00
Greg Clayton 424a5dbc73 Added a new API to SBFrame:
lldb::addr_t SBFrame::GetCFA();

This gets the CFA (call frame address) of the frame so it allows us to take an address that is on the stack and figure out which thread it comes from.

Also modified the heap.py module to be able to find out which variable in a frame's stack frame contains an address. This way when ptr_refs finds a match on the stack, it get then report which variable contains the pointer.

llvm-svn: 238393
2015-05-28 03:27:22 +00:00
Tamas Berghammer 0cb78b3b2a Fix xcode project after r238319
llvm-svn: 238321
2015-05-27 14:04:26 +00:00
Greg Clayton b1ca494b6e Add StructuredData.h to the Xcode project.
llvm-svn: 238278
2015-05-27 03:22:42 +00:00
Greg Clayton d04f0edad9 Added XML to the host layer.
We know have on API we should use for all XML within LLDB in XML.h. This API will be easy back the XML parsing by different libraries in case libxml2 doesn't work on all platforms. It also allows the only place for #ifdef ...XML... to be in XML.h and XML.cpp. The API is designed so it will still compile with or without XML support and there is a static function "bool XMLDocument::XMLEnabled()" that can be called to see if XML is currently supported. All APIs will return errors, false, or nothing when XML isn't enabled.

Converted all locations that used XML over to using the host XML implementation.

Added target.xml support to debugserver. Extended the XML register format to work for LLDB by including extra attributes and elements where needed. This allows the target.xml to replace the qRegisterInfo packets and allows us to fetch all register info in a single packet.

<rdar://problem/21090173>

llvm-svn: 238224
2015-05-26 18:00:51 +00:00
Vince Harron e9efc17974 Change lldb-mi deployment target to use Xcode project global setting
Differential Revision: http://reviews.llvm.org/D9705

llvm-svn: 237598
2015-05-18 19:35:07 +00:00
Greg Clayton 286ea2342d Fix the lldb-mi Xcode project build target to it compiles.
llvm-svn: 237464
2015-05-15 18:38:04 +00:00
Robert Flack fd8893fd96 Add EmulateInstructionMIPS to the xcode project file to fix build after r237420.
llvm-svn: 237446
2015-05-15 13:37:02 +00:00
Vince Harron 5727e4cf05 XFAIL'd TestPersistObjCPointeeType.py
llvm-svn: 237182
2015-05-12 21:16:51 +00:00
Vince Harron 069391ac15 Working on getting the OSX build green
Added missing SBLanguageRuntime.h to lldb.xcodeproj, set to Public (fixed compile error in TestPublicAPIHeaders)
Removed reference to (temporarily) missing gtest.xcodeproj
Fixed TestDeadStrip compile error
XFAIL TestPublicAPIHeaders - test passes but teardown command 'settings remove target.env-vars DYLD_LIBRARY_PATH' fails
XFAIL TestCModules - use of undeclared identifier 'MIN'
XFAIL TestModulesAutoImport - clang: error: unknown argument: '-gmodules'
XFAIL TestObjCNewSyntax - expr -- @((char*)"Hello world" + 6) cannot box a string value because NSString has not been declared

http://reviews.llvm.org/D9643

llvm-svn: 237085
2015-05-12 02:20:27 +00:00
Oleksiy Vyalov 919ef9dc37 Use file locks to synchronize access to ModuleCache.
http://reviews.llvm.org/D9056

llvm-svn: 236736
2015-05-07 15:28:49 +00:00
Pavel Labath c076559a5b [NativeProcessLinux] fold ThreadStateCoordinator into NPL
Summary:
Since all TSC operations are now executed synchronously, TSC has become a little more than a
messenger between different parts of NativeProcessLinux. Therefore, the reason for its existance
has disappeared.

This commit moves the contents of the TSC into the NPL class. This will enable us to remove all
the boilerplate code in NPL (as it stands now, this is most of the class), which I plan to do in
subsequent commits.

Unfortunately, this also means we will lose the unit tests for the TSC. However, since the size
of the TSC has diminished, the unit tests were not testing much at this point anyway, so it's not
a big loss.

No functional change.

Test Plan: All tests continue to pass.

Reviewers: vharron, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9296

llvm-svn: 236587
2015-05-06 10:46:34 +00:00
Jason Molenda d752050cc3 Add CommandObjectLanguage to the xcode project file.
llvm-svn: 236477
2015-05-05 02:03:37 +00:00
Jason Molenda 0e78cab17b Update to build sysv-arm/sysv-arm64/sblanguageinfo/registercontextlinux_arm64.
llvm-svn: 236169
2015-04-29 22:16:19 +00:00
Greg Clayton 937ff6e9c6 Make sure files in the Xcode project in source/API are in alphabetic order.
llvm-svn: 235894
2015-04-27 16:52:08 +00:00
Bruce Mitchener 17d2730ee0 Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).

Test Plan: Build and see.

Reviewers: zturner, emaste, clayborg

Reviewed By: clayborg

Subscribers: mjsabby, lldb-commits

Differential Revision: http://reviews.llvm.org/D9212

llvm-svn: 235676
2015-04-24 00:38:53 +00:00
Ed Maste 97df86ceb1 FreeBSD/arm core file support
Patch by Andrew Turner, with minor edits. XCode changes are mine; please
update if necessary.

llvm-svn: 235305
2015-04-20 13:58:19 +00:00
Greg Clayton e68c008519 Define LIBXML2_DEFINED in the Xcode project for Xcode builds so Darwin builds can take advantage of the new GDB register info from the target XML.
Also add "#if defined( LIBXML2_DEFINED )" around code that already used libxml2 in SymbolVendorMacOSX.cpp.

Cleaned up some warnings in ProcessGDBRemote.cpp.

llvm-svn: 235144
2015-04-16 23:13:26 +00:00
Oleksiy Vyalov f74503c5a6 Fix XCode build after r234870.
llvm-svn: 234877
2015-04-14 10:20:43 +00:00
Sean Callanan 0daf55703d Added the RenderScript language runtime plugin
to the .xcodeproj.

llvm-svn: 234508
2015-04-09 17:26:21 +00:00
Greg Clayton 608693ee07 Fix Xcode build after MipsLinuxSignals.cpp was added.
llvm-svn: 234500
2015-04-09 16:37:10 +00:00
Greg Clayton f55ec07b38 Don't export a ton of lldb_private symbols from argdumper.
llvm-svn: 233825
2015-04-01 17:38:08 +00:00
Zachary Turner e6e2bb3842 Rework LLDB system initialization.
In an effort to reduce binary size for components not wishing to
link against all of LLDB, as well as a parallel effort to reduce
link dependencies on Python, this patch splits out the notion of
LLDB initialization into "full" and "common" initialization.

All code related to initializing the full LLDB suite lives directly
in API now.  Previously it was only referenced from API, but because
it was defined in lldbCore, it would get implicitly linked against
by everything including lldb-server, causing a considerable
increase in binary size.

By moving this to the API layer, it also creates a better layering
for the ongoing effort to make the embedded interpreter replacable
with one from a different language (or even be completely removeable).

One semantic change necessary to get this all working was to remove
the notion of a shared debugger refcount.  The debugger is either
initialized or uninitialized now, and calling Initialize() multiple
times will simply have no effect, while the first Terminate() will
now shut it down no matter how many times Initialize() was called.
This behaves nicely with all of our supported usage patterns though,
and allows us to fix a number of nasty hacks from before.

Differential Revision: http://reviews.llvm.org/D8462

llvm-svn: 233758
2015-03-31 21:03:22 +00:00
Robert Flack a5bcb2ed8a Add/fix FreeBSD/arm64 files in xcode build from r233273.
llvm-svn: 233317
2015-03-26 21:02:03 +00:00
Ed Maste 27b4ed0983 Add FreeBSD/arm64 files to xcode build
llvm-svn: 233281
2015-03-26 15:55:16 +00:00
Jason Molenda 4f57d6abbe Update xcode project file for addition/removals in r233083 and r233114.
llvm-svn: 233167
2015-03-25 03:26:02 +00:00
Oleksiy Vyalov 05a55de3ba Move ADB communications to AdbClient class - to make it accessible by other components.
http://reviews.llvm.org/D8535

llvm-svn: 233021
2015-03-23 21:03:02 +00:00
Zachary Turner 3a00691f3d Move LLDB initialization/shutdown to Initialization.
This creates a new top-level folder called Initialization which
is intended to hold code specific to LLDB system initialization.
Currently this holds the Initialize() and Terminate() functions,
as well as the fatal error handler.

This provides a means to break the massive dependency cycle which
is caused by the fact that Debugger depends on Initialize and
Terminate which then depends on the entire LLDB project.  With
this structure, it will be possible for applications to invoke
lldb_private::Initialize() directly, and have that invoke
Debugger::Initialize.

llvm-svn: 232768
2015-03-19 22:00:21 +00:00