From 61046ffbec0d819856a04d7aa72e32e5cc402838 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 11 May 2022 14:26:53 +0200 Subject: [PATCH] Bind gud-go and allow the prefix to enter arguments * lisp/progmodes/gdb-mi.el (gdb): Bind gud-go to `C-c C-v' and allow a prefix to enter arguments (bug#10106). --- etc/NEWS | 5 +++++ lisp/progmodes/gdb-mi.el | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 595e477e2f3..9e985de0b39 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -786,6 +786,11 @@ so automatically. * Changes in Specialized Modes and Packages in Emacs 29.1 +--- +*** 'gud-go' is now bound to 'C-c C-v'. +If given a prefix, it will query the user for an argument to use for +the run/continue command. + ** Customize --- diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 3b9e1231abb..06746af761c 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -955,12 +955,16 @@ detailed description of this mode. (forward-char 2) (gud-call "-exec-until *%a" arg))) "\C-u" "Continue to current line or address.") - ;; TODO Why arg here? (gud-def - gud-go (gud-call (if gdb-active-process - (gdb-gud-context-command "-exec-continue") - "-exec-run") arg) - nil "Start or continue execution.") + gud-go (progn + (when arg + (gud-call (concat "-exec-arguments " + (read-string "Arguments to exec-run: ")))) + (gud-call + (if gdb-active-process + (gdb-gud-context-command "-exec-continue") + "-exec-run"))) + "C-v" "Start or continue execution. Use a prefix to specify arguments.") ;; For debugging Emacs only. (gud-def gud-pp