Commit Graph

116 Commits

Author SHA1 Message Date
Robert Flack e08dc42a73 Test commit - fix typo.
llvm-svn: 230629
2015-02-26 13:03:57 +00:00
Tamas Berghammer 3c4f89d702 Add Initialize/Terminate method to Platform base plugin
Platform holds a smart pointer to each platform object created in a
static variable what cause the platform destructors called only on
program exit when other static variables are not availables. With this
change the destructors are called on lldb_private::Terminate()

+ Fix DebuggerRefCount handling in ScriptInterpreterPython

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

llvm-svn: 228944
2015-02-12 18:18:27 +00:00
Tamas Berghammer 00e305d281 Create new platform: remote-android
* Create new platform plugin for lldb
* Create HostInfo class for android
* Create ProcessLauncher for android

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

llvm-svn: 228943
2015-02-12 18:13:44 +00:00
Hafiz Abid Qadeer c4d5ed06cd Fix Mingw build.
Following changes are done.

Add missing headers.
Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC.
Add a file in the build for autoconf.
Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build.

Reviewed in http://reviews.llvm.org/D7536.

llvm-svn: 228822
2015-02-11 10:14:13 +00:00
Zachary Turner 555a7a6ad2 Add a method to disable the Windows crash / assert dialogs.
When running the test suite on Windows, we can't have Windows popping
up dialogs when LLDB crashes in native code because it will hang
the test suite.  This patch silences those dialogs by checking an
environment variable at startup and configuring Windows based on
its value.

This patch also adds an environment variable to force inferiors to
never spawn in their own console window.  This is useful to prevent
new window spawm when running the test suite.

Reviewed by: Scott Graham

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

llvm-svn: 224137
2014-12-12 18:10:52 +00:00
Jason Molenda e589e7e336 The lldb unwinder can now use the unwind information from the compact-unwind
section for x86_64 and i386 targets on Darwin systems.  Currently only the
compact unwind encoding for normal frame-using functions is supported but it
will be easy handle frameless functions when I have a bit more free time to
test it.  The LSDA and personality routines for functions are also retrieved
correctly for functions from the compact unwind section.

This new code is very fresh -- it passes the lldb testsuite and I've done
by-hand inspection of many functions and am getting correct behavior for all
of them.  There may need to be some bug fixing over the next couple weeks as
I exercise and test it further.  But I think it's fine right now so I'm
committing it.

<rdar://problem/13220837> 

llvm-svn: 223625
2014-12-08 03:09:00 +00:00
Zachary Turner cfd3b1ae6f Implement an empty DynamicLoader plugin for Windows.
llvm-svn: 223496
2014-12-05 18:45:53 +00:00
Justin Hibbits db39cdfbb7 Fix some bugs from D5988
Summary:
Ed Maste found some problems with the commit in D5988.  Address most of these.
While here, also add floating point return handling.  This doesn't handle
128-bit long double yet.  Since I don't have any system that uses it, I don't
currently have plans to implement it.

Reviewers: emaste

Reviewed By: emaste

Subscribers: emaste, lldb-commits

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

llvm-svn: 220963
2014-10-31 15:57:52 +00:00
Justin Hibbits 6256a0ea8f First cut of PowerPC(64) support in LLDB.
Summary:
This adds preliminary support for PowerPC/PowerPC64, for FreeBSD.  There are
some issues still:

 * Breakpoints don't work well on powerpc64.
 * Shared libraries don't yet get loaded for a 32-bit process on powerpc64 host.
 * Backtraces don't work.  This is due to PowerPC ABI using a backchain pointer
   in memory, instead of a dedicated frame pointer register for the backchain.
 * Breakpoints on functions without debug info may not work correctly for 32-bit
   powerpc.

Reviewers: emaste, tfiala, jingham, clayborg

Reviewed By: clayborg

Subscribers: emaste, lldb-commits

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

llvm-svn: 220944
2014-10-31 02:34:28 +00:00
Kuba Brecka afdf842b3f LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and report data extraction
Reviewed at http://reviews.llvm.org/D5592

