summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a new SBThread::SafeToCallFunctions API; this calls over toJason Molenda2014-05-131-0/+10
| | | | | | | | | | the SystemRuntime to check if a thread will have any problems performing an inferior function call so the driver can skip making that function call on that thread. Often the function call can be executed on another thread instead. <rdar://problem/16777874> llvm-svn: 208732
* Allow clients to control the exact path that is used to launch processes by ↵Greg Clayton2014-05-071-0/+6
| | | | | | | | | | | | | | | | adding new calls to SBLaunchInfo. The new calls are: SBFileSpec SBLaunchInfo::GetExecutableFile (); void SBLaunchInfo::SetExecutableFile (SBFileSpec exe_file, bool add_as_first_arg); <rdar://problem/16833939> llvm-svn: 208245
* Add a new SBThread::GetQueue() method to get the queue that is Jason Molenda2014-04-251-0/+13
| | | | | | | | | | currently associated with a given thread, on relevant targets. Change the queue detection code to verify that the queues associated with all live threads are included in the list. <rdar://problem/16411314> llvm-svn: 207160
* Add the ability to set python breakpoint commands from the SBBreakpoint & ↵Jim Ingham2014-04-022-1/+44
| | | | | | | | | | | SBBreakpointLocation API's. You can either provide the function name, or function body text. Also propagate the compilation error up from where it is checked so we can report compilation errors. <rdar://problem/9898371> llvm-svn: 205380
* lldb arm64 import.Jason Molenda2014-03-292-0/+10
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Add the ability from the SB API's to set the "one thread" timeoutJim Ingham2014-03-281-0/+7
| | | | | | | | for expression evaluations that try one and then all threads. <rdar://problem/15598528> llvm-svn: 205060
* Add a SBQueue::GetKind() method to retrieve the type of libdispatch queue ↵Jason Molenda2014-03-131-0/+18
| | | | | | | | (serial or concurrent). <rdar://problem/7964505> llvm-svn: 203748
* libBacktraceRecording __introspection_dispatch_queue_get_pending_items isJason Molenda2014-03-091-0/+3
| | | | | | | | | | | changing the data it returns; this change accepts either the old format or the new format. It doesn't yet benefit from the new format's additions - but I need to get this checked in so we aren't rev-locked. Also add a missing .i entry for SBQueue::GetNumRunningItems() missing from the last checkin. <rdar://problem/16272115> llvm-svn: 203421
* Plumb the EvaluateExpressionOptions::{Set,Get}StopOthers through the SB API, ↵Jim Ingham2014-02-281-0/+7
| | | | | | | | | and make it work in RunThreadPlan. Also remove SetStopOthers from the ThreadPlanCallFunction, because if the value you have doesn't match what is in the EvaluateExpressionOptions the plan was passed when created it won't work correctly. llvm-svn: 202464
* Change the Mac OS X SystemRuntime plugin from using the placeholderJason Molenda2014-02-052-2/+21
| | | | | | | | | | | | | | libldi library to collect extended backtrace information; switch to the libBacktraceRecording library and its APIs. Complete the work of adding QueueItems to Queues and allow for the QueueItems to be interrogated about their extended backtraces in turn. There's still cleanup and documentation to do on this code but the code is functional and I it's a good time to get the work-in-progress checked in. <rdar://problem/15314027> llvm-svn: 200822
* Merging the iohandler branch back into main. Greg Clayton2014-01-273-63/+12
| | | | | | | | | | | | 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
* Added the ability to get the type that a typedef points to via:Greg Clayton2014-01-232-0/+6
| | | | | | | | | | SBType SBType::GetTypedefedType(); Also added the ability to get a type by type ID from a SBModule: SBType SBModule::GetTypeByID (lldb::user_id_t uid); llvm-svn: 199939
* Add a new way to bind a format to a type: by enum typeEnrico Granata2013-12-281-0/+8
| | | | | | | | | | | The "type format add" command gets a new flag --type (-t). If you pass -t <sometype>, upon fetching the value for an object of your type, LLDB will display it as-if it was of enumeration type <sometype> This is useful in cases of non-contiguous enums where there are empty gaps of unspecified values, and as such one cannot type their variables as the enum type, but users would still like to see them as-if they were of the enum type (e.g. DWARF field types with their user-reserved ranges) The SB API has also been improved to handle both types of formats, and a test case is added llvm-svn: 198105
* Add new Queue, QueueItem, Queuelist, SBQueue, SBQueueItem classes to representJason Molenda2013-12-133-0/+109
| | | | | | | | | libdispatch aka Grand Central Dispatch (GCD) queues. Still fleshing out the documentation and testing of these but the overall API is settling down so it's a good time to check it in. <rdar://problem/15600370> llvm-svn: 197190
* For logical backtrace work, lldb needs to track Module unloads etc & ↵Greg Clayton2013-12-061-0/+3
| | | | | | | | | | symoblicate an address based on a point in time <rdar://problem/15314403> This patch adds a new lldb_private::SectionLoadHistory class that tracks what shared libraries were loaded given a process stop ID. This allows us to keep a history of the sections that were loaded for a time T. Many items in history objects will rely upon the process stop ID in the future. llvm-svn: 196557
* Expose SBPlatform through the public API.Greg Clayton2013-11-205-0/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a new SBThread::GetExtendedBacktraceOriginatingIndexID() methodJason Molenda2013-11-161-1/+13
| | | | | | | | | | (and same thing to Thread base class) which can be used when looking at an ExtendedBacktrace thread; it will try to find the IndexID() of the original thread that was executing this backtrace when it was recorded. If lldb can't find a record of that thread, it will return the same value as IndexID() for the ExtendedBacktrace thread. llvm-svn: 194912
* Change SBThread::GetExtendedBacktrace toJason Molenda2013-11-121-2/+2
| | | | | | | SBThread::GetExtendedBacktraceThread to make it more clear what is being returned. llvm-svn: 194531
* This patch does a couple of things. Jim Ingham2013-11-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | It completes the job of using EvaluateExpressionOptions consistently throughout the inferior function calling mechanism in lldb begun in Greg's patch r194009. It removes a handful of alternate calls into the ClangUserExpression/ClangFunction/ThreadPlanCallFunction which were there for convenience. Using the EvaluateExpressionOptions removes the need for them. Using that it gets the --debug option from Greg's patch to work cleanly. It also adds another EvaluateExpressionOption to not trap exceptions when running expressions. You shouldn't use this option unless you KNOW your expression can't throw beyond itself. This is: <rdar://problem/15374885> At present this is only available through the SB API's or python. It fixes a bug where function calls would unset the ObjC & C++ exception breakpoints without checking whether they were set by somebody else already. llvm-svn: 194182
* Rename extended backtrace methods to take out the "ThreadOrigin"Jason Molenda2013-11-062-6/+6
| | | | | | | bit from the method names. <rdar://problem/15314369> llvm-svn: 194122
* Add a new GetThreadOriginExtendedBacktrace method to the Jason Molenda2013-11-061-0/+13
| | | | | | | SystemRuntime and SBThread classes. <rdar://problem/15314369> llvm-svn: 194111
* Add the GetNumThreadOriginExtendedBacktraceTypes andJason Molenda2013-11-052-0/+30
| | | | | | | | | | | GetThreadOriginExtendedBacktraceTypeAtIndex methods to SBProcess. Add documentation for the GetQueueName and GetQueueID methods to SBThread. <rdar://problem/15314369> llvm-svn: 194063
* Fix for a mistake spotted by Enrico with the SBThread::queue_id accessor.Jason Molenda2013-10-221-1/+1
| | | | llvm-svn: 193136
* Expose the Thread::GetQueueID() method through the SBThread API, similar toJason Molenda2013-10-211-0/+6
| | | | | | the existing SBThread::GetQueueName() method. llvm-svn: 193132
* <rdar://problem/14028923>Enrico Granata2013-10-081-0/+3
| | | | | | | Implement SBTarget::CreateValueFromAddress() with a behavior equivalent to SBValue::CreateValueFromAddress() (but without the need to grab an SBValue first just as a starting point to make up another SBValue out of whole cloth) llvm-svn: 192239
* Add missing GetBroadcasterClassName and event types enum to SBThread.iDaniel Malea2013-10-031-0/+16
| | | | llvm-svn: 191933
* Added a 'jump' command, similar to GDBs.Richard Mitton2013-09-121-2/+5
| | | | | | | | | This allows the PC to be directly changed to a different line. It's similar to the example python script in examples/python/jump.py, except implemented as a builtin. Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function) llvm-svn: 190572
* Don't recommend using bytearray(buf, 'ascii') for binary data read with Jason Molenda2013-08-241-2/+1
| | | | | | SBProcess::ReadMemory - it will fail for anything with the high bit set. llvm-svn: 189154
* Add an SBFrame::FindRegister() method to make it a littleJason Molenda2013-07-261-0/+3
| | | | | | easier to retrieve a register value. llvm-svn: 187184
* Second attempt at getting the PyCallable changes in trunkEnrico Granata2013-07-091-0/+7
| | | | | | Thanks to Daniel Malea for helping test this patch for Linux happiness! llvm-svn: 185965
* Added a way to extract the module specifications from a file. A module ↵Greg Clayton2013-07-083-1/+139
| | | | | | | | | | | | | specification is information that is required to describe a module (executable, shared library, object file, ect). This information includes host path, platform path (remote path), symbol file path, UUID, object name (for objects in .a files for example you could have an object name of "foo.o"), and target triple. Module specification can be used to create a module, or used to add a module to a target. A list of module specifications can be used to enumerate objects in container objects (like universal mach files and BSD archive files). There are two new classes: lldb::SBModuleSpec lldb::SBModuleSpecList The SBModuleSpec wraps up a lldb_private::ModuleSpec, and SBModuleSpecList wraps up a lldb_private::ModuleSpecList. llvm-svn: 185877
* Revert commits that cause broken builds on GCC buildbotsDaniel Malea2013-07-031-7/+0
| | | | | | | | - build fails due to PyCallable template definition inside an extern "C" scope This commit reverts 185240, 184893 and 184608. llvm-svn: 185560
* <rdar://problem/14266411>Enrico Granata2013-06-251-0/+7
| | | | | | | | | | | | The semi-unofficial way of returning a status from a Python command was to return a string (e.g. return "no such variable was found") that LLDB would pick as a clue of an error having happened This checkin changes that: - SBCommandReturnObject now exports a SetError() call, which can take an SBError or a plain C-string - script commands now drop any return value and expect the SBCommandReturnObject ("return object") to be filled in appropriately - if you do nothing, a success will be assumed If your commands were relying on returning a value and having LLDB pick that up as an error, please change your commands to SetError() through the return object or expect changes in behavior llvm-svn: 184893
* Implemented a types.py module that allows types to be inspected for padding.Greg Clayton2013-06-191-0/+3
| | | | | | The script was able to point out and save 40 bytes in each lldb_private::Section by being very careful where we need to have virtual destructors and also by re-ordering members. llvm-svn: 184364
* Added the ability to get a list of types from a SBModule or SBCompileUnit. ↵Greg Clayton2013-06-182-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sebastien Metrot wanted this, and sent a hollowed out patch. I filled in the blanks and did the low level implementation. The new functions are: //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// module. /// /// @param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct /// and union types. Passing in lldb::eTypeClassAny will return /// all types found in the debug information for this module. /// /// @return /// A list of types in this module that match \a type_mask //------------------------------------------------------------------ lldb::SBTypeList SBModule::GetTypes (uint32_t type_mask) //------------------------------------------------------------------ /// Get all types matching \a type_mask from debug info in this /// compile unit. /// /// @param[in] type_mask /// A bitfield that consists of one or more bits logically OR'ed /// together from the lldb::TypeClass enumeration. This allows /// you to request only structure types, or only class, struct /// and union types. Passing in lldb::eTypeClassAny will return /// all types found in the debug information for this compile /// unit. /// /// @return /// A list of types in this compile unit that match \a type_mask //------------------------------------------------------------------ lldb::SBTypeList SBCompileUnit::GetTypes (uint32_t type_mask = lldb::eTypeClassAny); This lets you request types by filling out a mask that contains one or more bits from the lldb::TypeClass enumerations, so you can only get the types you really want. llvm-svn: 184251
* Added a SBSection::GetParent() to the API.Greg Clayton2013-06-131-0/+3
| | | | llvm-svn: 183948
* Improvements to the data formatters SB API:Enrico Granata2013-06-111-0/+97
| | | | | | | | - exposing new accessors: formats/format, ..., that allow you to iterate over all formatters e.g. sys_category = lldb.debugger.GetCategory("system").summary['char *'] - ensuring that C++-based synthetic children provider can at least print their description accurately, if nothing else llvm-svn: 183805
* <rdar://problem/13646047>Enrico Granata2013-06-111-0/+40
| | | | | | | Providing a Python helper SBData.CreateDataFromInt() to make an SBData out of a single integer number It tries to use the current target, if any, for endianness and pointer size, and it picks a reasonable size on your behalf - if there is no way it can infer anything reasonable it essentially picks a 64-bit Mac as the reference model llvm-svn: 183793
* Adding properties to the SBBreakpoint classEnrico Granata2013-06-101-0/+20
| | | | llvm-svn: 183707
* <rdar://problem/11742979>Enrico Granata2013-05-0316-2/+98
| | | | | | | | | SWIG is smart enough to recognize that C++ operators == and != mean __eq__ and __ne__ in Python and do the appropriate translation But it is not smart enough to recognize that mySBObject == None should return False instead of erroring out The %pythoncode blocks are meant to provide those extra smarts (and they play some SWIG&Python magic to find the right function to call behind the scenes with no risk of typos :-) Lastly, SBBreakpoint provides an == but never provided a != operator - common courtesy is to provide both llvm-svn: 180987
* <rdar://problem/13499317>Enrico Granata2013-05-021-1/+1
| | | | | | | | Enabling Python commands to produce Unicode output via: result.PutCString(u”whatever”) llvm-svn: 180930
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-183-3/+3
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-183-3/+3
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* 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
* <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
* - Masking out SBCommandReturnObject::Printf() from the Python layer because ↵Enrico Granata2013-03-251-2/+8
| | | | | | | | | | 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/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
OpenPOWER on IntegriCloud