summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding new Python API function to check for stopped threads.Andrew Kaylor2013-04-151-0/+6
| | | | llvm-svn: 179577
* Make sure we expose SetData() through the PythonSean Callanan2013-04-131-0/+3
| | | | | | interface. llvm-svn: 179439
* Fixed SBValueList to have a __str__ function like all other SB classes. ↵Greg Clayton2013-04-111-2/+3
| | | | | | Previously this was done as __repr__. llvm-svn: 179327
* <rdar://problem/13563628>Enrico Granata2013-04-051-1/+2
| | | | | | | | | | Introducing a negative cache for ObjCLanguageRuntime::LookupInCompleteClassCache() This helps speed up the (common) case of us looking for classes that are hidden deep within Cocoa internals and repeatedly failing at finding type information for them. In order for this to work, we need to clean this cache whenever debug information is added. A new symbols loaded event is added that is triggered with add-dsym (before modules loaded would be triggered for both adding modules and adding symbols). Interested parties can register for this event. Internally, we make sure to clean the negative cache whenever symbols are added. Lastly, ClassDescriptor::IsTagged() has been refactored to GetTaggedPointerInfo() that also (optionally) returns info and value bits. In this way, data formatters can share tagged pointer code instead of duplicating the required arithmetic. llvm-svn: 178897
* Modified patch from Prabhat Verma to enable loading core files through the ↵Greg Clayton2013-03-251-0/+20
| | | | | | SBTarget API. llvm-svn: 177932
* <rdar://problem/13434476>Enrico Granata2013-03-251-4/+31
| | | | | | | | | | | | Making value objects properly iterable in constructs of the form [ x for x in value_with_children ] This would previously cause an endless loop because lacking a proper iterator object, Python will keep calling __getitem__() with increasing values of the index until it gets an IndexError since SBValue::GetValueForExpressionPath() supports synthetic array members, no array index will ever really cause an IndexError to be raised, hence the endless iteration class value_iter is an implementation of __iter__() that provides a terminating iterator over a value llvm-svn: 177885
* - Masking out SBCommandReturnObject::Printf() from the Python layer because ↵Enrico Granata2013-03-252-2/+28
| | | | | | | | | | SWIG and varargs do not get along well. It is replaced by a Print("str") call which is equivalent to Printf("%s","str") - Providing file-like behavior for SBStream with appropriate extension write() and flush() calls, plus documenting that these are only meant and only exist for Python Documenting the file-like behavior on our website llvm-svn: 177877
* <rdar://problem/13312903>Enrico Granata2013-03-231-0/+7
| | | | | | | | | | | | | | Exports write() and flush() from SBCommandReturnObject to enable file-like output from Python commands. e.g.: def ls(debugger, command, result, internal_dict): print >>result,”just “some output” will produce (lldb) ls just “some output (lldb) llvm-svn: 177807
* This checkin removes the last Cocoa formatters that were implemented in ↵Enrico Granata2013-03-191-27/+0
| | | | | | Python and reimplements them in C++. The Python Cocoa formatters are not shipped as part of LLDB anymore, but still exist in the source repository for user reference. Python formatters still exist for STL classes and users can still define their own Python formatters llvm-svn: 177366
* <rdar://problem/13421412>Greg Clayton2013-03-141-1/+1
| | | | | | Many "byte size" members and variables were using a mixture of uint32_t and size_t. Switching over to using uint64_t everywhere. llvm-svn: 177091
* Added new properties to lldb.SBModule classes:Greg Clayton2013-03-071-3/+61
| | | | | | | | | | | | | | | | | | "compile_units" returns an array of all compile units in a module as a list() of lldb.SBCompileUnit objects. "compile_unit" returns a compile unit accessor object that allows indexed access, search by full or partial path, or by regex: (lldb) script comp_unit = lldb.target.module['TextEdit'].compile_unit['Document.m'] comp_unit = lldb.target.module['TextEdit'].compile_unit['/path/to/Document.m'] comp_unit = lldb.target.module['TextEdit'].compile_unit[0] comp_unit = lldb.target.module['TextEdit'].compile_unit[1] for comp_unit in lldb.target.module['TextEdit'].compile_unit[re.compile("\.m$")] print comp_unit This helps do quick searches and scripting while debugging. llvm-svn: 176613
* Stop the "module" property from throwing an exception when the module name ↵Greg Clayton2013-03-071-6/+9
| | | | | | was not found in the target module list. llvm-svn: 176611
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-023-0/+12
| | | | | | | | | | | | API's. Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
* <rdar://problem/13281528>Greg Clayton2013-02-252-9/+9
| | | | | | Fixed issues with the SBModule "sections" property, and with the SBBlock "ranges" attributes. llvm-svn: 176051
* Fix document typos, indentation in python code, and API examples.Daniel Malea2013-02-121-1/+1
| | | | | | Patch by Bruce Mitchener! llvm-svn: 175002
* Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction ↵Jim Ingham2013-02-092-2/+8
| | | | | | | | | | | interoperate to fix problems where hitting auto-continue signals while running a thread plan would cause us to lose control of the debug session. <rdar://problem/12993641> llvm-svn: 174793
* Allow the target to give out the size of the red zone for given ABIs.Greg Clayton2013-02-011-0/+3
| | | | | | A bit of cleanup in the heap module. llvm-svn: 174129
* Use printf instead of echo -n (the latter won't work on OS X's /bin/sh)Filipe Cabecinhas2013-01-301-2/+2
| | | | llvm-svn: 173867
* <rdar://problem/13069948>Greg Clayton2013-01-251-14/+14
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* <rdar://problem/13010007>Greg Clayton2013-01-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for OS plug-ins to lazily populate the thread this. The python OS plug-in classes can now implement the following method: class OperatingSystemPlugin: def create_thread(self, tid, context): # Return a dictionary for a new thread to create it on demand This will add a new thread to the thread list if it doesn't already exist. The example code in lldb/examples/python/operating_system.py has been updated to show how this call us used. Cleaned up the code in PythonDataObjects.cpp/h: - renamed all classes that started with PythonData* to be Python*. - renamed PythonArray to PythonList. Cleaned up the code to use inheritance where - Centralized the code that does ref counting in the PythonObject class to a single function. - Made the "bool PythonObject::Reset(PyObject *)" function be virtual so each subclass can correctly check to ensure a PyObject is of the right type before adopting the object. - Cleaned up all APIs and added new constructors for the Python* classes to they can all construct form: - PyObject * - const PythonObject & - const lldb::ScriptInterpreterObjectSP & Cleaned up code in ScriptInterpreterPython: - Made calling python functions safer by templatizing the production of value formats. Python specifies the value formats based on built in C types (long, long long, etc), and code often uses typedefs for uint32_t, uint64_t, etc when passing arguments down to python. We will now always produce correct value formats as the templatized code will "do the right thing" all the time. - Fixed issues with the ScriptInterpreterPython::Locker where entering the session and leaving the session had a bunch of issues that could cause the "lldb" module globals lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame to not be initialized. llvm-svn: 172873
* Remove std::string input arguments and replace with "const char *".Greg Clayton2013-01-161-9/+12
| | | | llvm-svn: 172647
* <rdar://problem/13021266>Enrico Granata2013-01-162-0/+33
| | | | | | | Adding FindFirstGlobalVariable to SBModule and SBTarget These calls work like FindGlobalVariables but they only return the first match found and so they can return an SBValue instead of an SBValueList for added convenience of use llvm-svn: 172636
* <rdar://problem/13009943>Greg Clayton2013-01-161-0/+9
| | | | | | | | | | Added a unique integer identifier to processes. Some systems, like JTAG or other simulators, might always assign the same process ID (pid) to the processes that are being debugged. In order for scripts and the APIs to uniquely identify the processes, there needs to be another ID. Now the SBProcess class has: uint32_t SBProcess::GetUniqueID(); This integer ID will help to truly uniquely identify a process and help with appropriate caching that can be associated with a SBProcess object. llvm-svn: 172628
* Separated the "expr --unwind-on-error" behavior into two parts, actual ↵Jim Ingham2013-01-151-0/+8
| | | | | | | | | | | | | | | | errors (i.e. crashes) which continue to be controlled by the --unwind-on-error flag, and --ignore-breakpoint which separately controls behavior when a called function hits a breakpoint. For breakpoints, we don't unwind, we either stop, or ignore the breakpoint, which makes more sense. Also make both these behaviors globally settable through "settings set". Also handle the case where a breakpoint command calls code that ends up re-hitting the breakpoint. We were recursing and crashing. Now we just stop without calling the second command. <rdar://problem/12986644> <rdar://problem/9119325> llvm-svn: 172503
* Add an SBProcess API to get the current StopID, either considering or ↵Jim Ingham2013-01-081-0/+10
| | | | | | | | | | ignoring stops caused by expression evaluation. <rdar://problem/12968562> llvm-svn: 171914
* <rdar://problem/12928282>Greg Clayton2013-01-041-0/+2
| | | | | | | | Added SBTarget::EvaluateExpression() so expressions can be evaluated without needing a process. Also fixed many functions that deal with clang AST types to be able to properly handle the clang::Type::Elaborated types ("struct foo", "class bar"). llvm-svn: 171476
* Adding events when watchpoints are set or changed.Jim Ingham2012-12-182-1/+12
| | | | | | <rdar://problem/11597849> llvm-svn: 170400
* Fixed a few bugs in the "step in" thread plan logic.Jim Ingham2012-12-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Added a "step-in-target" flag to "thread step-in" so if you have something like: Process 28464 stopped * thread #1: tid = 0x1c03, function: main , stop reason = breakpoint 1.1 frame #0: 0x0000000100000e08 a.out`main at main.c:62 61 -> 62 int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint. 63 and you want to get into "complex" skipping a, b and c, you can do: (lldb) step -t complex Process 28464 stopped * thread #1: tid = 0x1c03, function: complex , stop reason = step in frame #0: 0x0000000100000d0d a.out`complex at main.c:44 41 42 int complex (int first, int second, int third) 43 { -> 44 return first + second + third; // Step in targetting complex should stop here 45 } 46 47 int main (int argc, char const *argv[]) llvm-svn: 170008
* Make sure that the lldb globals:Greg Clayton2012-12-101-2/+8
| | | | | | | | | | | lldb.target lldb.process lldb.thread lldb.frame are initialized to at least contain empty lldb classes in case some python gets imported that uses them. llvm-svn: 169750
* Added GetCanonicalType() to SBType:Greg Clayton2012-12-081-0/+3
| | | | | | | lldb::SBType SBType::GetCanonicalType(); llvm-svn: 169655
* <rdar://problem/12749733>Greg Clayton2012-12-052-0/+5
| | | | | | Always allows getting builtin types by name even if there is no backing debug information. llvm-svn: 169424
* <rdar://problem/12649160>Greg Clayton2012-12-051-0/+1
| | | | | | Added the ability to debug through your process exec'ing itself to the same architecture. llvm-svn: 169340
* <rdar://problem/12750060>Greg Clayton2012-12-042-3/+16
| | | | | | Add the ability to get a symbol or symbols by name and type from a SBModule, and also the ability to get all symbols by name and type from SBTarget objects. llvm-svn: 169205
* Match extern "C" in declaration and definition (swig template)Daniel Malea2012-11-291-0/+8
| | | | | | - Fix for building with gcc 4.6 llvm-svn: 168901
* <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferiorHan Ming Ong2012-11-171-1/+5
| | | | | | This allows client to query profiling states on the inferior. llvm-svn: 168228
* Makefile patches from Charles Davis and Daniel Malea (+ one or two tweaks).Filipe Cabecinhas2012-11-013-22/+85
| | | | llvm-svn: 167242
* Added the ability to get function return and argument types to SBType():Greg Clayton2012-10-301-1/+13
| | | | | | | | | | | | | bool SBType::IsFunctionType (); lldb::SBType SBType::GetFunctionReturnType (); lldb::SBTypeList SBType::GetFunctionArgumentTypes (); llvm-svn: 167023
* Ensuring that the swig typemaps for SBData set the size to 0 along with the ↵Enrico Granata2012-10-291-0/+5
| | | | | | | | pointer to NULL There should be no functional changes as SBData creation functions already checked for NULL regardless of size - but it ensures consistency llvm-svn: 166978
* Add API to get the process plugin name & short name.Jim Ingham2012-10-261-0/+6
| | | | llvm-svn: 166799
* <rdar://problem/12523238> Commit 1 of 3Enrico Granata2012-10-231-65/+97
| | | | | | | | | | | | This commit enables the new HasChildren() feature for synthetic children providers Namely, it hooks up the required bits and pieces so that individual synthetic children providers can implement a new (optional) has_children call Default implementations have been provided where necessary so that any existing providers continue to work and behave correctly Next steps are: 2) writing smart implementations of has_children for our providers whenever possible 3) make a test case llvm-svn: 166495
* <rdar://problem/12493007>Greg Clayton2012-10-231-0/+3
| | | | | | | | | | | Added a new API call to help efficiently determine if a SBValue could have children: bool SBValue::MightHaveChildren (); This is inteneded to be used bui GUI programs that need to show if a SBValue needs a disclosure triangle when displaying a hierarchical type in a tree view without having to complete the type (by calling SBValue::GetNumChildren()) as completing the type is expensive. llvm-svn: 166460
* <rdar://problem/12437442>Enrico Granata2012-10-222-0/+16
| | | | | | | | | | | Given our implementation of ValueObjects we could have a scenario where a ValueObject has a dynamic type of Foo* at one point, and then its dynamic type changes to Bar* If Bar* has synthetic children enabled, by the time we figure that out, our public API is already vending SBValues wrapping a DynamicVO, instead of a SyntheticVO and there was no trivial way for us to change the SP inside an SBValue on the fly This checkin reimplements SBValue in terms of a wrapper, ValueImpl, that allows this substitutions on-the-fly by overriding GetSP() to do The Right Thing (TM) As an additional bonus, GetNonSyntheticValue() now works, and we can get rid of the ForceDisableSyntheticChildren idiom in ScriptInterpreterPython Lastly, this checkin makes sure the synthetic VOs get the correct m_value and m_data from their parents (prevented summaries from working in some cases) llvm-svn: 166426
* API cleanup.Greg Clayton2012-10-161-42/+19
| | | | llvm-svn: 166070
* Add the ability to set timeout & "run all threads" options both from the ↵Jim Ingham2012-10-164-0/+112
| | | | | | | | | | "expr" command and from the SB API's that evaluate expressions. <rdar://problem/12457211> llvm-svn: 166062
* Removing the two extra GetXSize(bool) calls since we do not desire to ↵Enrico Granata2012-10-161-6/+0
| | | | | | support them long-term llvm-svn: 166060
* <rdar://problem/12446320> Fixing an issue with our Driver where setting an ↵Enrico Granata2012-10-161-3/+15
| | | | | | immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands llvm-svn: 166058
* <rdar://problem/12490588>Greg Clayton2012-10-131-0/+3
| | | | | | From SBType, we can now get a lldb::BasicType enumeration out of an existing type. llvm-svn: 165857
* <rdar://problem/12490558>Greg Clayton2012-10-121-1/+1
| | | | | | SBProcess::SetSelectedThreadByID() had a "uint32_t tid" parameter which would truncate 64 bit thread IDs (lldb::tid_t is 64 bit). llvm-svn: 165852
* <rdar://problem/12462744> Implement a new SBDeclaration class to wrap an ↵Enrico Granata2012-10-104-0/+80
| | | | | | lldb_private::Declaration - make a GetDeclaration() API on SBValue to return a declaration. This will only work for vroot variables as they are they only objects for which we currently provide a valid Declaration llvm-svn: 165672
* Change the Thread constructor over to take a Process& rather than a ↵Jim Ingham2012-10-101-0/+12
| | | | | | | | | | | | | ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP. Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame changes the stack. Made the Driver use this notification to print the new thread status rather than doing it in the command. Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call. <rdar://problem/12383087> llvm-svn: 165640
OpenPOWER on IntegriCloud