summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Cleaned up the API logging a lot more to reduce redundant information and Greg Clayton2010-10-3123-489/+470
| | | | | | | | | keep the file size a bit smaller. Exposed SBValue::GetExpressionPath() so SBValue users can get an expression path for their values. llvm-svn: 117851
* Fixed the copy constructor for SBThread.Greg Clayton2010-10-301-2/+3
| | | | llvm-svn: 117825
* Improved API logging.Greg Clayton2010-10-3017-574/+560
| | | | llvm-svn: 117772
* Add the ability to disable individual log categories, ratherCaroline Tice2010-10-295-7/+11
| | | | | | | | | than just the entire log channel. Add checks, where appropriate, to make sure a log channel/category has not been disabled before attempting to write to it. llvm-svn: 117715
* Modified the lldb_private::TypeList to use a std::multimap for quicker lookupGreg Clayton2010-10-2911-320/+175
| | | | | | | | | | 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
* Added a user-settable variable, 'target.expr-prefix',Sean Callanan2010-10-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which holds the name of a file whose contents are prefixed to each expression. For example, if the file ~/lldb.prefix.header contains: typedef unsigned short my_type; then you can do this: (lldb) settings set target.expr-prefix '~/lldb.prefix.header' (lldb) expr sizeof(my_type) (unsigned long) $0 = 2 When the variable is changed, the corresponding file is loaded and its contents are fetched into a string that is stored along with the target. This string is then passed to each expression and inserted into it during parsing, like this: typedef unsigned short my_type; void $__lldb_expr(void *$__lldb_arg) { sizeof(my_type); } llvm-svn: 117627
* Remove references to particular Python version (use the system defaultCaroline Tice2010-10-281-5/+0
| | | | | | | | | | version); change include statements to use Python.h in the Python framework on Mac OS X systems; leave it using regular Python.h on other systems. Note: I think this *ought* to work properly on Linux systems, but I don't have a system to test it on... llvm-svn: 117612
* Make SBFrame::GetDescription a little more descriptive.Caroline Tice2010-10-271-1/+5
| | | | llvm-svn: 117497
* Fix bugs attempting to write to API log after it has beenCaroline Tice2010-10-272-1/+4
| | | | | | disabled. llvm-svn: 117493
* Updated the lldb_private::Flags class to have better method names and madeGreg Clayton2010-10-271-0/+8
| | | | | | | | | | | | | | | | | all of the calls inlined in the header file for better performance. Fixed the summary for C string types (array of chars (with any combo if modifiers), and pointers to chars) work in all cases. Fixed an issue where a forward declaration to a clang type could cause itself to resolve itself more than once if, during the resolving of the type itself it caused something to try and resolve itself again. We now remove the clang type from the forward declaration map in the DWARF parser when we start to resolve it and avoid this additional call. This should stop any duplicate members from appearing and throwing all the alignment of structs, unions and classes. llvm-svn: 117437
* Clean up the API logging code:Caroline Tice2010-10-2627-616/+631
| | | | | | | | | | | | | | - 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-2627-91/+1894
| | | | | | | | | | | | | | | | | | 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
* Add and SB API to set breakpoint conditions.Jim Ingham2010-10-222-0/+24
| | | | llvm-svn: 117082
* Fixed an issue where we were resolving paths when we should have been.Greg Clayton2010-10-203-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't cache the public stop reason, since it can change as plan completion ↵Jim Ingham2010-10-201-8/+8
| | | | | | gets processed. That means GetStopReason needs to return a shared pointer, not a pointer to the thread's cached version. Also allow the thread plans to get and set the thread private stop reason - that is usually more appropriate for the logic the thread plans need to do. llvm-svn: 116892
* Fixed an expression parsing issue where if you were stopped somewhere withoutGreg Clayton2010-10-142-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debug information and you evaluated an expression, a crash would occur as a result of an unchecked pointer. Added the ability to get the expression path for a ValueObject. For a rectangle point child "x" the expression path would be something like: "rect.top_left.x". This will allow GUI and command lines to get ahold of the expression path for a value object without having to explicitly know about the hierarchy. This means the ValueObject base class now has a "ValueObject *m_parent;" member. All ValueObject subclasses now correctly track their lineage and are able to provide value expression paths as well. Added a new "--flat" option to the "frame variable" to allow for flat variable output. An example of the current and new outputs: (lldb) frame variable argc = 1 argv = 0x00007fff5fbffe80 pt = { x = 2 y = 3 } rect = { bottom_left = { x = 1 y = 2 } top_right = { x = 3 y = 4 } } (lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffe80 pt.x = 2 pt.y = 3 rect.bottom_left.x = 1 rect.bottom_left.y = 2 rect.top_right.x = 3 rect.top_right.y = 4 As you can see when there is a lot of hierarchy it can help flatten things out. Also if you want to use a member in an expression, you can copy the text from the "--flat" output and not have to piece it together manually. This can help when you want to use parts of the STL in expressions: (lldb) frame variable --flat argc = 1 argv = 0x00007fff5fbffea8 hello_world._M_dataplus._M_p = 0x0000000000000000 (lldb) expr hello_world._M_dataplus._M_p[0] == '\0' llvm-svn: 116532
OpenPOWER on IntegriCloud