summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
Commit message (Collapse)AuthorAgeFilesLines
* Moved FileSpec into the Host layer since it will vary from host to host.Greg Clayton2011-02-083-3/+3
| | | | | | We have a common unix implementation in lldb/source/Host/common/FileSpec.cpp. llvm-svn: 125078
* Added a SBListener parameter to Launch and attach calls to avoid a raceGreg Clayton2011-02-032-4/+22
| | | | | | | | | | condition that could occur when launching or attaching. What could happen is you would launch/attach to a process, then you would need to tell a listener to watch for process state changed events. In this case, if you waited too long to listen for events, you could miss the initial stop event, requiring clients to listen, then check the process state. llvm-svn: 124818
* Endian patch from Kirk Beitz that allows better cross platform building.Greg Clayton2011-02-011-0/+1
| | | | llvm-svn: 124643
* Changed the SymbolFile::FindFunction() function calls to only return Greg Clayton2011-01-271-9/+34
| | | | | | | | | | | | | | | | | | lldb_private::Function objects. Previously the SymbolFileSymtab subclass would return lldb_private::Symbol objects when it was asked to find functions. The Module::FindFunctions (...) now take a boolean "bool include_symbols" so that the module can track down functions and symbols, yet functions are found by the SymbolFile plug-ins (through the SymbolVendor class), and symbols are gotten through the ObjectFile plug-ins. Fixed and issue where the DWARF parser might run into incomplete class member function defintions which would make clang mad when we tried to make certain member functions with invalid number of parameters (such as an operator= operator that had no parameters). Now we just avoid and don't complete these incomplete functions. llvm-svn: 124359
* Added support for some new environment variables within LLDB to enable someGreg Clayton2011-01-271-19/+85
| | | | | | | | | | | | | | | | extra launch options: LLDB_LAUNCH_FLAG_DISABLE_ASLR disables ASLR for all launched processes LLDB_LAUNCH_FLAG_DISABLE_STDIO will disable STDIO (reroute to "/dev/null") for all launched processes LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY will force all launched processes to be launched in new terminal windows. Also, don't init python if we never create a script interpreter. llvm-svn: 124341
* Deprecated old forms of SBTarget::Launch. There is not just one and noGreg Clayton2011-01-231-43/+0
| | | | | | SWIG renaming done to work around deprecated APIs. llvm-svn: 124075
* Restored some missing APIs for the test suite. Now testsuite still has some ↵Greg Clayton2011-01-231-0/+30
| | | | | | | | | | failures due to overloaded SBTarget::Launch() calls. Bumping Xcode project versions: lldb-42 and debugserver-127. llvm-svn: 124063
* Added a new variant of SBTarget::Launch() that deprectates the old one thatGreg Clayton2011-01-231-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | takes separate file handles for stdin, stdout, and stder and also allows for the working directory to be specified. Added support to "process launch" to a new option: --working-dir=PATH. We can now set the working directory. If this is not set, it defaults to that of the process that has LLDB loaded. Added the working directory to the host LaunchInNewTerminal function to allows the current working directory to be set in processes that are spawned in their own terminal. Also hooked this up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its API changed, but nothing is making use of it yet. Modfied "debugserver" and "darwin-debug" to also handle the current working directory options and modified the code in LLDB that spawns these tools to pass the info along. Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout and stderr. After clearing the default values for the stdin/out/err file handles for process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable which is now fixed. Also fixed the setting of boolean values to be able to be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no", "off", or "0" for false. Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not already opened. Previous to this fix debugserver would only correctly open and dupe file handles for the slave side of a pseudo terminal. It now correctly handles getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to files. Also made sure the file handles were correctly opened with the NOCTTY flag for terminals. llvm-svn: 124060
* Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properlyGreg Clayton2011-01-221-3/+7
| | | | | | | | | | | | | | | | | | | | checking the validity of the shared pointer prior to using it. Fixed the GDB remote plug-in to once again watch for a reply from the "k" packet, and fixed the logic to make sure the thread requesting the kill and the async thread play nice (and very quickly) by synchronizing the packet sending and reply. I also tweaked some of the shut down packet ("k" kill, "D" detach, and the halt packet) to make sure they do the right thing. Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass the timeout along to WaitForStateChangedEventsPrivate() and made the function behave correctly with respect to timing out. Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added the start of being able to set the working directory for the inferior process. llvm-svn: 124049
* Add API and implementation for SBDebugger::Destroy and Debugger::Destroy.Caroline Tice2011-01-221-0/+18
| | | | llvm-svn: 124011
* Added support for stepping out of a frame. If you have 10 stack frames, and you Greg Clayton2011-01-212-13/+195
| | | | | | | | | | select frame #3, you can then do a step out and be able to go directly to the frame above frame #3! Added StepOverUntil and StepOutOfFrame to the SBThread API to allow more powerful stepping. llvm-svn: 123970
* Fixed up the SBValue::GetExpressionPath() to be more correct under moreGreg Clayton2011-01-211-1/+4
| | | | | | circumstances. llvm-svn: 123957
* Fixed missing return value (patch from Stephen Wilson).Greg Clayton2011-01-181-1/+1
| | | | llvm-svn: 123779
* A few of the issue I have been trying to track down and fix have been due toGreg Clayton2011-01-172-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the way LLDB lazily gets complete definitions for types within the debug info. When we run across a class/struct/union definition in the DWARF, we will only parse the full definition if we need to. This works fine for top level types that are assigned directly to variables and arguments, but when we have a variable with a class, lets say "A" for this example, that has a member: "B *m_b". Initially we don't need to hunt down a definition for this class unless we are ever asked to do something with it ("expr m_b->getDecl()" for example). With my previous approach to lazy type completion, we would be able to take a "A *a" and get a complete type for it, but we wouldn't be able to then do an "a->m_b->getDecl()" unless we always expanded all types within a class prior to handing out the type. Expanding everything is very costly and it would be great if there were a better way. A few months ago I worked with the llvm/clang folks to have the ExternalASTSource class be able to complete classes if there weren't completed yet: class ExternalASTSource { .... virtual void CompleteType (clang::TagDecl *Tag); virtual void CompleteType (clang::ObjCInterfaceDecl *Class); }; This was great, because we can now have the class that is producing the AST (SymbolFileDWARF and SymbolFileDWARFDebugMap) sign up as external AST sources and the object that creates the forward declaration types can now also complete them anywhere within the clang type system. This patch makes a few major changes: - lldb_private::Module classes now own the AST context. Previously the TypeList objects did. - The DWARF parsers now sign up as an external AST sources so they can complete types. - All of the pure clang type system wrapper code we have in LLDB (ClangASTContext, ClangASTType, and more) can now be iterating through children of any type, and if a class/union/struct type (clang::RecordType or ObjC interface) is found that is incomplete, we can ask the AST to get the definition. - The SymbolFileDWARFDebugMap class now will create and use a single AST that all child SymbolFileDWARF classes will share (much like what happens when we have a complete linked DWARF for an executable). We will need to modify some of the ClangUserExpression code to take more advantage of this completion ability in the near future. Meanwhile we should be better off now that we can be accessing any children of variables through pointers and always be able to resolve the clang type if needed. llvm-svn: 123613
* Implemented a major overhaul of the way variables are handledSean Callanan2011-01-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | by LLDB. Instead of being materialized into the input structure passed to the expression, variables are left in place and pointers to them are materialzied into the structure. Variables not resident in memory (notably, registers) get temporary memory regions allocated for them. Persistent variables are the most complex part of this, because they are made in various ways and there are different expectations about their lifetime. Persistent variables now have flags indicating their status and what the expectations for longevity are. They can be marked as residing in target memory permanently -- this is the default for result variables from expressions entered on the command line and for explicitly declared persistent variables (but more on that below). Other result variables have their memory freed. Some major improvements resulting from this include being able to properly take the address of variables, better and cleaner support for functions that return references, and cleaner C++ support in general. One problem that remains is the problem of explicitly declared persistent variables; I have not yet implemented the code that makes references to them into indirect references, so currently materialization and dematerialization of these variables is broken. llvm-svn: 123371
* Added the following functions to SBThread to allow threads to be suspended ↵Greg Clayton2011-01-121-0/+30
| | | | | | | | | | when a process is resumed: bool SBThread::Suspend(); bool SBThread::Resume(); bool SBThread::IsSuspended(); llvm-svn: 123300
* Fixed issues with RegisterContext classes and the subclasses. There wasGreg Clayton2011-01-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | an issue with the way the UnwindLLDB was handing out RegisterContexts: it was making shared pointers to register contexts and then handing out just the pointers (which would get put into shared pointers in the thread and stack frame classes) and cause double free issues. MallocScribble helped to find these issues after I did some other cleanup. To help avoid any RegisterContext issue in the future, all code that deals with them now returns shared pointers to the register contexts so we don't end up with multiple deletions. Also now that the RegisterContext class doesn't require a stack frame, we patched a memory leak where a StackFrame object was being created and leaked. Made the RegisterContext class not have a pointer to a StackFrame object as one register context class can be used for N inlined stack frames so there is not a 1 - 1 mapping. Updates the ExecutionContextScope part of the RegisterContext class to never return a stack frame to indicate this when it is asked to recreate the execution context. Now register contexts point to the concrete frame using a concrete frame index. Concrete frames are all of the frames that are actually formed on the stack of a thread. These concrete frames can be turned into one or more user visible frames due to inlining. Each inlined stack frame has the exact same register context (shared via shared pointers) as any parent inlined stack frames all the way up to the concrete frame itself. So now the stack frames and the register contexts should behave much better. llvm-svn: 122976
* Added the ability to get an set the desired format for SBValue objects.Greg Clayton2011-01-051-0/+16
| | | | | | | Fixed the display of complex numbers in lldb_private::DataExtractor::Dump(...) and also fixed other edge display cases in lldb_private::ClangASTType::DumpTypeValue(...). llvm-svn: 122895
* The LLDB API (lldb::SB*) is now thread safe!Greg Clayton2010-12-2013-458/+519
| | | | 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
* Linux patches from Stephen Wilson.Greg Clayton2010-12-181-0/+2
| | | | llvm-svn: 122125
* Added access to set the current stack frame within a thread so any commandGreg Clayton2010-12-171-0/+47
| | | | | | | | | | | | line commands can use the current thread/frame. Fixed an issue with expressions that get sandboxed in an objective C method where unichar wasn't being passed down. Added a "static size_t Scalar::GetMaxByteSize();" function in case we need to know the max supported by size of something within a Scalar object. llvm-svn: 122027
* Fix typos in SBBreakpoint::GetThreadIndex()/GetThreadName(), and test sequencesJohnny Chen2010-12-151-3/+3
| | | | | | for the two API calls. llvm-svn: 121898
* Fixed an error where the thread index was being returned as zero in ↵Greg Clayton2010-12-151-3/+3
| | | | | | "uint32_t SBBreakpoint::GetThreadIndex() const" even when it isn't specified. It should be UINT32_MAX to indicate there is no thread index set for the breakpoint (the breakpoint isn't thread specific). Also fixed the ThreadSpec.cpp to use UINT32_MAX instead of -1. Fixed the logging Printf statement in "uint32_t SBBreakpoint::GetThreadIndex() const" to not print the address of the "index" function from <string.h>! llvm-svn: 121896
* Fixed the "expression" command object to use the ↵Greg Clayton2010-12-151-1/+2
| | | | | | | | | | | | | StackFrame::GetValueForExpressionPath() function and also hooked up better error reporting for when things fail. Fixed issues with trying to display children of pointers when none are supposed to be shown (no children for function pointers, and more like this). This was causing child value objects to be made that were correctly firing an assertion. llvm-svn: 121841
* Changed:Greg Clayton2010-12-141-82/+127
| | | | | | | | | | | | | | | SBValue SBFrame::LookupVar(const char *name); To SBValue SBFrame::FindVariable (const char *name); Changed: SBValue LookupVarInScope (const char *name, const char *scope); to SBValue FindValue (const char *name, ValueType value_type); The latter makes it possible to not only find variables (params, locals, globals, and statics), but we can also now get register sets, registers and persistent variables using the frame as the context. llvm-svn: 121777
* Fixed rdar://problem/8767055 test suite failure TestStaticVariables.py (ToT ↵Johnny Chen2010-12-141-4/+4
| | | | | | | | r121745). Populate the variable list from the stack frame, first. llvm-svn: 121773
* Fixed SBFrame to properly check to make sure it has a valid m_opaque_sp objectGreg Clayton2010-12-145-43/+83
| | | | | | before trying to use it. llvm-svn: 121748
* Modified LLDB expressions to not have to JIT and run code just to see variableGreg Clayton2010-12-141-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | values or persistent expression variables. Now if an expression consists of a value that is a child of a variable, or of a persistent variable only, we will create a value object for it and make a ValueObjectConstResult from it to freeze the value (for program variables only, not persistent variables) and avoid running JITed code. For everything else we still parse up and JIT code and run it in the inferior. There was also a lot of clean up in the expression code. I made the ClangExpressionVariables be stored in collections of shared pointers instead of in collections of objects. This will help stop a lot of copy constructors on these large objects and also cleans up the code considerably. The persistent clang expression variables were moved over to the Target to ensure they persist across process executions. Added the ability for lldb_private::Target objects to evaluate expressions. We want to evaluate expressions at the target level in case we aren't running yet, or we have just completed running. We still want to be able to access the persistent expression variables between runs, and also evaluate constant expressions. Added extra logging to the dynamic loader plug-in for MacOSX. ModuleList objects can now dump their contents with the UUID, arch and full paths being logged with appropriate prefix values. Thread hardened the Communication class a bit by making the connection auto_ptr member into a shared pointer member and then making a local copy of the shared pointer in each method that uses it to make sure another thread can't nuke the connection object while it is being used by another thread. Added a new file to the lldb/test/load_unload test that causes the test a.out file to link to the libd.dylib file all the time. This will allow us to test using the DYLD_LIBRARY_PATH environment variable after moving libd.dylib somewhere else. llvm-svn: 121745
* Added the ability for SBTarget to resolve load addresses (convert ↵Greg Clayton2010-12-122-0/+19
| | | | | | lldb::addr_t values into resolved SBAddress objects). These SBAddress objects can then be used to resolve a symbol context using "lldb::SBSymbolContext ResolveSymbolContextForAddress (const lldb::SBAddress& addr, uint32_t resolve_scope);". llvm-svn: 121638
* Add test_display_source_python() test case to TestSourceManager.py which usesJohnny Chen2010-12-112-7/+5
| | | | | | | | | | the lldb PyThon API SBSourceManager to display source files. To accomodate this, the C++ SBSourceManager API has been changed to take an lldb::SBStream as the destination for display of source lines. Modify SBStream::ctor() so that its opaque pointer is initialized with an StreamString instance. llvm-svn: 121605
* More logging for use in debugging the interactionsSean Callanan2010-12-071-0/+5
| | | | | | | between clients of the LLDB API and the expression parser. llvm-svn: 121193
* Added symbol table access through the module for now. We might need to exposeGreg Clayton2010-12-072-1/+39
| | | | | | a SBSymtab class, but for now, we expose the symbols through the module. llvm-svn: 121112
* Added a less than operator that will compare the internal opaque pointer ↵Greg Clayton2010-12-051-0/+6
| | | | | | values so SBBroadcaster objects can be contained in ordered containers or sorted. llvm-svn: 120967
* Fixed an issue where SBProcess::LoadImage(...) was not returning the image Greg Clayton2010-12-051-1/+1
| | | | | | token. llvm-svn: 120954
* Added "void SBBroadcaster::Clear ();" method to SBBroadcaster.Greg Clayton2010-12-051-0/+7
| | | | llvm-svn: 120949
* Fixed a crasher when trying to get event data flavors on events that don'tGreg Clayton2010-12-051-1/+5
| | | | | | have event data. llvm-svn: 120948
* More reverting of the EOF stuff as the API was changed which we don't want toGreg Clayton2010-12-041-2/+17
| | | | | | | | | | do. Closing on EOF is an option that can be set on the lldb_private::Communication or the lldb::SBCommunication objects after they are created. Of course the EOF support isn't hooked up, so they don't do anything at the moment, but they are left in so when the code is fixed, it will be easy to get working again. llvm-svn: 120885
* Add proper EOF handling to Communication & Connection classes:Caroline Tice2010-12-021-2/+2
| | | | | | | | | | Add bool member to Communication class indicating whether the Connection should be closed on receiving an EOF or not. Update the Connection read to return an EOF status when appropriate. Modify the Communication class to pass the EOF along or not, and to close the Connection or not, as appropriate. llvm-svn: 120723
* Moved the code in ClangUserExpression that set up & ran the thread plan with ↵Jim Ingham2010-11-301-1/+1
| | | | | | | | | | timeouts, and restarting with all threads into a utility function in Process. This required a bunch of renaming. Added a ThreadPlanCallUserExpression that differs from ThreadPlanCallFunction in that it holds onto a shared pointer to its ClangUserExpression so that can't go away before the thread plan is done using it. Fixed the stop message when you hit a breakpoint while running a user expression so it is more obvious what has happened. llvm-svn: 120386
* 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
* Fill in more test sequences for Python API SBFrame.LookupVarInScope(name, ↵Johnny Chen2010-11-191-18/+17
| | | | | | | | | scope). Change SBFrame::LookupVarInScope() to also work with "global" scope in addition to "local" and "parameter" scope. llvm-svn: 119811
* Added the ability to get more information on the SBThread's stop reasonGreg Clayton2010-11-182-0/+105
| | | | | | | | | | | | | | by being able to get the data count and data. Each thread stop reason has one or more data words that can help describe the stop. To do this I added: size_t SBThread::GetStopReasonDataCount(); uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx); llvm-svn: 119720
* Fixed FileSpec's operator == to deal with equivalent paths such as "/tmp/a.c"Greg Clayton2010-11-081-1/+1
| | | | | | | | | | | | | | and "/private/tmp/a.c". This was done by adding a "mutable bool m_is_resolved;" member to FileSpec and then modifying the equal operator to check if the filenames are equal, and if they are, then check the directories. If they are not equal, then both paths are checked to see if they have been resolved. If they have been resolved, we resolve the paths in temporary FileSpec objects and set each of the m_is_resolved bools to try (for lhs and rhs) if the paths match what is contained in the path. This allows us to do more intelligent compares without having to resolve all paths found in the debug info (which can quickly get costly if the files are on remote NFS mounts). llvm-svn: 118387
* Modified all logging calls to hand out shared pointers to make sure weGreg Clayton2010-11-0627-193/+193
| | | | | | | | | | | 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-0521-96/+390
| | | | | | so we don't end up with weak exports with some compilers. llvm-svn: 118312
* Added the equivalent of gdb's "unwind-on-signal" to the expression command, ↵Jim Ingham2010-11-051-1/+2
| | | | | | and a parameter to control it in ClangUserExpression, and on down to ClangFunction. llvm-svn: 118290
* Added support for loading and unloading shared libraries. This was done byGreg Clayton2010-11-042-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding support into lldb_private::Process: virtual uint32_t lldb_private::Process::LoadImage (const FileSpec &image_spec, Error &error); virtual Error lldb_private::Process::UnloadImage (uint32_t image_token); There is a default implementation that should work for both linux and MacOSX. This ability has also been exported through the SBProcess API: uint32_t lldb::SBProcess::LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error); lldb::SBError lldb::SBProcess::UnloadImage (uint32_t image_token); Modified the DynamicLoader plug-in interface to require it to be able to tell us if it is currently possible to load/unload a shared library: virtual lldb_private::Error DynamicLoader::CanLoadImage () = 0; This way the dynamic loader plug-ins are allows to veto whether we can currently load a shared library since the dynamic loader might know if it is currenlty loading/unloading shared libraries. It might also know about the current host system and know where to check to make sure runtime or malloc locks are currently being held. Modified the expression parser to have ClangUserExpression::Evaluate() be the one that causes the dynamic checkers to be loaded instead of other code that shouldn't have to worry about it. llvm-svn: 118227
* Fixed an include so case sensitive builders can build.Greg Clayton2010-10-311-1/+1
| | | | llvm-svn: 117864
OpenPOWER on IntegriCloud