Commit Graph

546 Commits

Author SHA1 Message Date
Todd Fiala ba78c15c9d Move MemoryRegionInfo out of Target/Process.h into its own header.
lldb-gdbserver and NativeProcessProtocol will use MemoryRegionInfo
but don't want to pull in Process.h.  Pull this declaration and
definition out into its own header.

llvm-svn: 210213
2014-06-04 20:13:37 +00:00
Greg Clayton 4bd024d4e8 Small cleanups for the new enum fixes:
- Fix Xcode project to have source files for SBTypeEnumMember.h/SBTypeEnumMember.cpp in the right place
- Rename a member variable to inluce "_sp" suffix since it is a shared pointer
- Cleanup initialization code for TypeEnumMemberImpl to not warn about out of order initialization

llvm-svn: 210051
2014-06-02 21:58:30 +00:00
Todd Fiala 732215f989 Add support for inspecting enum members.
Change by Russell Harmon.

Xcode project updates (and all errors therein)
by Todd Fiala.

llvm-svn: 210046
2014-06-02 20:55:29 +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
Todd Fiala 4fc3cdd054 Refactored RegisterInfoInterface into its own header.
Also moved it into the lldb_private namespace.

The llgs branch is making use of this interface and its use is not
strictly limited to POSIX.

llvm-svn: 209016
2014-05-16 20:43:19 +00:00
Jason Molenda 3e46e20746 Add FreeBSDSignals.cpp to project file.
llvm-svn: 206524
2014-04-17 23:29:19 +00:00
Jim Ingham 46d005dbc4 Workaround for collision between enum members in LLVM's MachO.h and system headers
on Mac OS X (in particular mach/machine.h).

<rdar://problem/16494607>

llvm-svn: 205480
2014-04-02 22:53:21 +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
Jason Molenda d5dd36a020 Link against the zlib solib, required to build against TOT llvm.
llvm-svn: 205082
2014-03-29 07:11:52 +00:00
Greg Clayton 23f8c95a44 JITed functions can now have debug info and be debugged with debug and source info:
(lldb) b puts
(lldb) expr -g -i0 -- (int)puts("hello")

First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression.

Main features:
- New ObjectFileJIT class that can be easily created for JIT functions
- debug info can now be enabled when parsing expressions
- source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit
- "expr -g --" allows you to single step through your expression function with source code

<rdar://problem/16382881>

llvm-svn: 204682
2014-03-24 23:10:19 +00:00
Greg Clayton 9bb8cb1965 Move LLDBWrapPython.cpp into the build folder for Xcode builds so it doesn't muck with cmake builds.
llvm-svn: 203956
2014-03-14 18:24:30 +00:00
Greg Clayton a44acc78ca Fixed Xcode project after files were moved over into trunk/source/Plugins/Process/Utility.
llvm-svn: 203688
2014-03-12 18:11:56 +00:00
Greg Clayton 747c593474 Get rid of lldb-dll-export.h and place the smarts of this into lldb-defines.h.
Please do not add header files that are required in public APIs without first checking with us. This broke the LLDB builds at Apple because the lldb-dll-export.h wasn't included in the LLDB.framework and it was being included by public API header files.

llvm-svn: 203177
2014-03-06 23:11:53 +00:00
Sean Callanan 9b5256c566 Added lldb-dll-export.h to the public API, fixing
clients of LLDB.

<rdar://problem/16248988>

llvm-svn: 203139
2014-03-06 17:50:01 +00:00
Greg Clayton 4b047f2378 Moved JITLoader.cpp and JITLoaderList.cpp over into "source/Target" since the header files were in "include/lldb/Target".
Also enabled the ELF Core file support in all builds since the header files have been properly separated from ProcessMonitor.

llvm-svn: 203035
2014-03-06 00:14:12 +00:00
Jason Molenda b509a414f0 Add the new JITLoader plugin files to the lldb xcode project file.
Add a cast for a size_t / PRIu64 printf formatter.

llvm-svn: 203030
2014-03-05 23:48:15 +00:00
Jim Ingham 1e9947a56d Move the libpanel dependency into the Libraries project folder.
llvm-svn: 201596
2014-02-18 19:22:13 +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
Jason Molenda 2fd83355a8 Change the Mac OS X SystemRuntime plugin from using the placeholder
libldi library to collect extended backtrace information; switch
to the libBacktraceRecording library and its APIs.  Complete the
work of adding QueueItems to Queues and allow for the QueueItems
to be interrogated about their extended backtraces in turn.

