summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBDebugger.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add 'lldb_private' namespace where necessary to prevent ambiguity andCaroline Tice2011-04-251-3/+3
| | | | | | resulting infinite loops. llvm-svn: 130159
* Fixed an issue where if you specify an architecture from the command line like:Greg Clayton2011-04-181-43/+47
| | | | | | | | | | $ lldb --arch i386-unknown-unknown a.out It would then create a target with only the "i386" part due to SBDebugger::GetDefaultArchitecture(...) truncating the arch triple due to the way things used to be. llvm-svn: 129731
* Modified the ArchSpec to take an optional "Platform *" when setting the triple.Greg Clayton2011-04-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to have a platform selected, then specify a triple using "i386" and have the remaining triple items (vendor, os, and environment) set automatically. Many interpreter commands take the "--arch" option to specify an architecture triple, so now the command options needed to be able to get to the current platform, so the Options class now take a reference to the interpreter on construction. Modified the build LLVM building in the Xcode project to use the new Xcode project level user definitions: LLVM_BUILD_DIR - a path to the llvm build directory LLVM_SOURCE_DIR - a path to the llvm sources for the llvm that will be used to build lldb LLVM_CONFIGURATION - the configuration that lldb is built for (Release, Release+Asserts, Debug, Debug+Asserts). I also changed the LLVM build to not check if "lldb/llvm" is a symlink and then assume it is a real llvm build directory versus the unzipped llvm.zip package, so now you can actually have a "lldb/llvm" directory in your lldb sources. llvm-svn: 129112
* Fixed the LLDB build so that we can have private types, private enums andGreg Clayton2011-03-241-3/+6
| | | | | | | | public types and public enums. This was done to keep the SWIG stuff from parsing all sorts of enums and types that weren't needed, and allows us to abstract our API better. llvm-svn: 128239
* Abtracted the innards of lldb-core away from the SB interface. There was someGreg Clayton2011-03-221-0/+2
| | | | | | | | | | | | | | | | overlap in the SWIG integration which has now been fixed by introducing callbacks for initializing SWIG for each language (python only right now). There was also a breakpoint command callback that called into SWIG which has been abtracted into a callback to avoid cross over as well. Added a new binary: lldb-platform This will be the start of the remote platform that will use as much of the Host functionality to do its job so it should just work on all platforms. It is pretty hollowed out for now, but soon it will implement a platform using the GDB remote packets as the transport. llvm-svn: 128053
* LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provideGreg Clayton2011-03-081-31/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an interface to a local or remote debugging platform. By default each host OS that supports LLDB should be registering a "default" platform that will be used unless a new platform is selected. Platforms are responsible for things such as: - getting process information by name or by processs ID - finding platform files. This is useful for remote debugging where there is an SDK with files that might already or need to be cached for debug access. - getting a list of platform supported architectures in the exact order they should be selected. This helps the native x86 platform on MacOSX select the correct x86_64/i386 slice from universal binaries. - Connect to remote platforms for remote debugging - Resolving an executable including finding an executable inside platform specific bundles (macosx uses .app bundles that contain files) and also selecting the appropriate slice of universal files for a given platform. So by default there is always a local platform, but remote platforms can be connected to. I will soon be adding a new "platform" command that will support the following commands: (lldb) platform connect --name machine1 macosx connect://host:port Connected to "machine1" platform. (lldb) platform disconnect macosx This allows LLDB to be well setup to do remote debugging and also once connected process listing and finding for things like: (lldb) process attach --name x<TAB> The currently selected platform plug-in can now auto complete any available processes that start with "x". The responsibilities for the platform plug-in will soon grow and expand. llvm-svn: 127286
* Abtracted all mach-o and ELF out of ArchSpec. This patch is a modified formGreg Clayton2011-02-231-29/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of Stephen Wilson's idea (thanks for the input Stephen!). What I ended up doing was: - Got rid of ArchSpec::CPU (which was a generic CPU enumeration that mimics the contents of llvm::Triple::ArchType). We now rely upon the llvm::Triple to give us the machine type from llvm::Triple::ArchType. - There is a new ArchSpec::Core definition which further qualifies the CPU core we are dealing with into a single enumeration. If you need support for a new Core and want to debug it in LLDB, it must be added to this list. In the future we can allow for dynamic core registration, but for now it is hard coded. - The ArchSpec can now be initialized with a llvm::Triple or with a C string that represents the triple (it can just be an arch still like "i386"). - The ArchSpec can still initialize itself with a architecture type -- mach-o with cpu type and subtype, or ELF with e_machine + e_flags -- and this will then get translated into the internal llvm::Triple::ArchSpec + ArchSpec::Core. The mach-o cpu type and subtype can be accessed using the getter functions: uint32_t ArchSpec::GetMachOCPUType () const; uint32_t ArchSpec::GetMachOCPUSubType () const; But these functions are just converting out internal llvm::Triple::ArchSpec + ArchSpec::Core back into mach-o. Same goes for ELF. All code has been updated to deal with the changes. This should abstract us until later when the llvm::TargetSpec stuff gets finalized and we can then adopt it. llvm-svn: 126278
* Use Host::File in lldb_private::StreamFile and other places to cleanup hostGreg Clayton2011-02-091-3/+3
| | | | | | layer a bit more. llvm-svn: 125149
* Add API and implementation for SBDebugger::Destroy and Debugger::Destroy.Caroline Tice2011-01-221-0/+18
| | | | llvm-svn: 124011
* The LLDB API (lldb::SB*) is now thread safe!Greg Clayton2010-12-201-109/+64
| | | | llvm-svn: 122262
* Patch from Stephen Wilson:Johnny Chen2010-12-201-1/+1
| | | | | | Fix a typo where a qualification was being interpreted as a label. llvm-svn: 122260
* Add code to make sure InputReaders finish and are cleaned up whenCaroline Tice2010-12-201-0/+3
| | | | | | | | a Debugger object is destroyed or re-set. (Thus making sure that, for example, the Python interpreter finishes and exits cleanly rather than being left in an undefined state.) llvm-svn: 122255
* Add the ability to catch and do the right thing with Interrupts (often ↵Caroline Tice2010-11-191-0/+22
| | | | | | | | control-c) and end-of-file (often control-d). llvm-svn: 119837
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-061-17/+17
| | | | | | | | | | | don't crash if we disable logging when some code already has a copy of the logger. Prior to this fix, logs were handed out as pointers and if they were held onto while a log got disabled, then it could cause a crash. Now all logs are handed out as shared pointers so this problem shouldn't happen anymore. We are also using our new shared pointers that put the shared pointer count and the object into the same allocation for a tad better performance. llvm-svn: 118319
* Added copy constructors and assignment operators to all lldb::SB* classesGreg Clayton2010-11-051-1/+16
| | | | | | so we don't end up with weak exports with some compilers. llvm-svn: 118312
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-311-13/+13
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Improved API logging.Greg Clayton2010-10-301-15/+28
| | | | llvm-svn: 117772
* Modified the lldb_private::TypeList to use a std::multimap for quicker lookupGreg Clayton2010-10-291-23/+13
| | | | | | | | | | by type ID (the most common type of type lookup). Changed the API logging a bit to always show the objects in the OBJECT(POINTER) format so it will be easy to locate all instances of an object or references to it when looking at logs. llvm-svn: 117641
* Clean up the API logging code:Caroline Tice2010-10-261-23/+35
| | | | | | | | | | | | | | - Try to reduce logging to one line per function call instead of tw - Put all arguments & their values into log for calls - Add 'this' parameter information to function call logging, making it show the appropriate internal pointer (this.obj, this.sp, this.ap...) - Clean up some return values - Remove logging of constructors that construct empty objects - Change '==>' to '=>' for showing result values... - Fix various minor bugs - Add some protected 'get' functions to help getting the internal pointers for the 'this' arguments... llvm-svn: 117417
* First pass at adding logging capabilities for the API functions. At the momentCaroline Tice2010-10-261-0/+104
| | | | | | | | | | | | | | | | | | it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the issue here was that we have lldb_private::FileSpec that by default was always resolving a path when using the: FileSpec::FileSpec (const char *path); and in the: void FileSpec::SetFile(const char *pathname, bool resolve = true); This isn't what we want in many many cases. One example is you have "/tmp" on your file system which is really "/private/tmp". You compile code in that directory and end up with debug info that mentions "/tmp/file.c". Then you type: (lldb) breakpoint set --file file.c --line 5 If your current working directory is "/tmp", then "file.c" would be turned into "/private/tmp/file.c" which won't match anything in the debug info. Also, it should have been just a FileSpec with no directory and a filename of "file.c" which could (and should) potentially match any instances of "file.c" in the debug info. So I removed the constructor that just takes a path: FileSpec::FileSpec (const char *path); // REMOVED You must now use the other constructor that has a "bool resolve" parameter that you must always supply: FileSpec::FileSpec (const char *path, bool resolve); I also removed the default parameter to SetFile(): void FileSpec::SetFile(const char *pathname, bool resolve); And fixed all of the code to use the right settings. llvm-svn: 116944
* Added a "--no-lldbinit" option (-n for short (which magically matchesGreg Clayton2010-10-111-5/+13
| | | | | | | what gdb uses)) so we can tell our "lldb" driver program to not automatically parse any .lldbinit files. llvm-svn: 116179
* Create more useful instance names for target, process and thread instances.Caroline Tice2010-09-271-1/+1
| | | | | | | Change default 'set' behavior so that all instance settings for the specified variable will be updated, unless the "-n" ("--no_override") command options is specified. llvm-svn: 114808
* Remove all the __repr__ methods from the API/*.h files, and put themCaroline Tice2010-09-221-9/+0
| | | | | | | | | | into python-extensions.swig, which gets included into lldb.swig, and adds them back into the classes when swig generates it's C++ file. This keeps the Python stuff out of the general API classes. Also fixed a small bug in the copy constructor for SBSymbolContext. llvm-svn: 114602
* Add UserSettings to Target class, making Target settingsCaroline Tice2010-09-201-9/+20
| | | | | | | | | | | | | | | | | | the parent of Process settings; add 'default-arch' as a class-wide setting for Target. Replace lldb::GetDefaultArchitecture with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture. Add 'use-external-editor' as user setting to Debugger class & update code appropriately. Add Error parameter to methods that get user settings, for easier reporting of bad requests. Fix various other minor related bugs. Fix test cases to work with new changes. llvm-svn: 114352
* Add GetDescription() and __repr__ () methods to most API classes, to allowCaroline Tice2010-09-201-0/+24
| | | | | | | "print" from inside Python to print out the objects in a more useful manner. llvm-svn: 114321
* Fixed the way set/show variables were being accessed to being natively Greg Clayton2010-09-181-0/+49
| | | | | | | | | | | | | | | | | | accessed by the objects that own the settings. The previous approach wasn't very usable and made for a lot of unnecessary code just to access variables that were already owned by the objects. While I fixed those things, I saw that CommandObject objects should really have a reference to their command interpreter so they can access the terminal with if they want to output usaage. Fixed up all CommandObjects to take an interpreter and cleaned up the API to not need the interpreter to be passed in. Fixed the disassemble command to output the usage if no options are passed down and arguments are passed (all disassebmle variants take options, there are no "args only"). llvm-svn: 114252
* Make API calls for setting/getting user settable variables static.Caroline Tice2010-09-091-15/+11
| | | | | | | Modify Driver to handle SIGWINCH signals and automatically re-set the term-width variable. llvm-svn: 113506
* Make all debugger-level user settable variables into instance variables.Caroline Tice2010-09-091-3/+18
| | | | | | | Make get/set variable at the debugger level always set the particular debugger's instance variables rather than the default variables. llvm-svn: 113474
* eliminate some clang warnings.Chris Lattner2010-09-081-1/+1
| | | | llvm-svn: 113438
* This is a very large commit that completely re-does the way lldbCaroline Tice2010-09-041-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | handles user settable internal variables (the equivalent of set/show variables in gdb). In addition to the basic infrastructure (most of which is defined in UserSettingsController.{h,cpp}, there are examples of two classes that have been set up to contain user settable variables (the Debugger and Process classes). The 'settings' command has been modified to be a command-subcommand structure, and the 'set', 'show' and 'append' commands have been moved into this sub-commabnd structure. The old StateVariable class has been completely replaced by this, and the state variable dictionary has been removed from the Command Interpreter. Places that formerly accessed the state variable mechanism have been modified to access the variables in this new structure instead (checking the term-width; getting/checking the prompt; etc.) Variables are attached to classes; there are two basic "flavors" of variables that can be set: "global" variables (static/class-wide), and "instance" variables (one per instance of the class). The whole thing has been set up so that any global or instance variable can be set at any time (e.g. on start up, in your .lldbinit file), whether or not any instances actually exist (there's a whole pending and default values mechanism to help deal with that). llvm-svn: 113041
* Added a way to open the current source file & line in an external editor, ↵Jim Ingham2010-08-301-0/+20
| | | | | | | | and you can turn this on with: lldb -e llvm-svn: 112502
* Change "Current" as in GetCurrentThread, GetCurrentStackFrame, etc, to ↵Jim Ingham2010-08-261-10/+10
| | | | | | "Selected" i.e. GetSelectedThread. Selected makes more sense, since these are set by some user action (a selection). I didn't change "CurrentProcess" since this is always controlled by the target, and a given target can only have one process, so it really can't be selected. llvm-svn: 112221
* Added "void Clear();" methods to SBDebugger, SBTarget and SBThread so they ↵Greg Clayton2010-07-301-0/+6
| | | | | | can release their shared pointers. llvm-svn: 109882
* Add a unique ID to each debugger instance.Caroline Tice2010-06-301-1/+9
| | | | | | | | | | | | | | | | | Add functions to look up debugger by id Add global variable to lldb python module, to hold debugger id Modify embedded Python interpreter to update the global variable with the id of its current debugger. Modify the char ** typemap definition in lldb.swig to accept 'None' (for NULL) as a valid value. The point of all this is so that, when you drop into the embedded interpreter from the command interpreter (or when doing Python-based breakpoint commands), there is a way for the Python side to find/get the correct debugger instance ( by checking debugger_unique_id, then calling SBDebugger::FindDebuggerWithID on it). llvm-svn: 107287
* Very large changes that were needed in order to allow multiple connectionsGreg Clayton2010-06-231-193/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to the debugger from GUI windows. Previously there was one global debugger instance that could be accessed that had its own command interpreter and current state (current target/process/thread/frame). When a GUI debugger was attached, if it opened more than one window that each had a console window, there were issues where the last one to setup the global debugger object won and got control of the debugger. To avoid this we now create instances of the lldb_private::Debugger that each has its own state: - target list for targets the debugger instance owns - current process/thread/frame - its own command interpreter - its own input, output and error file handles to avoid conflicts - its own input reader stack So now clients should call: SBDebugger::Initialize(); // (static function) SBDebugger debugger (SBDebugger::Create()); // Use which ever file handles you wish debugger.SetErrorFileHandle (stderr, false); debugger.SetOutputFileHandle (stdout, false); debugger.SetInputFileHandle (stdin, true); // main loop SBDebugger::Terminate(); // (static function) SBDebugger::Initialize() and SBDebugger::Terminate() are ref counted to ensure nothing gets destroyed too early when multiple clients might be attached. Cleaned up the command interpreter and the CommandObject and all subclasses to take more appropriate arguments. llvm-svn: 106615
* Move Args.{cpp,h} and Options.{cpp,h} to Interpreter where they really belong.Jim Ingham2010-06-151-1/+1
| | | | llvm-svn: 106034
* Fix a bunch more include lines.Eli Friedman2010-06-091-12/+12
| | | | llvm-svn: 105702
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+569
llvm-svn: 105619
OpenPOWER on IntegriCloud