summaryrefslogtreecommitdiff
path: root/lldb/examples/python
AgeCommit message (Collapse)Author
2019-05-18[crashlog] Use loads() instead of readPlistFromString() for python 3.Davide Italiano
<rdar://problem/50903413> llvm-svn: 361087
2019-04-18[Python] Simplify the code. NFCI.Davide Italiano
llvm-svn: 358721
2019-04-18[crashlog] Strip trailing `\n` from check_output return.Davide Italiano
Generally having spurious `\n` doesn't matter, but here the returning string is a command which is executed, so we want to strip it. Pointed out by Jason. llvm-svn: 358717
2019-04-17[crashlog] Use the right path for dsymforUUID and remove an unnecessary import.Davide Italiano
<rdar://problem/49925960> llvm-svn: 358615
2019-03-26python 2/3 compat: commands vs subprocessSerge Guelton
Differential Revision: https://reviews.llvm.org/D59584 llvm-svn: 356995
2019-03-25Python 2/3 compat: StringIOSerge Guelton
Differential Revision: https://reviews.llvm.org/D59582 llvm-svn: 356910
2019-03-25Python 2/3 compat: tkinterSerge Guelton
Differential Revision: https://reviews.llvm.org/D59586 llvm-svn: 356909
2019-03-21Python 2/3 compatibility: from __future__ import print_functionSerge Guelton
Differential Revision: https://reviews.llvm.org/D59580 llvm-svn: 356695
2019-03-21Workaround items/iteritems difference between Python2 and Python3Serge Guelton
Differential Revision: https://reviews.llvm.org/D59588 llvm-svn: 356673
2019-03-21Portable int/long conversion across Python 2 / Python 3Serge Guelton
Differential Revision: https://reviews.llvm.org/D59585 llvm-svn: 356671
2019-03-21Portable exception value access across Python 2 / Python 3Serge Guelton
Differential Revision: https://reviews.llvm.org/D59583 llvm-svn: 356670
2019-03-18A target definition file that may work for Jason Molenda
Aarch32 Cortex-M target processor debugging. <rdar://problem/48448564> llvm-svn: 356416
2019-03-07crashlog.py: Catch exception from subprocess.Adrian Prantl
llvm-svn: 355572
2019-03-06[Python] Unbreak the recently modified tests for python 2.Davide Italiano
llvm-svn: 355566
2019-03-06[testsuite] Port crashlog to python 3, second attempt.Davide Italiano
llvm-svn: 355562
2019-03-05Revert "[testsuite] Port crashlog and dependencies to Python 3."Davide Italiano
This revert the commit because it broke the bots. I need to find a way that works with both versions. llvm-svn: 355364
2019-03-05[testsuite] Port crashlog and dependencies to Python 3.Davide Italiano
Fixes three tests in the testsuite. llvm-svn: 355359
2019-01-31Fix use of non-existing variable in crashlog.pyShafik Yaghmour
Summary: The method find_matching_slice(self) uses uuid_str on one of the paths but the variable does not exist and so this results in a NameError exception if we take that path. Differential Revision: https://reviews.llvm.org/D57467 llvm-svn: 352772
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-12-17Make crashlog.py work or binaries with spaces in their namesAdrian Prantl
This is a little dangerous since the crashlog files aren't 100% unambiguous, but the risk is mitigated by using a non-greedy +? pattern. rdar://problem/38478511 Differential Revision: https://reviews.llvm.org/D55608 llvm-svn: 349367
2018-12-17Make crashlog.py work when a .dSYM is present, but a binary is missingAdrian Prantl
Often users have a crash log an d a .dSYM bundle, but not the original application binary. It turns out that for crash symbolication, we can safely fall back to using the binary inside the .dSYM bundle. Differential Revision: https://reviews.llvm.org/D55607 llvm-svn: 349366
2018-09-27Fixes for GDB remote packet disassembler:Greg Clayton
- Add latency timings to GDB packet log summary if timestamps are on log - Add the ability to plot the latencies for each packet type with --plot - Don't crash the script when target xml register info is in wierd format llvm-svn: 343243
2018-09-27Add an interactive mode to BSD archive parser.Greg Clayton
llvm-svn: 343242
2018-06-22Update cmdtemplate.py to use best pratices.Greg Clayton
Fixes include: - fix all lint errors - add code that will automatically register and LLDB command classes by detecting the classes and any classes that have a "register_lldb_command" function - automatically fill in the correct module name when registering commands - automatically fill in the class name when registering command llvm-svn: 335401
2018-04-02Added a BSD archive tool.Greg Clayton
This is a combination stand alone BSD archive tool that can dump BSD archives: % bsd.py /path/to/foo.a Search archives for an object file: % bsd.py --object foo.o bar.a Dump the symbol definitions found in the __.SYMDEF objects: % bsd.py --symdef bar.a Find symbols by name that are listed in the __.SYMDEF objects: % bsd.py --symbol _Z123 bar.a Extract objects from BSD archives: % bsd.py --object foo.o bar.a --extract % bsd.py --object foo.o bar.a --extract --outfile /tmp/foo.o % bsd.py --object foo.o bar.a --extract --mtime 0x1234556 It also has installs a new LLDB command line command when imported into LLDB: (lldb) command script import ~/Dropbox/bin/bsd.py The "verify-debug-map-objects" command has been installed, type "help verify-debug-map-objects" for detailed help. (lldb) verify-debug-map-objects a.out This will iterate through all object files and verify the modification times match for any .o files, it will verify any .o files from BSD archives are found and have matching modification times and print out errors if any are found. llvm-svn: 328990
2017-11-16Fixed up to use a class for the commands, renamed the commands and added a ↵Greg Clayton
way to just dump the compile unit full paths and optionally their support files with the new "dump-files"command. llvm-svn: 318424
2017-10-31Modernize the example cmdtemplate.py.Jim Ingham
This version relies on a newer and more convenient way to use a class to implement a command. It has been in place since early 2015, so it should be pretty safe to use. llvm-svn: 317043
2017-10-12The save_crashlog command was still looking at lldb.target andJim Ingham
lldb.process. That hasn't worked for a long time. Convert it to the form that takes an SBExecutionContext and use that instead. llvm-svn: 315549
2017-10-05Another silly little thing you can do with Python commands.Jim Ingham
Sometimes you want to step along and print a local each time as you go. You can do that with stop hooks, but that's a little heavy-weight. This is a sketch of a command that steps and then does "frame variable" on all its arguments. llvm-svn: 314958
2017-04-20Add an example command to toggle between disassembly-only and source mode.Jim Ingham
Sometimes you are debugging in source, but you really only want to see the disassembly. That's easy to do but you have to set a few variables. This command toggles between your old values, and a disassembly only mode. llvm-svn: 300902
2017-04-14Fixed to disassemble new packets and fixed the dumping of the 'x' packets.Greg Clayton
llvm-svn: 300341
2017-03-28Print the error if dsymForUUID sometimes produces bad plists.Jim Ingham
Not much we can do about it but at least we can print the bad plist and the error. llvm-svn: 298958
2016-12-08Improve crashlog.py so it can handle more iOS crashlog files.Greg Clayton
<rdar://problem/29191857> llvm-svn: 289006
2016-09-06*** This commit represents a complete reformatting of the LLDB source codeKate Stone
*** 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
2016-08-05Mention is_stale in the scripted step doc.Jim Ingham
llvm-svn: 277884
2016-06-28Fixup the "shadow" example command to use the function that takes an ↵Greg Clayton
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
2016-06-23Added a new python example which installs a command called "shadow". Greg Clayton
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
2016-06-10Fixed a few places that were building a regex from an identifier without ↵Greg Clayton
escaping the identifier text. <rdar://problem/26090553> llvm-svn: 272423
2016-05-03Another little example use of scripted thread plans.Jim Ingham
llvm-svn: 268338
2015-09-22Fix typos.Bruce Mitchener
Summary: Another round of minor typo fixes. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13026 llvm-svn: 248243
2015-08-12Fix process_events.py to auto continue the process if we attached so the ↵Greg Clayton
process doesn't just sit there suspended. llvm-svn: 244801
2015-07-28Fix typo in gdbremote.pyPavel Labath
llvm-svn: 243421
2015-07-22Improved the packet dumper to escape the response string before sending it ↵Greg Clayton
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
2015-07-20Fix the yellow colorizing and fix some logic in the "A" packet dumper.Greg Clayton
llvm-svn: 242709
2015-07-17Handle dumping many more packet types including the A packet, qC, ↵Greg Clayton
QSetDisableASLR, qLaunchSuccess and QLaunchArch. llvm-svn: 242586
2015-07-17Added support for dumping 'x', 'X', 'qSymbol' packets. Also dump any XML ↵Greg Clayton
retrieved from a qXfer packets. llvm-svn: 242566
2015-07-17Allow gdbremote.py to take input from STDIN and handle "c" and "s" packets.Greg Clayton
llvm-svn: 242490
2015-07-02Improve the packet dumper to be able to read the target.xml so it can dump ↵Greg Clayton
register values when disassembling the packet log. llvm-svn: 241307
2015-07-02Another slightly less goofy example of scripted steps.Jim Ingham
llvm-svn: 241216
2015-07-01Add a missing space.Jim Ingham
llvm-svn: 241181