summaryrefslogtreecommitdiffstats
path: root/lldb/source/lldb.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Remove Apple-specific version logic.Frederic Riss2019-04-171-4/+0
| | | | | | | | | | | | We were using the LLDB-Info.plist as the canonical holder of the version number, but there is really no good reason to do this. If anything the plist should be generated using the information provided to CMake. For now just remove the logic extracting the version from the plist and rely on LLDB_VERSION_STRING. llvm-svn: 358604
* [CMake] Unify scripts for generating VCS headersPetr Hosek2019-02-061-2/+2
| | | | | | | | | | | | | | | | | Previously, there were two different scripts for generating VCS headers: one used by LLVM and one used by Clang and lldb. They were both similar, but different. They were both broken in their own ways, for example the one used by Clang didn't properly handle monorepo resulting in an incorrect version information reported by Clang. This change unifies two the scripts by introducing a new script that's used from both LLVM, Clang and lldb, ensures that the new script supports both monorepo and standalone SVN and Git setups, and removes the old scripts. Differential Revision: https://reviews.llvm.org/D57063 llvm-svn: 353268
* Revert "[CMake] Unify scripts for generating VCS headers"Petr Hosek2019-01-311-1/+4
| | | | | | This reverts commits r352729 and r352731: this broke Sanitizer Windows bots llvm-svn: 352733
* [CMake] Migrate lldb to the new VCS scriptPetr Hosek2019-01-311-4/+1
| | | | | | This was accidentaly omitted from r352729 and broke lldb bots. llvm-svn: 352731
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Run clang-format on lldb.cppStephane Sezer2017-11-021-4/+2
| | | | llvm-svn: 317219
* Use LLVM version stringStephane Sezer2017-11-021-5/+1
| | | | | | | | | | | | | | | | | | | | Summary: macOS builds of LLDB use the bundle version from `tools/driver/lldb-Info.plist`. That file hasn't been updated since the 4.0 release so the version we print provides no value. I also think that even if it were up to date, that number has no meaning and displaying the version from the LLVM tree is more valuable. I know that Apple folks have some form of override for the clang version to match the Xcode version, so it'd make sense for them to do the same for LLDB. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39429 llvm-svn: 317218
* One more cleanup to lldb version printingChris Bieneman2016-11-141-13/+14
| | | | | | | | | | With this patch LLDB_VERSION_STRING replaces "lldb version x.x.x" if it is set. This allows builds to not display the open source version numbers if the people making the distribution overrides the LLDB_VERSION_STRING. Since LLDB_VERSION_STRING is always overridden on Darwin, this means the first line of lldb -version on Darwin is: lldb-360.99.0 (<repo path> revision <revision>) llvm-svn: 286899
* Fixing the Xcode build that I broke in r286479Chris Bieneman2016-11-101-1/+4
| | | | | | Since Xcode can't seem to handle quotes in preprocessor definitions, I've changed the build to assume that the define is unquoted. This should fix the failing Darwin bots. llvm-svn: 286504
* Unify Darwin and Non-Darwin printing of version outputChris Bieneman2016-11-101-35/+13
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change unifies and simplifies the code paths between the Darwin and non-Darwin code to print the LLDB version information. It also introduces a new variable in CMake LLDB_VERSION_STRING which can be used to specify custom version information. On Darwin this value is implicitly set based on the resource/LLDB-Info.plist file. With the LLDB_VERSION_STRING variable set to lldb-360.99.0, the -version output is: > ./bin/lldb -version lldb version 4.0.0 (lldb-360.99.0) clang revision 286264 llvm revision 286265 This behavior is unified across all target platforms. Reviewers: lldb-commits Subscribers: mgorny, tfiala Differential Revision: https://reviews.llvm.org/D26478 llvm-svn: 286479
* [CMake] Generate LLDB_REVISION at build timeChris Bieneman2016-09-231-0/+4
| | | | | | | | | | | | | | | | | | Summary: This alters the generation of LLDB_REVISION to be heavily based on how clang generates its version header. There are two benefits of this aproach. (1) The LLDB_REVISION is generated at build time, so it will be updated after an SCM pull/update even if CMake doesn't re-run (2) This works on Windows As noted this code is a simplified implementation of the code from clang. Reviewers: tfiala, zturner Subscribers: beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D24846 llvm-svn: 282314
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-71/+61
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Add more NetBSD platform glue for lldbBruce Mitchener2015-11-071-1/+1
| | | | | | | | | | | | | | | | | | Summary: These changes are still incomplete, but we are almost there. Changes: - CMake and gmake code - SWIG code - minor code additions Reviewers: emaste, joerg Subscribers: youri, akat1, brucem, lldb-commits, joerg Differential Revision: http://reviews.llvm.org/D14042 llvm-svn: 252403
* 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
OpenPOWER on IntegriCloud