summaryrefslogtreecommitdiff
path: root/lldb/examples/python/gdbremote.py
AgeCommit message (Collapse)Author
2025-02-28[lldb] fix(lldb/**.py): fix invalid escape sequences (#94034)Eisuke Kawashima
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2023-01-12[lldb] Update custom commands to always be overrridenMed Ismail Bennani
This is a follow-up patch to 6f7835f309b9. As explained previously, when running from an IDE, it can happen that the IDE imports some lldb scripts by itself. If the user also tries to import these commands, lldb will show the following message: ``` error: cannot add command: user command exists and force replace not set ``` This message is confusing to the user, because it suggests that the command import failed and that the execution should stop. However, in this case, lldb will continue the execution with the command added previously by the user. To prevent that, this patch updates every first-party lldb-packaged custom commands to override commands that were pre-imported in lldb. Differential Revision: https://reviews.llvm.org/D140293 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-15[LLDB] Remove __future__ imports from examplesDavid Spickett
Not needed now that we require python 3. Reviewed By: kastiglione, JDevlieghere Differential Revision: https://reviews.llvm.org/D131772
2022-03-02[lldb] Fix python errors in gdbremote.pyDominic Chen
Fix exceptions encountered while debugging gdb protocol Differential Revision: https://reviews.llvm.org/D120792
2022-01-13[lldb] Use __lldb_init_module instead of "if lldb.debugger" idiomDave Lee
Update examples and docs to demonstrate using `__lldb_init_module` instead of the idiom that checks for `lldb.debugger` at the top-level. ``` if __name__ == '__main__': ... elif lldb.debugger: ... ``` Is replaced with: ``` if __name__ == '__main__': ... def __lldb_init_module(debugger, internal_dict): ... ``` This change is for two reasons. First, it's generally encouraged not to only use the convenience singletons (`lldb.{debugger,process,target,etc}`) interactively from the `script` command. Second, there's a bug where registering a python class as a command (using `command script add -c ...`), result in the command not being runnable. Note that registering function-backed commands does not have this bug. Differential Revision: https://reviews.llvm.org/D117237
2020-07-16Harmonize Python shebangserge-sans-paille
Differential Revision: https://reviews.llvm.org/D83857
2020-02-13[lldb] Make gdbremote.py utility py2and3 compatiblePavel Labath
2019-03-26python 2/3 compat: commands vs subprocessSerge Guelton
Differential Revision: https://reviews.llvm.org/D59584 llvm-svn: 356995
2019-03-21Python 2/3 compatibility: from __future__ import print_functionSerge Guelton
Differential Revision: https://reviews.llvm.org/D59580 llvm-svn: 356695
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
2017-04-14Fixed to disassemble new packets and fixed the dumping of the 'x' packets.Greg Clayton
llvm-svn: 300341
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
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-05-22Fix this module to work with current packects and also to be able to figure ↵Greg Clayton
out average packets speed and standard deviation. llvm-svn: 238065
2014-07-01Fix typos.Bruce Mitchener
llvm-svn: 212132
2012-08-20Added qVAttachOrWaitSupported packet support.Greg Clayton
llvm-svn: 162207
2012-06-04Cleaned up some stuff in symbolication where we can now lazily get images ↵Greg Clayton
when symbolicating after loading a crash log file. Added colorization to the gdbremote.py output and also added the ability to symbolicate the addresses in registers. llvm-svn: 157965
2012-06-01Added the ability to disassembly GDB remote packets with the python file. ↵Greg Clayton
This will make it easier to symbolicate the packet log output since we can use the lldb.utils.symbolication package module to symbolicate register values. llvm-svn: 157835
2012-03-29When running this from the command line, don't pass the python script file ↵Greg Clayton
itself to be disassembled. llvm-svn: 153626
2012-03-01Add an option to sort by packet count (rather than time). Also print the count,Jim Ingham
and to print the total count & time in the header. llvm-svn: 151823
2012-01-26Added a 'gdbremote' python module that adds two commands: start_gdb_log and ↵Greg Clayton
end_gdb_log. When this is imported into your lldb using the "command script import /path/to/gdbremote.py" these new commands are available within LLDB. 'start_gdb_log' will enable logging with timestamps for GDB remote packets, and 'stop_gdb_log' will then dump the details and also a lot of packet timing data. This allows us to accurately track what packets are taking up the most time when debugging (when using the ProcessGDBRemote debugging plug-in). Also udpated the comments at the top of the cmdtemplate.py to show how to correctly import the module from within LLDB. llvm-svn: 149030