Skip to content

Commit 3f19893

Browse files
committed
add inferior argument history
1 parent 7504982 commit 3f19893

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gdb-mi.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,9 @@ This is shared among all sessions.")
317317
The alist has the format ((TOKEN . (TYPE . DATA)) ...).
318318
This is shared among all sessions.")
319319

320+
(defvar gdb--inferior-argument-history nil
321+
"History of arguments passed to the inferior.")
322+
320323
(cl-defstruct gdb--disassembly-instr addr func offset instr opcodes)
321324
(cl-defstruct gdb--disassembly-src file line-str instrs)
322325
(cl-defstruct gdb--disassembly-data (mode 4) func list new widths) ;; NOTE(nox): widths - [addr opcode instr]
@@ -2400,7 +2403,9 @@ If BREAK-MAIN is non-nil, break at main."
24002403
(gdb--with-valid-session
24012404
(when (gdb-kill) (sit-for 0.05))
24022405
(when arg
2403-
(let ((arguments (read-string "Arguments: " (gdb--session-debuggee-args session))))
2406+
(let* ((history-add-new-input t)
2407+
(arguments (read-string "Arguments: " (gdb--session-debuggee-args session)
2408+
'gdb--inferior-argument-history)))
24042409
(setf (gdb--session-debuggee-args session) arguments)
24052410
(gdb--command (concat "-exec-arguments " arguments))))
24062411
(gdb--command (concat "-exec-run" (and break-main " --start")))))
@@ -2476,7 +2481,8 @@ If ARG is non-nil, stop all threads unconditionally."
24762481
finally return t)
24772482
return nil)
24782483

2479-
(gdb--command "-target-disconnect"))))
2484+
(gdb--command "-target-disconnect")
2485+
t))) ; NOTE(nox): Some functions need to know if an inferior was killed
24802486

24812487
(defun gdb-select ()
24822488
"Select inferred frame or thread."

0 commit comments

Comments
 (0)