There's still cleanup and documentation to do on this code but the
code is functional and I it's a good time to get the work-in-progress 
checked in.  
<rdar://problem/15314027> 

llvm-svn: 200822
2014-02-05 05:44:54 +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
Jason Molenda 5f36c4beec Update the lldb version number in the xcode project files from 310.99.0 to 320.99.0.
llvm-svn: 198917
2014-01-10 06:12:10 +00:00
Enrico Granata b72a501d86 FormatNavigator has long stopped navigating anything - the generation of possible formatters matches is now done elsewhere
So, rename the class for what it truly is: a FormattersContainer
Also do a bunch of related text substitutions in the interest of overall naming clarity

llvm-svn: 197795
2013-12-20 09:38:13 +00:00
Greg Clayton 2553e49a5d Added missing header files to the Xcode project.
llvm-svn: 197527
2013-12-17 21:42:58 +00:00
Jason Molenda 5e8dce4dbf Add new Queue, QueueItem, Queuelist, SBQueue, SBQueueItem classes to represent
libdispatch aka Grand Central Dispatch (GCD) queues.  Still fleshing out the
documentation and testing of these but the overall API is settling down so it's
a good time to check it in.
<rdar://problem/15600370> 

llvm-svn: 197190
2013-12-13 00:29:16 +00:00
Greg Clayton d5944cd118 For logical backtrace work, lldb needs to track Module unloads etc & symoblicate an address based on a point in time
<rdar://problem/15314403> 

This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future.

llvm-svn: 196557
2013-12-06 01:12:00 +00:00
Greg Clayton 2ec3db36f5 Updated the build settings for lldb-platform and lldb-gdbserver to include libxml2.
llvm-svn: 196320
2013-12-03 21:12:28 +00:00
Greg Clayton fa3082e728 Fixed up the framework includes to all be done in the extra linker options. We had a mix where some were being included via Xcode GUI and some were done in the extra linker flags.
llvm-svn: 196309
2013-12-03 19:41:45 +00:00
Greg Clayton 5fb8f79738 Fixed internal code to not link against and code from "lldb/API/*".
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
2013-12-02 19:35:49 +00:00
Jason Molenda 906f329724 Change lldb from building against a Python framework out of
the installed SDK to using the current OS installed headers/libraries.
This change is to address the removal of the Python framework
from the Mac OS X 10.9 (Mavericks) SDK, and is the recommended
workaround via https://developer.apple.com/library/mac/technotes/tn2328/_index.html

llvm-svn: 195557
2013-11-23 20:07:29 +00:00
Greg Clayton 833d1295f9 <rdar://problem/15540233>
SBPlatform.h was missing from built LLDB.framework, now it is fixed.

llvm-svn: 195517
2013-11-22 23:32:57 +00:00
Greg Clayton be94a04055 Start the correct host abstraction of process and thread.
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
2013-11-21 18:39:32 +00:00
Greg Clayton fbb7634934 Expose SBPlatform through the public API.
Example code:

remote_platform = lldb.SBPlatform("remote-macosx"); 
remote_platform.SetWorkingDirectory("/private/tmp")
debugger.SetSelectedPlatform(remote_platform)

connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); 
err = remote_platform.ConnectRemote(connect_options)
if err.Success():
    print >> result, 'Connected to remote platform:'
    print >> result, 'hostname: %s' % (remote_platform.GetHostname())
    src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False)
    dst = lldb.SBFileSpec()
    # copy src to platform working directory since "dst" is empty
    err = remote_platform.Install(src, dst);
    if err.Success():
        print >> result, '%s installed successfully' % (src)
    else:
        print >> result, 'error: failed to install "%s": %s' % (src, err)


Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories.

The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform.

The API in SBPlatform is subject to change and will be getting many new functions.

llvm-svn: 195273
2013-11-20 21:07:01 +00:00
Jason Molenda a7b5afa91b Commit a work-in-progress system runtime for Mac OS X which won't
do anything right now.  Add a few new methods to the Thread base
class which HistoryThread needs.  I think I updated all the 
CMakeLists files correctly for the new plugin.