This patch gives LLDB some ability to interact with AddressSanitizer runtime library, on top of what we already have (historical memory stack traces provided by ASan). Namely, that's the ability to stop on an error caught by ASan, and access the report information that are associated with it. The report information is also exposed into SB API.

More precisely this patch...

adds a new plugin type, InstrumentationRuntime, which should serve as a generic superclass for other instrumentation runtime libraries, these plugins get notified when modules are loaded, so they get a chance to "activate" when a specific dynamic library is loaded
an instance of this plugin type, AddressSanitizerRuntime, which activates itself when it sees the ASan dynamic library or founds ASan statically linked in the executable
adds a collection of these plugins into the Process class
AddressSanitizerRuntime sets an internal breakpoint on __asan::AsanDie(), and when this breakpoint gets hit, it retrieves the report information from ASan
this breakpoint is then exposed as a new StopReason, eStopReasonInstrumentation, with a new StopInfo subclass, InstrumentationRuntimeStopInfo
the StopInfo superclass is extended with a m_extended_info field (it's a StructuredData::ObjectSP), that can hold arbitrary JSON-like data, which is the way the new plugin provides the report data
the "thread info" command now accepts a "-s" flag that prints out the JSON data of a stop reason (same way the "-j" flag works now)
SBThread has a new API, GetStopReasonExtendedInfoAsJSON, which dumps the JSON string into a SBStream
adds a test case for all of this
I plan to also get rid of the original ASan plugin (memory history stack traces) and use an instance of AddressSanitizerRuntime for that purpose.

Kuba

llvm-svn: 219546
2014-10-10 23:43:03 +00:00
Kuba Brecka beed821ffb ASan malloc/free history threads
Reviewed at http://reviews.llvm.org/D4596

llvm-svn: 217116
2014-09-04 01:03:18 +00:00
Sean Callanan 0de7ecd346 Initialize LLVM when LLDB is initialized, and
install a crash handler.

<rdar://problem/18083226>

llvm-svn: 216309
2014-08-23 00:47:22 +00:00
Zachary Turner 673b6e4f3a Convert static constructors to be explicitly initialized at startup
llvm-svn: 216197
2014-08-21 17:57:03 +00:00
Zachary Turner 35ed13262d Teach LLDB about Windows processes.
This patch creates a simple ProcessWindows process plugin.
The only thing it knows how to do currently is create processes.

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

llvm-svn: 214094
2014-07-28 16:45:18 +00:00
Todd Fiala cfee963282 Add kalimba as a platform.
This change comprises of additions and some minor changes in order that
"kalimba" is listed as a supported platform and that debugging any
kalimbas results in PlatformKalimba being associated with the target.

The changes are as follows:

* The PlatformKalimba implementation itself
* A tweak to ArchSpec
* .note parsing for Kalimba in ObjectFileELF.cpp
* Plugin registration
* Makefile additions

Change by Matthew Gardiner

Minor tweak for cmake and Xcode by Todd Fiala

Tested:
Ubuntu 14.04 x86_64, clang 3.5-built lldb, all tests pass.
MacOSX 10.9.4, Xcode 6.0 Beta 1-built lldb, all tests pass.

llvm-svn: 213158
2014-07-16 15:03:10 +00:00
Saleem Abdulrasool 3985c8c646 sanitise sign comparisons
This is a mechanical change addressing the various sign comparison warnings that
are identified by both clang and gcc.  This helps cleanup some of the warning
spew that occurs during builds.

llvm-svn: 205390
2014-04-02 03:51:35 +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 790b4e527b Re-enable ProcessElfCore for non-FreeBSD/Linux builds; with Greg's fix in r203274
this is not installing itself for Mach-O binaries.

llvm-svn: 203310
2014-03-07 23:23:10 +00:00
Jason Molenda e4ea6f5901 Todd points out that my change to ProcessElfCore is probably
not going to key off of the ELF object file like I'd intended.
Revert my change in r203205; also revert Greg's change in
r203107 which builds ProcessElfCore on non-Linux/FreeBSD systems
for the moment until we can straighten this out.

llvm-svn: 203207
2014-03-07 06:28:29 +00:00
Greg Clayton 0e4b605e47 Re-enable the JITLoaderGDB and ProcessElfCore that were disabled by:
Author: ace2001ac
Date: Thu Mar  6 05:30:34 2014
New Revision: 203107

URL: http://llvm.org/viewvc/llvm-project?rev=203107&view=rev
Log:
Fix Windows build break introduced in r203035.

Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

Modified:
   lldb/trunk/source/lldb.cpp

Windows will need to start building all files necessary so that JITLoaderGDB and ProcessElfCore can build since they should work on all platforms.

llvm-svn: 203178
2014-03-06 23:29:58 +00:00
Ahmed Charles 943d4a6896 Fix Windows build break introduced in r203035.
Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB
and ProcessElfCore, which are only built on Linux and FreeBSD.

llvm-svn: 203107
2014-03-06 11:30:34 +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
Ed Maste 32aa12b86c Build JITLoader on FreeBSD also
llvm-svn: 202980
2014-03-05 13:57:24 +00:00
Andrew MacPherson 17220c1886 Add support for JIT debugging on Linux using the GDB JIT interface. Patch written with Keno Fischer.
llvm-svn: 202956
2014-03-05 10:12:43 +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 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
Deepak Panickal a0154f98db Patch to add PlatformWindows, based on Carlo Kok's version from the Windows branch.
llvm-svn: 192693
2013-10-15 12:32:12 +00:00
Sylvestre Ledru 6e2c7cbb26 Revert my commit 191617. It added a clang warning (Thanks to Ed Maste). Add a comment
llvm-svn: 192595
2013-10-14 14:06:28 +00:00
Sylvestre Ledru 30eff98e7e Remove useless declaration. If match_type == eNameMatchIgnore, we already left this function at the beginning of the method. Found by coverity. Fixes CID 1094188
llvm-svn: 191617
2013-09-28 15:35: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
Ashok Thirumurthi 4f01ff8bfe Re-introduces ELF core file support for Linux x86-64
Usage: 'lldb a.out -c core'.
  TODO: FreeBSD support.
  TODO: Support for AVX registers.
  TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor
  to fix the build on OS/X.

llvm-svn: 186516
2013-07-17 16:06:12 +00:00
Greg Clayton 3deb0e7ca5 Revert the ELF core file support until a few things can be worked out:
RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has:

   ProcessMonitor &GetMonitor();

This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does:

ProcessMonitor &
RegisterContext_x86_64::GetMonitor()
{
   ProcessSP base = CalculateProcess();
   ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get());
   return process->GetMonitor();
}

ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files.

Suggested cleanups:
- Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. 

llvm-svn: 186223
2013-07-12 22:52:22 +00:00
Ashok Thirumurthi c037383aff Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.
TODO: Support for RegisterContext_x86_64::ReadFPR.

Patch by Samuel Jacob!

llvm-svn: 186207
2013-07-12 21:25:02 +00:00
Michael Sartain a7499c9830 Split symbol support for ELF and Linux.
llvm-svn: 185366
2013-07-01 19:45:50 +00:00
Jason Molenda 90e536caf7 Remove the initialization/termination of the now-removed OperatingSystemDarwinKernel.
llvm-svn: 180994
2013-05-03 03:55:48 +00:00
Jason Molenda 1c627543f1 Add a new PlatformDarwinKernel for kernel debugging. This Platform
plugin will index the kext bundles on the local filesystem when
created.  During a kernel debug session, when the DynamicLoader
plugin needs to locate a kext by name like
"com.apple.com.apple.filesystems.autofs", the Platform can quickly
look for a UUID match in those kernel debug kit directories it
previously indexed.

I'm still working on profiling the performance impact of the inital
kext bundle scan; there will likely need to be a switch to enable
or disable this plugin's scan.

This only affects Mac kernel debugging and the code is only built
on Apple systems because of some use of low-level CoreFoundation
to parse plists.

<rdar://problem/13503583> 

llvm-svn: 178827
2013-04-05 01:03:25 +00:00
Sean Callanan 3d27e6603a Updated Apple LLDB version to lldb-300.99.0. Also
updated the build system to support the new Apple
LLDB versioning scheme.

llvm-svn: 176662
2013-03-07 22:29:06 +00:00
Greg Clayton 7170f3fc54 Made lldb.cpp build with clang 5.0.
Also removed the use of llvm::raw_string_ostream as it wasn't needed. 

