summaryrefslogtreecommitdiffstats
path: root/lldb/source/lldb.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move LLDB initialization/shutdown to Initialization.Zachary Turner2015-03-191-361/+0
| | | | | | | | | | | | | | | | 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
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-181-94/+0
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-181-1/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Initial Assembly profiler for mips64Bhushan D. Attarde2015-03-181-0/+3
| | | | | | | | | | | Summary: This is initial implementation of assembly profiler which only scans prologue/epilogue assembly instructions to create CFI instructions. Reviewers: clayborg, jasonmolenda Differential Revision: http://reviews.llvm.org/D7696 llvm-svn: 232619
* Clean up includes in source/lldb.cpp (1 was unused, 1 duplicated)Ilia K2015-03-121-2/+0
| | | | llvm-svn: 232059
* Initialize ProcessGDBRemoteLog for LLGS to fix remote platform loggingRobert Flack2015-03-111-1/+8
| | | | | | | | This was previously initialized by ProcessGDBRemote::Initialize but lldb-server does not contain ProcessGDBRemote anymore so this needs to be initialized directly. Differential Revision: http://reviews.llvm.org/D8186 llvm-svn: 231966
* Reduce the number of components initialized for LLGS further.Robert Flack2015-03-111-26/+27
| | | | | | | | In http://reviews.llvm.org/D7880 the initialization for LLGS was separated out so that LLGS could initialize only the components it needs to. This further reduces the set of components initialized for LLGS. Differential Revision: http://reviews.llvm.org/D8112 llvm-svn: 231964
* Add Debugger::InitializeForLLGS to allow ref counted LLGS initialization.Robert Flack2015-03-101-70/+79
| | | | | | | | | | | | | | After http://reviews.llvm.org/D8133 landed as r231550 process launch on remote platform stopped working. This adds Debugger::InitializeForLLGS and tracks whether one or both of Initialize and InitializeForLLGS have been called, calling only the corresponding lldb_private::Terminate* methods as necessary. Since lldb_private::Terminate calls lldb_private::TerminateForLLGS, the latter method may be called twice if Initialize was called for both however the terminate methods ensure they are only called once after being initialized. This still maintains the reduced binary size, though it does now technically link in lldb_private::Terminate on lldb-server even though this should never be called. This should resolve the issue raised in http://reviews.llvm.org/D8133 where Debugger::Terminate assumed that there were 0 references to debugger and terminated early. Differential Revision: http://reviews.llvm.org/D8183 llvm-svn: 231808
* Move Python Init from InitializeForLLGS to InitializeVince Harron2015-03-071-8/+11
| | | | | | | | | | | | | | | Linux configure+make builds have ~175 tests failing that aren't failing in cmake builds. The tests have error messages like "'a.out' doesn't contain the architecture x86-64" ObjectFileELF plugin wasn't loaded when this message was output. I found ScriptInterpreterPython::InitializePrivate() is calling Debugger::Terminate(), which terminates ObjectFileELF (and lots of other stuff) setup earlier in the InitializeForLLGS. So I moved python Init/Term from Init/TermForLLGS to Init/Term llvm-svn: 231550
* Reduce the number of components initialized by lldb-server to reduce static ↵Robert Flack2015-03-021-75/+108
| | | | | | | | | | binary size. Separate out the necessary component initialization for lldb-server such that the linker can greatly reduce the binary size. With this patch the size of lldb-server on my 64 bit linux release build drops from 46MB to 26MB. Differential Revision: http://reviews.llvm.org/D7880 llvm-svn: 230963
* Fix FileSpec::GetPath to return null-terminated stringsIlia K2015-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end. It could have happened if the size of buffer for path was less than actual path. Test case: ``` FileSpec test("/path/to/file", false); char buf[]="!!!!!!"; test.GetPath(buf, 3); ``` Before fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/pa!!!" ``` After fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/p" ``` Reviewers: zturner, abidh, clayborg Reviewed By: abidh, clayborg Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh Differential Revision: http://reviews.llvm.org/D7553 llvm-svn: 230787
* Test commit - fix typo.Robert Flack2015-02-261-1/+1
| | | | llvm-svn: 230629
* Add Initialize/Terminate method to Platform base pluginTamas Berghammer2015-02-121-0/+1
| | | | | | | | | | | | | 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
* Create new platform: remote-androidTamas Berghammer2015-02-121-0/+3
| | | | | | | | | | * 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
* Fix Mingw build.Hafiz Abid Qadeer2015-02-111-2/+2
| | | | | | | | | | | | | 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
* Add a method to disable the Windows crash / assert dialogs.Zachary Turner2014-12-121-0/+20
| | | | | | | | | | | | | | | | | | 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
* The lldb unwinder can now use the unwind information from the compact-unwind Jason Molenda2014-12-081-0/+1
| | | | | | | | | | | | | | | | | | 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
* Implement an empty DynamicLoader plugin for Windows.Zachary Turner2014-12-051-0/+6
| | | | llvm-svn: 223496
* Fix some bugs from D5988Justin Hibbits2014-10-311-0/+1
| | | | | | | | | | | | | | | | | | 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
* First cut of PowerPC(64) support in LLDB.Justin Hibbits2014-10-311-0/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* LLDB AddressSanitizer instrumentation runtime plugin, breakpint on error and ↵Kuba Brecka2014-10-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* ASan malloc/free history threadsKuba Brecka2014-09-041-0/+3
| | | | | | Reviewed at http://reviews.llvm.org/D4596 llvm-svn: 217116
* Initialize LLVM when LLDB is initialized, andSean Callanan2014-08-231-1/+16
| | | | | | | | install a crash handler. <rdar://problem/18083226> llvm-svn: 216309
* Convert static constructors to be explicitly initialized at startupZachary Turner2014-08-211-0/+2
| | | | llvm-svn: 216197
* Teach LLDB about Windows processes.Zachary Turner2014-07-281-0/+7
| | | | | | | | | 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
* Add kalimba as a platform.Todd Fiala2014-07-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 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
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-1/+2
| | | | | | | | 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
* lldb arm64 import.Jason Molenda2014-03-291-0/+7
| | | | | | | | | | | | | | | | 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
* Re-enable ProcessElfCore for non-FreeBSD/Linux builds; with Greg's fix in ↵Jason Molenda2014-03-071-4/+0
| | | | | | | | r203274 this is not installing itself for Mach-O binaries. llvm-svn: 203310
* Todd points out that my change to ProcessElfCore is probablyJason Molenda2014-03-071-0/+4
| | | | | | | | | 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
* Re-enable the JITLoaderGDB and ProcessElfCore that were disabled by:Greg Clayton2014-03-061-5/+1
| | | | | | | | | | | | | | | | | | | | 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
* Fix Windows build break introduced in r203035.Ahmed Charles2014-03-061-1/+5
| | | | | | | Add '#if defined(__linux__) || defined(__FreeBSD__)' around JITLoaderGDB and ProcessElfCore, which are only built on Linux and FreeBSD. llvm-svn: 203107
* Moved JITLoader.cpp and JITLoaderList.cpp over into "source/Target" since ↵Greg Clayton2014-03-061-23/+18
| | | | | | | | 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
* Build JITLoader on FreeBSD alsoEd Maste2014-03-051-3/+3
| | | | llvm-svn: 202980
* Add support for JIT debugging on Linux using the GDB JIT interface. Patch ↵Andrew MacPherson2014-03-051-0/+3
| | | | | | written with Keno Fischer. llvm-svn: 202956
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-0/+2
| | | | | | | | | | | | 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
* Commit a work-in-progress system runtime for Mac OS X which won'tJason Molenda2013-11-151-0/+3
| | | | | | | | 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
* Patch to add PlatformWindows, based on Carlo Kok's version from the Windows ↵Deepak Panickal2013-10-151-4/+6
| | | | | | branch. llvm-svn: 192693
* Revert my commit 191617. It added a clang warning (Thanks to Ed Maste). Add ↵Sylvestre Ledru2013-10-141-0/+2
| | | | | | a comment llvm-svn: 192595
* Remove useless declaration. If match_type == eNameMatchIgnore, we already ↵Sylvestre Ledru2013-09-281-2/+0
| | | | | | left this function at the beginning of the method. Found by coverity. Fixes CID 1094188 llvm-svn: 191617
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Re-introduces ELF core file support for Linux x86-64Ashok Thirumurthi2013-07-171-1/+12
| | | | | | | | | | 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
* Revert the ELF core file support until a few things can be worked out:Greg Clayton2013-07-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.Ashok Thirumurthi2013-07-121-1/+4
| | | | | | | | TODO: Support for RegisterContext_x86_64::ReadFPR. Patch by Samuel Jacob! llvm-svn: 186207
* Split symbol support for ELF and Linux.Michael Sartain2013-07-011-0/+7
| | | | llvm-svn: 185366
* Remove the initialization/termination of the now-removed ↵Jason Molenda2013-05-031-3/+0
| | | | | | OperatingSystemDarwinKernel. llvm-svn: 180994
* Add a new PlatformDarwinKernel for kernel debugging. This PlatformJason Molenda2013-04-051-0/+3
| | | | | | | | | | | | | | | | | | | | | 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
* Updated Apple LLDB version to lldb-300.99.0. AlsoSean Callanan2013-03-071-3/+18
| | | | | | | updated the build system to support the new Apple LLDB versioning scheme. llvm-svn: 176662
* Made lldb.cpp build with clang 5.0. Greg Clayton2013-02-281-45/+57
| | | | | | | | | | | | | | 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
* Remove LLDB dependency on xcodeworkspace (on Linux) for version numberDaniel Malea2013-02-281-0/+55
| | | | | | | | | | | | | | | | | | | | - 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
OpenPOWER on IntegriCloud