summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/interface
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* 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
* <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
* 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
* Add API to get the process plugin name & short name.Jim Ingham2012-10-261-0/+6
| | | | llvm-svn: 166799
* <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-221-0/+15
| | | | | | | | | | | 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-163-0/+110
| | | | | | | | | | "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-102-0/+65
| | | | | | 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
* Fix a build warning and a dangerous possible crasher.Greg Clayton2012-10-081-1/+1
| | | | llvm-svn: 165460
* <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
* Add one-shot breakpoints (-o option to "break set") and a tbreak alias for ↵Jim Ingham2012-10-051-0/+6
| | | | | | our gdb friends. llvm-svn: 165328
* <rdar://problem/12099999> renaming SBStream::Printf to Print in the ↵Enrico Granata2012-10-041-3/+9
| | | | | | scripting world in order to avoid supporting varargs through SWIG llvm-svn: 165274
* Implementing plugins that provide commands.Enrico Granata2012-09-282-0/+6
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
* Add an API to figure out whether a breakpoint is internal or not.Jim Ingham2012-09-251-0/+3
| | | | llvm-svn: 164648
* Make the unwinding of the stack part of "thread return" work, and add the ↵Jim Ingham2012-09-141-1/+1
| | | | | | thread return command. llvm-svn: 163867
* Start at getting "thread return" working. Doesn't work yet.Jim Ingham2012-09-121-0/+3
| | | | llvm-svn: 163670
* Added SBDebugger's log callbacks to Python-landFilipe Cabecinhas2012-08-251-0/+6
| | | | | | | | | | | | | | | | | | | - Tweaked a parameter name in SBDebugger.h so my typemap will catch it; - Added a SBDebugger.Create(bool, callback, baton) to the swig interface; - Added SBDebugger.SetLoggingCallback to the swig interface; - Added a callback utility function for log callbacks; - Guard against Py_None on both callback utility functions; - Added a FIXME to the SBDebugger API test; - Added a __del__() stub for SBDebugger. We need to be able to get both the log callback and baton from an SBDebugger if we want to protect against memory leaks (or make the user responsible for holding another reference to the callback). Additionally, it's impossible to revert from a callback-backed log mechanism to a file-backed log mechanism. llvm-svn: 162633
* A baton isn't needed to dispatch input.Filipe Cabecinhas2012-08-201-1/+1
| | | | | | I also added a typemap to make DispatchInput usable in Python. llvm-svn: 162204
* <rdar://problem/11275622>Greg Clayton2012-07-311-1/+86
| | | | | | | | | | | | | | | | | | | | | | | | | Added new API to lldb::SBTypeMember for bitfields: bool SBTypeMember::IsBitfield(); uint32_t SBTypeMember::GetBitfieldSizeInBits(); Also added new properties for easy access. Now SBTypeMember objects in python have a "fields" property for all type fields, "bases" for all direct bases, "vbases" for all virtual base classes and "members" for a combo of all three organized by bit offset. They all return a python list() of SBTypeMember objects. Usage: (lldb) script >>> t = lldb.target.FindFirstType("my_type") >>> for field in t.fields: ... print field >>> for vbase in t.vbases: ... print vbase >>> for base in t.bases: ... print base >>> for member in t.members: ... print member Also added new "is_bitfield" property to the SBTypeMember objects that will return the result of SBTypeMember::IsBitfield(), and "bitfield_bit_size" which will return the result of SBTypeMember::GetBitfieldSizeInBits(); I also fixed "SBTypeMember::GetOffsetInBytes()" to return the correct byte offset. llvm-svn: 161091
* 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 "vAttachOrWait" to debugserver, so you can implement "attach to the ↵Jim Ingham2012-07-201-0/+6
| | | | | | process if it exists OR wait for it" without race conditions. Use that in lldb. llvm-svn: 160578
* Add accessors on process to get & set the selected thread by IndexID (useful ↵Jim Ingham2012-07-132-0/+27
| | | | | | 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-2927-238/+239
| | | | | | 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
* Added the ability to read the dSYM plist file with source remappings even ↵Greg Clayton2012-06-271-0/+3
| | | | | | | | when DebugSymbols isn't used to find the dSYM. We now parse the plist as XML in the MacOSX symbol vendor. Added the ability to get a section load address given a target which is needed for a previous checking which saves crashlogs. llvm-svn: 159298
* Modify the ranges_access() helper function to be able to lookup the address ↵Greg Clayton2012-06-271-0/+4
| | | | | | | | range in a block given an address. Since blocks can have multiple discontiguous ranges, it helps to be able to get the current address range for the current block in a frame. This can be used in code like: curr_block_range = lldb.frame.block.range[lldb.frame.addr] llvm-svn: 159289
* 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
* Make a way to set the result status for Python defined commands, and don't ↵Jim Ingham2012-06-271-0/+3
| | | | | | | | overwrite the status of the result if the python command has set it. llvm-svn: 159273
* Make raw & parsed commands subclasses of CommandObject rather than having ↵Jim Ingham2012-06-081-0/+3
| | | | | | | | | | | | | | | | the raw version implement an Execute which was never going to get run and another ExecuteRawCommandString. Took the knowledge of how to prepare raw & parsed commands out of CommandInterpreter and put it in CommandObject where it belongs. Also took all the cases where there were the subcommands of Multiword commands declared in the .h file for the overall command and moved them into the .cpp file. Made the CommandObject flags work for raw as well as parsed commands. Made "expr" use the flags so that it requires you to be paused to run "expr". llvm-svn: 158235
* rdar://problem/11584012Johnny Chen2012-06-043-6/+4
| | | | | | | | | | | Refactorings of watchpoint creation APIs so that SBTarget::WatchAddress(), SBValue::Watch(), and SBValue::WatchPointee() now take an additional 'SBError &error' parameter (at the end) to contain the reason if there is some failure in the operation. Update 'watchpoint set variable/expression' commands to take advantage of that. Update existing test cases to reflect the API change and add test cases to verify that the SBError mechanism works for SBTarget::WatchAddress() by passing an invalid watch_size. llvm-svn: 157964
* 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
* Add GetID to the .i file.Jim Ingham2012-05-161-0/+3
| | | | llvm-svn: 156927
* Found one more place where the OkayToDiscard needs to be consulted.Jim Ingham2012-05-111-0/+3
| | | | | | | Also changed the defaults for SBThread::Step* to not delete extant plans. Also added some test cases to test more complex stepping scenarios. llvm-svn: 156667
* Make every Python API __len__() method return a PyIntObject.Filipe Cabecinhas2012-05-119-11/+12
| | | | | | | swig 2.0+ seems to default to using PyLongObjects, but the __len__() method _must_ return a PyIntObject. llvm-svn: 156639
* Print out a notification when the process of a target other than the ↵Jim Ingham2012-05-081-0/+3
| | | | | | currently selected target stops. llvm-svn: 156433
* <rdar://problem/11239650> Fixing a bug where the SetValueFromCString() ↵Enrico Granata2012-05-081-0/+3
| | | | | | method failed to operate on dynamic values. The fix consists in making the set operation fall through to the parent. We only actually allow this if the dynamic value is at a 0-offset from the parent, or the new value is 0. Other scenarios would need agreement on the actual meaning of the set operation (do we keep offsetting? do we just assume the user knows what they are doing?) so we prevent them, and let the expression parser deal with the complexity llvm-svn: 156422
* <rdar://problem/11358639>Greg Clayton2012-05-081-1/+1
| | | | | | | | Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples. Also make the selection process for auto selecting platforms based off of an arch much better. llvm-svn: 156354
* Added the ability to specify the symbol file for a module when adding it to ↵Greg Clayton2012-04-231-0/+6
| | | | | | a target. llvm-svn: 155384
* Expose GetAddressClass() from both the SBAddress and SBInstruction so ↵Greg Clayton2012-04-132-1/+7
| | | | | | clients can tell the difference between ARM/Thumb opcodes when disassembling ARM. llvm-svn: 154633
* Added a property to get the dynamic type which uses the most permissive way ↵Greg Clayton2012-04-111-2/+8
| | | | | | to get a dynamic type. llvm-svn: 154502
OpenPOWER on IntegriCloud