Author: Dave Lee Date: 2021-04-01T09:53:07-07:00 New Revision: 0c653d4c3d1426267337576ab202bb594144111c
URL: https://github.com/llvm/llvm-project/commit/0c653d4c3d1426267337576ab202bb594144111c DIFF: https://github.com/llvm/llvm-project/commit/0c653d4c3d1426267337576ab202bb594144111c.diff LOG: [lldb] Update test.rst with a paragraph about pdb Debugging tests sometimes involves debugging the Python source. This adds a paragraph to the "Debugging Test Failures" section about using `pdb`, and also describes how to run lldb commands from pdb. Differential Revision: https://reviews.llvm.org/D99744 Added: Modified: lldb/docs/resources/test.rst Removed: ################################################################################ diff --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst index e066f8e209a14..2c08ddde28dc4 100644 --- a/lldb/docs/resources/test.rst +++ b/lldb/docs/resources/test.rst @@ -373,7 +373,20 @@ Debugging Test Failures ----------------------- On non-Windows platforms, you can use the ``-d`` option to ``dotest.py`` which -will cause the script to wait for a while until a debugger is attached. +will cause the script to print out the pid of the test and wait for a while +until a debugger is attached. Then run ``lldb -p <pid>`` to attach. + +To instead debug a test's python source, edit the test and insert +``import pdb; pdb.set_trace()`` at the point you want to start debugging. In +addition to pdb's debugging facilities, lldb commands can be executed with the +help of a pdb alias. For example ``lldb bt`` and ``lldb v some_var``. Add this +line to your ``~/.pdbrc``: + +:: + + alias lldb self.dbg.HandleCommand("%*") + +:: Debugging Test Failures on Windows `````````````````````````````````` _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits