I have been trying around getting one keybinding <F7>
to perform one gud-step
command if a debugging process is running. If it is not running it shall perform gud-run
.
I am not very familiar with gdb/gud yet, so while trying to get gdb-running
to work as a condition for my defun I am exposed to lisp argument errors, that 2 arguments are required (string-or-char-p and nil), where the first argument is a token, as it seems.
In the end my goal is to use <F7>
to invoke a gud-run
and to step-through with the same key afterwards, after reaching a breakpoint.
Following snippet is my first attempt. It becomes obvious that gdb-running
is missing 2 arguments as aforementioned.
(require 'gud)
(defun my-gud-run-or-step ()
(interactive)
(if (gdb-running)
(gud-step nil)
(gud-run nil)))
(global-set-key (kbd "<f7>") 'my-gud-run-or-step)
gdb-running
? I find only the variablegud-running
.gdb-running
for example by tab-completing inM-:
Eval: whilegdb
is running.(defun gdb-running (_token output-field)
appears to be located ingdb-mi.el.gz
.