Also fixed a crasher that could occur when the following line returned a C string tied to a local variable:

    return OS.str().c_str();

I am guessing "static std::string buf;" was supposed to get assigned to "OS.str()" and then have "buf.c_str()" returned. 

Modified the non-apple version code to cache its value and not recompute the version every time.

llvm-svn: 176274
2013-02-28 18:09:18 +00:00
Daniel Malea 3b92f0095e Remove LLDB dependency on xcodeworkspace (on Linux) for version number
- make LLDB version number match Clang (and the Debian package)
- use the same revision detection magic that Clang uses to report SVN/Git revisions
- update test case as per above

Example output:

  $ lldb -v
  lldb version 3.3 (https://dmalea@llvm.org/svn/llvm-project/lldb/trunk revision 176211 clang revision 176208 llvm revision 176208)
ss

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

M    source/lldb.cpp
M    test/help/TestHelp.py
M    source/Makefile

llvm-svn: 176268
2013-02-28 16:51:15 +00:00
Daniel Malea 97059d4377 Enable ProcessGDBRemote plugin on Linux
- Fixes test case TestConnectRemote

llvm-svn: 171855
2013-01-08 14:55:36 +00:00
Andrew Kaylor 7b6376ba57 Enabling ItaniumABILanguageRuntime and SymbolFileDWARFDebugMap plugins on non-Apple platforms.
llvm-svn: 170241
2012-12-14 21:03:37 +00:00
Sean Callanan 2dd8b49d05 Rmoved the old LLVM disassembler based on libedis.
llvm-svn: 170171
2012-12-14 01:29:59 +00:00
Daniel Malea 89660bf795 More Linux warnings fixes (remove default labels as needed):
- as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

Patch by Matt Kopec!

llvm-svn: 169633
2012-12-07 20:51:09 +00:00
Daniel Malea 93a64300f8 Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!

llvm-svn: 169341
2012-12-05 00:20:57 +00:00
Greg Clayton b3e776008b Added a hollowed out version of an OperatingSystem plugin that will use a class in python to get thread information for threads stored in memory.
llvm-svn: 162472
2012-08-23 21:17:11 +00:00
Jason Molenda 382dcfda20 Register the ProcessGDBRemote plugin ahead of the ProcessKDP plugin
so a process connect without any plugin specified picks up the 
gdb-remote plugin by default.

llvm-svn: 157792
2012-06-01 01:39:46 +00:00
Johnny Chen 7b9f93a186 Patch from Viktor Kutuzov <vkutuzov@accesssoftek.com>:
Hello everyone,
 
please find the attached patch for TOT and lldb-platform-work branch, which provides the following changes:
 - fixed a crash in the ProcessPOSIX constructor when an executable module object is not yet created.
 - added support for the multi instanciated FreeBSD platform objects (the local host and remote as example).
 - enabled the remote gdb plugin on FreeBSD.

llvm-svn: 154724
2012-04-14 00:54:42 +00:00
Bill Wendling e50ab408e5 Revert r154086. It may be needed for Darwin. But the symbols are still missing in the dylib.
llvm-svn: 154108
2012-04-05 17:38:07 +00:00
Bill Wendling e914660c0d The DynamicLoaderPOSIXDYLD calls aren't available on Apple systems.
llvm-svn: 154086
2012-04-05 06:21:02 +00:00
Greg Clayton f8712de58c Since we are having issues with the new LLVM MC disassembler, we can have
them both installed with the LLVM MC version being the default. I renamed the
name of the LLVM MC disassembler plug-in to "llvm-mc" and the LLVM enhanced
disassembly plug-in to "llvm-edis" and they can both be installed for now.

To use the "llvm-edis" disassembler, you can just specify it while disassembling:

(lldb) disassemble --plugin llvm-edis --name main
(lldb) disassemble --plugin llvm-mc --name main

This will allow us to compare the output of the two disassembler and eventually
deprecate the old one when the new one is ready. But it does use the new disassembler
by default so we continue to test it on a daily basis.

llvm-svn: 153231
2012-03-22 00:49:15 +00:00