diff --git a/doc_src/language.rst b/doc_src/language.rst index bcbdc1627..89c9d38a4 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -1786,8 +1786,8 @@ For more information on how to define new event handlers, see the documentation Debugging fish scripts ---------------------- -Fish includes a built-in debugging facility. The debugger allows you to stop execution of a script at an arbitrary point. When this happens you are presented with an interactive prompt. At this prompt you can execute any fish command (there are no debug commands as such). For example, you can check or change the value of any variables using :doc:`printf ` and :doc:`set `. As another example, you can run :doc:`status print-stack-trace ` to see how this breakpoint was reached. To resume normal execution of the script, simply type :doc:`exit ` or :kbd:`Control`\ +\ :kbd:`D`. +Fish includes basic built-in debugging facilities that allow you to stop execution of a script at an arbitrary point. When this happens you are presented with an interactive prompt where you can execute any fish command to inspect or change state (there are no debug commands as such). For example, you can check or change the value of any variables using :doc:`printf ` and :doc:`set `. As another example, you can run :doc:`status print-stack-trace ` to see how the current breakpoint was reached. To resume normal execution of the script, simply type :doc:`exit ` or :kbd:`Control`\ +\ :kbd:`D`. -To start a debug session simply run the builtin command :doc:`breakpoint ` at the point in a function or script where you wish to gain control. Also, the default action of the TRAP signal is to call this builtin. So a running script can be debugged by sending it the TRAP signal with the ``kill`` command. Once in the debugger, it is easy to insert new breakpoints by using the funced function to edit the definition of a function. +To start a debug session simply insert the :doc:`builtin command ` ``breakpoint`` at the point in a function or script where you wish to gain control, then run the function or script. Also, the default action of the ``TRAP`` signal is to call this builtin, meaning a running script can be actively debugged by sending it the ``TRAP`` signal (``kill -s TRAP ``). There is limited support for interactively setting or modifying breakpoints from this debug prompt: it is possible to insert new breakpoints in (or remove old ones from) other functions by using the ``funced`` function to edit the definition of a function, but it is not possible to add or remove a breakpoint from the function/script currently loaded and being executed. -If you want to debug performance, specifically, :program:`fish` can be told to save a profile via the ``--profile /path/to/file`` option. See :doc:`fish ` for more. +If you specifically want to debug performance issues, :program:`fish` can be run with the ``--profile /path/to/profile.log`` option to save a profile to the specified path. This profile log includes a breakdown of how long each step in the execution took. See :doc:`fish ` for more information.