summaryrefslogtreecommitdiffstats
path: root/lldb/examples/python
Commit message (Collapse)AuthorAgeFilesLines
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0631-3460/+6218
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Mention is_stale in the scripted step doc.Jim Ingham2016-08-051-7/+29
| | | | llvm-svn: 277884
* Fixup the "shadow" example command to use the function that takes an ↵Greg Clayton2016-06-281-28/+26
| | | | | | | | | | | execution context now that the @lldb.command decorator does the right thing for the command function that takes 5 arguments. A few fixes: - Check the process state to make sure it is stopped - Grab the frame from the "exe_ctx" so this will work during breakpoint callbacks - Print out the SBDeclaration objects of the variables that shadow each other so we can see the source locations of which variable declarations are shodowing each other. llvm-svn: 273963
* Added a new python example which installs a command called "shadow". Greg Clayton2016-06-231-0/+59
| | | | | | This shows how to grab individual blocks from stack frames and get only the variables from those blocks. It then will iterate over all of the parent blocks and look for shadowed variables. llvm-svn: 273604
* Fixed a few places that were building a regex from an identifier without ↵Greg Clayton2016-06-102-2/+2
| | | | | | | | escaping the identifier text. <rdar://problem/26090553> llvm-svn: 272423
* Another little example use of scripted thread plans.Jim Ingham2016-05-031-0/+25
| | | | llvm-svn: 268338
* Fix typos.Bruce Mitchener2015-09-221-1/+1
| | | | | | | | | | | | Summary: Another round of minor typo fixes. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13026 llvm-svn: 248243
* Fix process_events.py to auto continue the process if we attached so the ↵Greg Clayton2015-08-121-0/+6
| | | | | | process doesn't just sit there suspended. llvm-svn: 244801
* Fix typo in gdbremote.pyPavel Labath2015-07-281-1/+1
| | | | llvm-svn: 243421
* Improved the packet dumper to escape the response string before sending it ↵Greg Clayton2015-07-221-10/+77
| | | | | | to the response functions (find any 0x7d characters and remove it and XOR the next character with 0x20). This allows us to parse the JSON in the reply packet and display it correctly. llvm-svn: 242928
* Fix the yellow colorizing and fix some logic in the "A" packet dumper.Greg Clayton2015-07-201-2/+7
| | | | llvm-svn: 242709
* Handle dumping many more packet types including the A packet, qC, ↵Greg Clayton2015-07-171-34/+81
| | | | | | QSetDisableASLR, qLaunchSuccess and QLaunchArch. llvm-svn: 242586
* Added support for dumping 'x', 'X', 'qSymbol' packets. Also dump any XML ↵Greg Clayton2015-07-171-15/+121
| | | | | | retrieved from a qXfer packets. llvm-svn: 242566
* Allow gdbremote.py to take input from STDIN and handle "c" and "s" packets.Greg Clayton2015-07-171-9/+28
| | | | llvm-svn: 242490
* Improve the packet dumper to be able to read the target.xml so it can dump ↵Greg Clayton2015-07-021-10/+62
| | | | | | register values when disassembling the packet log. llvm-svn: 241307
* Another slightly less goofy example of scripted steps.Jim Ingham2015-07-021-0/+56
| | | | llvm-svn: 241216
* Add a missing space.Jim Ingham2015-07-011-1/+1
| | | | llvm-svn: 241181
* Remove a few uses of lldb.target, which is not validJim Ingham2015-06-231-5/+6
| | | | | | in a scripted command. llvm-svn: 240451
* Fix types.py to actually be able to run check_padding_command() without ↵Greg Clayton2015-06-011-1/+1
| | | | | | | | erroring out. <rdar://problem/21071347> llvm-svn: 238764
* Fix this module to work with current packects and also to be able to figure ↵Greg Clayton2015-05-221-15/+39
| | | | | | out average packets speed and standard deviation. llvm-svn: 238065
* Add a call to SBDebugger:Destroy() at the end of the self-hostedJason Molenda2015-04-011-0/+1
| | | | | | | | | | version of this script. We picked up a bug at some point in March where scripts that fail to call SBDebugger::Destroy() will crash in the Debugger C++ dtor. I want to track the change down which introduced the change - but this script should be calling SBDebugger::Destroy() in the first place, so do that. llvm-svn: 233779
* symbolicate the application specific backtraces that are in MacOSX crash log ↵Greg Clayton2015-03-052-77/+127
| | | | | | | | files. <rdar://problem/20039160> llvm-svn: 231415
* Improved the TreeItem delegate which simplifies making tree items:Greg Clayton2014-10-071-135/+419
| | | | | | | | - tree items can define any number of key/value pairs - creating a tree you specify which columns you want to display and it will pick out the right key/value pairs from the new tree item dictionaries - added new "tk-target" command to explore the target's images, sections, symbols, compile units and line tables. llvm-svn: 219219
* Fix some errors that crept in when I cut & pasted into emacs.Jim Ingham2014-09-301-16/+16
| | | | llvm-svn: 218656
* Add a very trivial example for scripted stepping.Jim Ingham2014-09-301-0/+130
| | | | llvm-svn: 218650
* Played around with TK UI a bit this weekend.Greg Clayton2014-09-221-0/+260
| | | | | | | | | | | | | If you "command script import" this file, then you will have two new commands: (lldb) tk-variables (lldb) tk-process Not sure how this will work on all other systems, but on MacOSX, you will get a window with a tree view that allows you to inspect your local variables by expanding variables to see the child values. The "tk-process" allows you to inspect the currently selected process by expanding the process to see the threads, the threads to see the frames, and the frames to see the variables. Very handy if you want to view variables for all frames simultaneously. llvm-svn: 218279
* Don't use "lldb." global variables in LLDB commands.Greg Clayton2014-07-111-1/+4
| | | | llvm-svn: 212852
* Fix typos.Bruce Mitchener2014-07-013-12/+12
| | | | llvm-svn: 212132
* Allow classes to be intialized using current lldb::SB objects. This can help ↵Greg Clayton2014-05-281-4/+55
| | | | | | to import/export the current process state. llvm-svn: 209702
* Fixed an issue where if you called:Greg Clayton2014-04-071-1/+2
| | | | | | | | | | | | | | | | | SBTarget::AddModule(const char *path, const char *triple, const char *uuid_cstr, const char *symfile); If "symfile" was filled in, it would cause us to not correctly add the module. Same goes for: SBTarget::AddModule(SBModuleSpec ...) Where you filled in the symfile. <rdar://problem/16529799> llvm-svn: 205750
* Add example target description file for QEMU for x86-64.Hafiz Abid Qadeer2014-02-201-0/+352
| | | | llvm-svn: 201790
* Added a new lldb command that can parse all struct and class types for one ↵Greg Clayton2014-01-231-1/+14
| | | | | | or more shared libraries. llvm-svn: 199937
* Fix to only update the offset for concrete registers (ones that don't have ↵Greg Clayton2013-12-131-1/+1
| | | | | | 'slice' or 'composite' key/value pairs). llvm-svn: 197191
* Adjust PC after hitting breakpoint on remote target.Hafiz Abid Qadeer2013-10-181-0/+353
| | | | | | | | This commit adds an example python file that can be used with 'target-definition-file' setting for Linux gdbserver. This file has an extra key 'breakpoint-pc-offset' that LLDB uses to determine how much to change the PC after hitting the breakpoint. llvm-svn: 192962
* <rdar://problem/14972424>Greg Clayton2013-10-171-58/+117
| | | | | | | | | | | | | | | - Made the dynamic register context for the GDB remote plug-in inherit from the generic DynamicRegisterInfo to avoid code duplication - Finished up the target definition python setting stuff. - Added a new "slice" key/value pair that can specify that a register is part of another register: { 'name':'eax', 'set':0, 'bitsize':32, 'encoding':eEncodingUint, 'format':eFormatHex, 'slice': 'rax[31:0]' }, - Added a new "composite" key/value pair that can specify that a register is made up of two or more registers: { 'name':'d0', 'set':0, 'bitsize':64 , 'encoding':eEncodingIEEE754, 'format':eFormatFloat, 'composite': ['s1', 's0'] }, - Added a new "invalidate-regs" key/value pair for when a register is modified, it can invalidate other registers: { 'name':'cpsr', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint, 'format':eFormatHex, 'invalidate-regs': ['r8', 'r9', 'r10', 'r11', 'r12', 'r13', 'r14', 'r15']}, This now completes the feature that allows a GDB remote target to completely describe itself. llvm-svn: 192858
* <rdar://problem/14972424>Greg Clayton2013-10-151-0/+298
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging with the GDB remote in LLDB, LLDB uses special packets to discover the registers on the remote server. When those packets aren't supported, LLDB doesn't know what the registers look like. This checkin implements a setting that can be used to specify a python file that contains the registers definitions. The setting is: (lldb) settings set plugin.process.gdb-remote.target-definition-file /path/to/module.py Inside module there should be a function: def get_dynamic_setting(target, setting_name): This dynamic setting function is handed the "target" which is a SBTarget, and the "setting_name", which is the name of the dynamic setting to retrieve. For the GDB remote target definition the setting name is 'gdb-server-target-definition'. The return value is a dictionary that follows the same format as the OperatingSystem plugins follow. I have checked in an example file that implements the x86_64 GDB register set for people to see: examples/python/x86_64_target_definition.py This allows LLDB to debug to any archticture that is support and allows users to define the registers contexts when the discovery packets (qRegisterInfo, qHostInfo) are not supported by the remote GDB server. A few benefits of doing this in Python: 1 - The dynamic register context was already supported in the OperatingSystem plug-in 2 - Register contexts can use all of the LLDB enumerations and definitions for things like lldb::Format, lldb::Encoding, generic register numbers, invalid registers numbers, etc. 3 - The code that generates the register context can use the program to calculate the register context contents (like offsets, register numbers, and more) 4 - True dynamic detection could be used where variables and types could be read from the target program itself in order to determine which registers are available since the target is passed into the python function. This is designed to be used instead of XML since it is more dynamic and code flow and functions can be used to make the dictionary. llvm-svn: 192646
* Added a "sources.py" which adds a command that can print out the source ↵Greg Clayton2013-09-044-0/+1997
| | | | | | | | files contained in one or more modules. Added "mach_o.py" which is a mach-o parser that can dump mach-o file contents and also extract sections. It uses the "file_extract" module and the "dict_utils" module. llvm-svn: 189959
* Fix typeo in diagnose-unwind.py.Jason Molenda2013-07-151-1/+1
| | | | llvm-svn: 186358
* Enabled the "--debug" option functionality that will SIGSTOP the current ↵Greg Clayton2013-07-121-0/+5
| | | | | | process allowing a debugger to attach. llvm-svn: 186194
* Added a memory.py module that contains a 'memfind' command which allows you ↵Greg Clayton2013-07-111-0/+181
| | | | | | to search memory for a byte pattern. llvm-svn: 186127
* Tweaks to the Python reference and example command to use the preferred ↵Enrico Granata2013-07-111-5/+5
| | | | | | print style and the (finally available :-) SetError API llvm-svn: 186122
* Add the frame content dumper function call to one more place.Jason Molenda2013-07-091-0/+2
| | | | llvm-svn: 185906
* Add new information gathering to the lldb & simple backtrace methods:Jason Molenda2013-07-091-5/+30
| | | | | | | print five words of memory at the beginning of the stack frame so it's easier to track where an incorrect saved-fp or saved-pc may have come from. llvm-svn: 185903
* A bit more cleanup on the process_events.py to use best practices for event ↵Greg Clayton2013-06-271-54/+72
| | | | | | handling. llvm-svn: 185089
* Update the platform options help strings.Greg Clayton2013-06-263-3/+3
| | | | llvm-svn: 185028
* Fixed the process_events.py example to be able to specify the platform and ↵Greg Clayton2013-06-261-64/+63
| | | | | | also use the debugger's listener. llvm-svn: 185027
* Added a regex that can be specified to avoid showing contents on types that ↵Greg Clayton2013-06-221-70/+105
| | | | | | match. Also split things up a bit so this can be run as a stand alone script or in lldb. llvm-svn: 184628
* Also report any OS python plugin in use.Jason Molenda2013-06-201-0/+3
| | | | llvm-svn: 184487
* Print the general purpose registers for frame 0.Jason Molenda2013-06-201-0/+8
| | | | llvm-svn: 184483
* Cleanup the output a bit by removing old print statements and also printing ↵Greg Clayton2013-06-201-4/+4
| | | | | | the number of types found. llvm-svn: 184389
OpenPOWER on IntegriCloud