summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBDebugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* second pass over removal of Mutex and ConditionSaleem Abdulrasool2016-05-191-4/+4
| | | | llvm-svn: 270024
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-2/+2
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-071-3/+3
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Add API to support retrieving the formatters category for a specific languageEnrico Granata2015-12-181-0/+10
| | | | llvm-svn: 256033
* Fix Clang-tidy modernize-use-nullptr warnings in include/lldb/API and ↵Eugene Zelenko2015-10-311-134/+92
| | | | | | | | source/API; other minor fixes. Other fixes should reduce number of readability-redundant-smartptr-get and readability-implicit-bool-cast. llvm-svn: 251733
* Fix an error message (the debugger was invalid, not the target.)Jim Ingham2015-10-301-1/+1
| | | | llvm-svn: 251720
* Rationalization of includes in the data formatters codeEnrico Granata2015-10-201-0/+1
| | | | llvm-svn: 250798
* Added support for the "--repl" argument to LLDB. Sean Callanan2015-10-201-0/+11
| | | | | | | | | This makes LLDB launch and create a REPL, specifying no target so that the REPL can create one for itself. Also added the "--repl-language" option, which specifies the language to use. Plumbed the relevant arguments and errors through the REPL creation mechanism. llvm-svn: 250773
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Rework LLDB system initialization.Zachary Turner2015-03-311-28/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move LLDB initialization/shutdown to Initialization.Zachary Turner2015-03-191-3/+3
| | | | | | | | | | | | | | | | 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
* Fixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the ↵Greg Clayton2014-11-131-6/+3
| | | | | | | | | | | | | | same semantics as other SBDebugger::CreateTarget() functions. The issues were: - If you called this function with any arch other than the default target architecture, creating the target would fail because the Target::GetDefaultArchitecture() would not match the single architecture in the file specified. This caused running the test suite remotely with lldb-platform to fail many many tests due to the bad target. - It would specify the currently selected platform which might not work for the specified platform All other SBDebugger::CreateTarget calls do not assume an architecture or platform and if they aren't specified, they don't auto select the wrong one for you. With this fix, SBTarget SBDebugger::CreateTarget (const char *filename) now behaves like the other SBDebugger::CreateTarget() variants. llvm-svn: 221908
* This adds a "batch mode" to lldb kinda like the gdb batch mode. It will ↵Jim Ingham2014-10-141-1/+3
| | | | | | | | | | | | | | | | quit the debugger after all the commands have been executed except if one of the commands was an execution control command that stopped because of a signal or exception. Also adds a variant of SBCommandInterpreter::HandleCommand that takes an SBExecutionContext. That way you can run an lldb command targeted at a particular target, thread or process w/o having to select same before running the command. Also exposes CommandInterpreter::HandleCommandsFromFile to the SBCommandInterpreter API, since that seemed generally useful. llvm-svn: 219654
* Rework the way we pass "run multiple command" options to the various API's thatJim Ingham2014-10-111-1/+24
| | | | | | | | | | | | | | | do that (RunCommandInterpreter, HandleCommands, HandleCommandsFromFile) to gather the options into an options class. Also expose that to the SB API's. Change the way the "-o" options to the lldb driver are processed so: 1) They are run synchronously - didn't really make any sense to run the asynchronously. 2) The stop on error 3) "quit" in one of the -o commands will not quit lldb - not the command interpreter that was running the -o commands. I added an entry to the run options to stop-on-crash, but I haven't implemented that yet. llvm-svn: 219553
* Revert r219102 as it caused significant buildbot breakageEd Maste2014-10-061-4/+0
| | | | llvm-svn: 219120
* Call SBDebugger::Initialize/Terminate from within Create/Destroy.Matthew Gardiner2014-10-061-0/+4
| | | | | | | The above change permits developers using the lldb C++ API to code applications in a more logical manner. llvm-svn: 219102
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-6/+29
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* Update LLDB to use LLVM's DynamicLibrary.Zachary Turner2014-08-271-7/+8
| | | | | | | | | LLDB had implemented its own DynamicLibrary class for plugin support. LLVM has an equivalent mechanism, so this patch deletes the duplicated code in LLDB and updates LLDB to reference the mechanism provided by LLVM. llvm-svn: 216606
* Don't allow two threads to both be in SBDebugger::Create() due to threading ↵Greg Clayton2014-05-191-0/+9
| | | | | | | | issues in FormatManager. <rdar://problem/16937126> llvm-svn: 209160
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-62/+67
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-56/+56
| | | | | | | | | | | | 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
* Fixed internal code to not link against and code from "lldb/API/*". Greg Clayton2013-12-021-1/+37
| | | | | | | | | | 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
* Expose SBPlatform through the public API.Greg Clayton2013-11-201-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Avoid ambiguity between pid_t and lldb::pid_t.Virgile Bello2013-09-051-1/+1
| | | | llvm-svn: 190066
* MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello2013-08-231-1/+1
| | | | | | portability. llvm-svn: 189107
* Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors ↵Michael Sartain2013-05-231-0/+16
| | | | | | | | | | command line options. settings set use-color [false|true] settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} " also "--no-use-colors" on the command prompt llvm-svn: 182609
* <rdar://problem/13521159>Greg Clayton2013-03-271-24/+24
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* <rdar://problem/12978143>Enrico Granata2013-01-281-1/+1
| | | | | | | | | | | Data formatters now cache themselves. This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval. Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization. The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime. Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type. Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose. llvm-svn: 173728
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - 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
* Save and restore terminal state when lldb is suspended with SIGTSTP and ↵Jim Ingham2012-11-301-0/+14
| | | | | | | | | resumed with SIGCONT. Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms. I didn't try to replicate that. llvm-svn: 169032
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-2/+2
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* <rdar://problem/12462048>Greg Clayton2012-10-181-9/+5
| | | | | | | | | | <rdar://problem/12068650> More fixes to how we handle paths that are used to create a target. This modification centralizes the location where and how what the user specifies gets resolved. Prior to this fix, the TargetList::CreateTarget variants took a FileSpec object which meant everyone had the opportunity to resolve the path their own way. Now both CreateTarget variants take a "const char *use_exe_path" which allows the TargetList::CreateTarget to centralize where the resolving happens and "do the right thing". llvm-svn: 166186
* Ran the sources through the compiler with -Wshadow warningsJason Molenda2012-10-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. <rdar://problem/12437585> llvm-svn: 165269
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-2/+5
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* Fixing a constness issue in an otherwise trivial patchEnrico Granata2012-09-061-1/+1
| | | | llvm-svn: 163352
* Restoring an API as deprecated which was removed in a previous commitEnrico Granata2012-09-061-0/+6
| | | | llvm-svn: 163351
* Remove further outdated "settings" code and also implement a few missing things.Greg Clayton2012-08-221-37/+44
| | | | llvm-svn: 162376
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-32/+36
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* A baton isn't needed to dispatch input.Filipe Cabecinhas2012-08-201-3/+3
| | | | | | I also added a typemap to make DispatchInput usable in Python. llvm-svn: 162204
* Add API logging for SBDebugger::MemoryPressureDetected.Jim Ingham2012-06-071-0/+7
| | | | llvm-svn: 158159
* Print out a notification when the process of a target other than the ↵Jim Ingham2012-05-081-0/+14
| | | | | | currently selected target stops. llvm-svn: 156433
* <rdar://problem/11338654> Fixing a bug where having a summary for a bitfield ↵Enrico Granata2012-05-081-57/+9
| | | | | | without a format specified would in certain cases crash LLDB - This has also led to refactoring the by-type accessors for the data formatter subsystem. These now belong in our internal layer, and are just invoked by the public API stratum llvm-svn: 156429
* <rdar://problem/11358639>Greg Clayton2012-05-081-1/+1
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Don't expose the pthread_mutex_t underlying the Mutex & Mutex::Locker classes. Jim Ingham2012-05-041-2/+2
| | | | | | | | | | | | | No one was using it and Locker(pthread_mutex_t *) immediately asserts for pthread_mutex_t's that don't come from a Mutex anyway. Rather than try to make that work, we should maintain the Mutex abstraction and not pass around the platform implementation... Make Mutex::Locker::Lock take a Mutex & or a Mutex *, and remove the constructor taking a pthread_mutex_t *. You no longer need to call Mutex::GetMutex to pass your mutex to a Locker (you can't in fact, since I made it private.) llvm-svn: 156221
* No functionality changes, mostly cleanup.Greg Clayton2012-04-111-2/+2
| | | | | | | | Cleaned up the Mutex::Locker and the ReadWriteLock classes a bit. Also cleaned up the GDBRemoteCommunication class to not have so many packet functions. Used the "NoLock" versions of send/receive packet functions when possible for a bit of performance. llvm-svn: 154458
* <rdar://problem/11202426> Greg Clayton2012-04-091-2/+8
| | | | | | Work around a deadlocking issue where "SBDebugger::MemoryPressureDetected ()" is being called and is causing a deadlock. We now just try and get the lock when trying to trim down the unique modules so we don't deadlock debugger GUI programs until we can find the root cause. llvm-svn: 154339
* Platforms can now auto-select themselves if you specify a full target triple ↵Greg Clayton2012-03-201-1/+2
| | | | | | | | when doing a "target create" command. Each platform now knows if it can handle an architecture and a platform can be found using an architecture. Each platform can look at the arch, vendor and OS and know if it should be used or not. llvm-svn: 153104
* Make Debugger::SetLoggingCallback public, and expose it through the SB API. ↵Jim Ingham2012-02-221-0/+11
| | | | | | | | Sometimes it is not convenient to provide a log callback right when the debugger is created. llvm-svn: 151209
* Patch Enrico's changes from r150558 on 2012-02-14 to build even if PythonJason Molenda2012-02-211-0/+4
| | | | | | | | | | | | is not available (LLDB_DISABLE_PYTHON is defined). Change build-swig-Python.sh to emit an empty LLDBPythonWrap.cpp file if this build is LLDB_DISABLE_PYTHON. Change the "Copy to Xcode.app" shell script phase in the lldb.xcodeproj to only do this copying for Mac native builds. llvm-svn: 151035
* Add a logging mode that takes a callback and flush'es to that callback.Jim Ingham2012-02-211-2/+22
| | | | | | Also add SB API's to set this callback, and to enable the log channels. llvm-svn: 151018
OpenPOWER on IntegriCloud