llvm-svn: 194756
2013-11-15 00:17:32 +00:00
Greg Clayton f74cf86bc5 <rdar://problem/15172417>
Added two new GDB server packets to debugserver: "QSaveRegisterState" and "QRestoreRegiterState".

"QSaveRegisterState" makes the remote GDB server save all register values and it returns a save identifier as an unsigned integer. This packet can be used prior to running expressions to save all registers.

All registers can them we later restored with "QRestoreRegiterState:SAVEID" what SAVEID is the integer identifier that was returned from the call to QSaveRegisterState.

Cleaned up redundant code in lldb_private::Thread, lldb_private::ThreadPlanCallFunction.
Moved the lldb_private::Thread::RegisterCheckpoint into its own header file and it is now in the lldb_private namespace. Trimmed down the RegisterCheckpoint class to omit stuff that wasn't used (the stack ID).

Added a few new virtual methods to lldb_private::RegisterContext that allow subclasses to efficiently save/restore register states and changed the RegisterContextGDBRemote to take advantage of these new calls.

llvm-svn: 194621
2013-11-13 23:28:31 +00:00
Jason Molenda fa421639de Change lldb to build without the -fobjc-gc arg.
llvm-svn: 194371
2013-11-11 10:36:54 +00:00
Jason Molenda 02706c3216 Add History subclasses for Thread, Unwind, RegisterContext.
Still working out some of the details of these classes but 
I wanted to get the overall structure checked in.
<rdar://problem/15314068> 

llvm-svn: 194245
2013-11-08 04:59:54 +00:00
Jason Molenda eef510667b Add a new system runtime plugin type - just the top level
class, not any actual plugin implementation yet.
<rdar://problem/15314068> 

llvm-svn: 194044
2013-11-05 03:57:19 +00:00
Greg Clayton 19c8e78b86 <rdar://problem/15201312>
Inlined a copy of cxa_demangle.cpp from:

http://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp

For systems that don't have demangling built into the system, and for systems that don't want to use the version that is installed. Defining LLDB_USE_BUILTIN_DEMANGLER in your build system allows you to use the built in demangler. This setting is curently automatically enabled for Windows builds.

llvm-svn: 193708
2013-10-30 18:42:59 +00:00
Greg Clayton 9b2349888f Added the ability to get the SDK path for a target using the platform plugins. If LLDB lives inside an Xcode.app bundle, it will select the SDK in the Xcode bundle, else it will use the currently selected Xcode.
Also added the DWARFDataExtractor classes to the Xcode project file.

llvm-svn: 193380
2013-10-24 22:54:08 +00:00
Jim Ingham 5010b6972c BreakpointResolverFileRegex.cpp wandered from the lldb-core target to the LLDB.framework target.
Put it back where it belongs.

llvm-svn: 192986
2013-10-18 17:05:45 +00:00
Sean Callanan 074c314ea0 Added the Windows platform to our .xcodeproj,
and alphabetized the contents of
Source:Plugins:Platform.  This fixes the Mac
OS X build.

llvm-svn: 192833
2013-10-16 19:40:50 +00:00
Greg Clayton dd88bfd092 Removed the -t options from linking flags to avoid having the linker print out all .o files it was linking with.
llvm-svn: 192372
2013-10-10 17:51:57 +00:00
Enrico Granata 4d93b8cdf3 <rdar://problem/14393032>
DumpValueObject() 2.0

This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
 When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
    1 = 2;
    2 = 3;
}

 When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
    1 = 2;
    2 = 3;
}

- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5 

On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed

Test case to follow

llvm-svn: 191694
2013-09-30 19:11:51 +00:00
Enrico Granata e2e220a805 <rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided

llvm-svn: 190564
2013-09-12 00:48:47 +00:00
Virgile Bello e2607b50ea Add OptionParser.h
llvm-svn: 190063
2013-09-05 16:42:23 +00:00
Virgile Bello f792acb20f Use <atomic> instead of "llvm/Support/Atomic.h". Removed unused RefCounter class.
llvm-svn: 190062
2013-09-05 16:38:02 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Jason Molenda 6c20dde756 Add Host/common/ProcessRunLock.cpp to the xcode project file so TOT sources build with xcode again.
llvm-svn: 189163
2013-08-24 03:42:38 +00:00
Jason Molenda 17da171f1a Bump version number to 310.99.0.
llvm-svn: 186304
2013-07-15 04:47:33 +00:00