summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface/SBProcess.i
Commit message (Collapse)AuthorAgeFilesLines
* Start to share SWIG interface files between languages.Bruce Mitchener2015-04-241-496/+0
| | | | | | | | | | | | | | | | | | | | Summary: Move scripts/Python/interface to scripts/interface so that we can start making iterative improvements towards sharing the interface files between multiple languages (each of which would have their own directory as now). Test Plan: Build and see. Reviewers: zturner, emaste, clayborg Reviewed By: clayborg Subscribers: mjsabby, lldb-commits Differential Revision: http://reviews.llvm.org/D9212 llvm-svn: 235676
* Add a IsInstrumentationRuntimePresent SB APIKuba Brecka2014-10-111-0/+3
| | | | | | | | | | Reviewed at http://reviews.llvm.org/D5738 This adds an SB API into SBProcess: bool SBProcess::IsInstrumentationRuntimePresent(InstrumentationRuntimeType type); which simply tells whether a particular InstrumentationRuntime (read "ASan") plugin is present and active. llvm-svn: 219560
* Implement ASan history threads in SB APIKuba Brecka2014-09-061-0/+3
| | | | | | | | | Reviewed at http://reviews.llvm.org/D5219 and http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140901/012809.html llvm-svn: 217300
* Add API control of the signal disposition.Todd Fiala2014-06-231-0/+3
| | | | | | | | | | | | See http://reviews.llvm.org/D4221 for details. This commit allows you to control the signals that lldb will suppress, stop or forward using the Python and C++ APIs. Change by Russell Harmon. Xcode build system changes (and any mistakes) by Todd Fiala. Tested on MacOSX 10.9.3 and Xcode 6 beta. (Xcode 5 is hitting the dependency checker crasher on all my systems). llvm-svn: 211526
* lldb arm64 import.Jason Molenda2014-03-291-0/+3
| | | | | | | | | | | | | | | | 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 new Queue, QueueItem, Queuelist, SBQueue, SBQueueItem classes to representJason Molenda2013-12-131-0/+9
| | | | | | | | | 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
* Rename extended backtrace methods to take out the "ThreadOrigin"Jason Molenda2013-11-061-4/+4
| | | | | | | bit from the method names. <rdar://problem/15314369> llvm-svn: 194122
* Add the GetNumThreadOriginExtendedBacktraceTypes andJason Molenda2013-11-051-0/+20
| | | | | | | | | | | GetThreadOriginExtendedBacktraceTypeAtIndex methods to SBProcess. Add documentation for the GetQueueName and GetQueueID methods to SBThread. <rdar://problem/15314369> llvm-svn: 194063
* 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
* Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction ↵Jim Ingham2013-02-091-0/+6
| | | | | | | | | | | 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
* <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
* <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
* 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/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
* Add API to get the process plugin name & short name.Jim Ingham2012-10-261-0/+6
| | | | llvm-svn: 166799
* <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/12200505> Fixing a logical error in SBProcess, where the ↵Enrico Granata2012-10-081-2/+3
| | | | | | get_process_thread_list function was creating invalid threads_access instances, and hence failing to correctly fill in the list llvm-svn: 165421
* Added an lldb_private & equivalent SB API to send an AsyncInterrupt to the ↵Jim Ingham2012-07-271-0/+3
| | | | | | | | | | | | | | event loop. Convert from calling Halt in the lldb Driver.cpp's input reader's sigint handler to sending this AsyncInterrupt so it can be handled in the event loop. If you are attaching and get an async interrupt, abort the attach attempt. Also remember to destroy the process if get interrupted while attaching. Getting this to work also required handing the eBroadcastBitInterrupt in a few more places in Process WaitForEvent & friends. <rdar://problem/10792425> llvm-svn: 160903
* Add accessors on process to get & set the selected thread by IndexID (useful ↵Jim Ingham2012-07-131-0/+21
| | | | | | since that's the one that "thread list" shows and it won't get reused even if the underlying system thread ID gets reused. llvm-svn: 160187
* Added documentation for many of our python properties and also made the ↵Greg Clayton2012-06-291-13/+13
| | | | | | property help show up by declaring the properties correctly. We previosly declared properties into a local "x" variable, what I didn't realize is that the help will use this as the property name for the help output. llvm-svn: 159468
* Fixed the get_process_thread_list function to correctly return a list of all ↵Greg Clayton2012-06-271-1/+1
| | | | | | threads in a process. llvm-svn: 159288
* Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it ↵Johnny Chen2012-05-231-0/+3
| | | | | | | | through the Python scripting bridge. Add/modify some test cases. llvm-svn: 157353
* Make every Python API __len__() method return a PyIntObject.Filipe Cabecinhas2012-05-111-1/+2
| | | | | | | swig 2.0+ seems to default to using PyLongObjects, but the __len__() method _must_ return a PyIntObject. llvm-svn: 156639
* Add a general mechanism to wait on the debugger for Broadcasters of a given ↵Jim Ingham2012-02-161-0/+3
| | | | | | | | | class/event bit set. Use this to allow the lldb Driver to emit notifications for breakpoint modifications. <rdar://problem/10619974> llvm-svn: 150665
* Send Breakpoint Changed events for all the relevant changes to breakpoints.Jim Ingham2012-02-081-0/+3
| | | | | | | Also, provide and use accessors for the thread options on breakpoints so we can control sending the appropriate events. llvm-svn: 150057
* Cleaned up the documentation strings for many helper objects and addedGreg Clayton2012-02-031-7/+7
| | | | | | lldb.SBModule.section and lldb.SBModule.sections property access. llvm-svn: 149665
* Added many more python convenience accessors:Greg Clayton2012-02-011-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now access a frame in a thread using: lldb.SBThread.frame[int] -> lldb.SBFrame object for a frame in a thread Where "int" is an integer index. You can also access a list object with all of the frames using: lldb.SBThread.frames => list() of lldb.SBFrame objects All SB objects that give out SBAddress objects have properties named "addr" lldb.SBInstructionList now has the following convenience accessors for len() and instruction access using an index: insts = lldb.frame.function.instructions for idx in range(len(insts)): print insts[idx] Instruction lists can also lookup an isntruction using a lldb.SBAddress as the key: pc_inst = lldb.frame.function.instructions[lldb.frame.addr] lldb.SBProcess now exposes: lldb.SBProcess.is_alive => BOOL Check if a process is exists and is alive lldb.SBProcess.is_running => BOOL check if a process is running (or stepping): lldb.SBProcess.is_running => BOOL check if a process is currently stopped or crashed: lldb.SBProcess.thread[int] => lldb.SBThreads for a given "int" zero based index lldb.SBProcess.threads => list() containing all lldb.SBThread objects in a process SBInstruction now exposes: lldb.SBInstruction.mnemonic => python string for instruction mnemonic lldb.SBInstruction.operands => python string for instruction operands lldb.SBInstruction.command => python string for instruction comment SBModule now exposes: lldb.SBModule.uuid => uuid.UUID(), an UUID object from the "uuid" python module lldb.SBModule.symbol[int] => lldb.Symbol, lookup symbol by zero based index lldb.SBModule.symbol[str] => list() of lldb.Symbol objects that match "str" lldb.SBModule.symbol[re] => list() of lldb.Symbol objecxts that match the regex lldb.SBModule.symbols => list() of all symbols in a module SBAddress objects can now access the current load address with the "lldb.SBAddress.load_addr" property. The current "lldb.target" will be used to try and resolve the load address. Load addresses can also be set using this accessor: addr = lldb.SBAddress() addd.load_addr = 0x123023 Then you can check the section and offset to see if the address got resolved. SBTarget now exposes: lldb.SBTarget.module[int] => lldb.SBModule from zero based module index lldb.SBTarget.module[str] => lldb.SBModule by basename or fullpath or uuid string lldb.SBTarget.module[uuid.UUID()] => lldb.SBModule whose UUID matches lldb.SBTarget.module[re] => list() of lldb.SBModule objects that match the regex lldb.SBTarget.modules => list() of all lldb.SBModule objects in the target SBSymbol now exposes: lldb.SBSymbol.name => python string for demangled symbol name lldb.SBSymbol.mangled => python string for mangled symbol name or None if there is none lldb.SBSymbol.type => lldb.eSymbolType enum value lldb.SBSymbol.addr => SBAddress object that represents the start address for this symbol (if there is one) lldb.SBSymbol.end_addr => SBAddress for the end address of the symbol (if there is one) lldb.SBSymbol.prologue_size => pythin int containing The size of the prologue in bytes lldb.SBSymbol.instructions => SBInstructionList containing all instructions for this symbol SBFunction now also has these new properties in addition to what is already has: lldb.SBFunction.addr => SBAddress object that represents the start address for this function lldb.SBFunction.end_addr => SBAddress for the end address of the function lldb.SBFunction.instructions => SBInstructionList containing all instructions for this function SBFrame now exposes the SBAddress for the frame: lldb.SBFrame.addr => SBAddress which is the section offset address for the current frame PC These are all in addition to what was already added. Documentation and website updates coming soon. llvm-svn: 149489
* Added the ability to get the target triple, byte order and address byte sizeGreg Clayton2012-01-291-0/+27
| | | | | | | from the SBTarget and SBModule interfaces. Also added many python properties for easier access to many things from many SB objects. llvm-svn: 149191
* Patch from Enrico Granata that moves SBData related functions into the SBDataGreg Clayton2012-01-071-18/+0
| | | | | | | class instead of requiring a live process in order to be able to create useful SBData objects. llvm-svn: 147702
* http://llvm.org/bugs/show_bug.cgi?id=11619Johnny Chen2012-01-061-0/+19
| | | | | | | | Allow creating SBData values from arrays or primitives in Python Patch submitted by Enrico Granata. llvm-svn: 147639
* Add fuzz calls for newly added SBProcess methods. Fix a typo in the audodoc ↵Johnny Chen2011-12-151-1/+1
| | | | | | of SBProcess.ReadCStringFromMemory(). llvm-svn: 146695
* Expose new read memory fucntion through python in SBProcess:Greg Clayton2011-12-151-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | size_t SBProcess::ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error); uint64_t SBProcess::ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error); lldb::addr_t SBProcess::ReadPointerFromMemory (addr_t addr, lldb::SBError &error); These ReadCStringFromMemory() has some SWIG type magic that makes it return the python string directly and the "buf" is not needed: error = SBError() max_cstr_len = 256 cstr = lldb.process.ReadCStringFromMemory (0x1000, max_cstr_len, error) if error.Success(): .... The other two functions behave as expteced. This will make it easier to get integer values from the inferior process that are correctly byte swapped. Also for pointers, the correct pointer byte size will be used. Also cleaned up a few printf style warnings for the 32 bit lldb build on darwin. llvm-svn: 146636
* SBProcess.PutSTDIN() needs to be properly typemapped when swigging,Johnny Chen2011-11-281-0/+4
| | | | | | | | | | | | | | | | | so that we can do Python scripting like this: target = self.dbg.CreateTarget(self.exe) self.dbg.SetAsync(True) process = target.LaunchSimple(None, None, os.getcwd()) process.PutSTDIN("Line 1 Entered.\n") process.PutSTDIN("Line 2 Entered.\n") process.PutSTDIN("Line 3 Entered.\n") Add TestProcessIO.py to exercise the process IO API: PutSTDIN()/GetSTDOUT()/GetSTDERR(). llvm-svn: 145282
* Clarify the SBProcess Python API GetSTDOUT()/GetSTDERR(). They look ↵Johnny Chen2011-11-281-0/+10
| | | | | | | | different from the C++ API due to swig typemapping. llvm-svn: 145260
* Add SWIG Python interface files for SBProcess, SBThread, and SBFrame.Johnny Chen2011-07-181-0/+220
llvm-svn: 135419
OpenPOWER on IntegriCloud