@@ -295,7 +295,7 @@ breakpoint of TYPE.")
295
295
frame process buffers source-window debuggee-path debuggee-args
296
296
buffer-types-to-update buffers-to-update
297
297
threads selected-thread persist-thread selected-frame
298
- breakpoints
298
+ breakpoints killed-inferior
299
299
(watchers-tick most-negative-fixnum) (watchers (make-hash-table :test 'equal )) root-watchers
300
300
(hide-access-spec gdb-watchers-hide-access-specifiers))
301
301
(defvar gdb--sessions nil
@@ -1993,6 +1993,7 @@ it from the list."
1993
1993
thread))))
1994
1994
1995
1995
(t
1996
+ (setf (gdb--session-killed-inferior session) nil ) ; ; NOTE(nox): Inferior is running, so it is not killed
1996
1997
(cl-pushnew 'gdb--threads (gdb--session-buffer-types-to-update session))
1997
1998
(gdb--conditional-switch thread '(no-selected-thread)))))))
1998
1999
@@ -2008,7 +2009,8 @@ it from the list."
2008
2009
(when (eq thread (gdb--session-selected-thread session))
2009
2010
(cl-pushnew 'gdb--frames (gdb--session-buffer-types-to-update session)))
2010
2011
2011
- (gdb--conditional-switch (gdb--best-frame-to-switch-to thread) '(running same-thread))))
2012
+ (unless (gdb--session-killed-inferior session)
2013
+ (gdb--conditional-switch (gdb--best-frame-to-switch-to thread) '(running same-thread)))))
2012
2014
2013
2015
(defun gdb--breakpoint-changed (number-str type disp enabled-str addr func fullname line-str at
2014
2016
pending thread cond times ignore-count what )
@@ -2474,6 +2476,7 @@ If ARG is non-nil, stop all threads unconditionally."
2474
2476
; ; Due to the non-stop mode, GDB sometimes crashes when rerunning an inferior that was killed while
2475
2477
; ; it had some threads running. This ensures all threads are stopped before killing the inferior.
2476
2478
; ;
2479
+ (setf (gdb--session-killed-inferior session) t )
2477
2480
(gdb--command " -exec-interrupt --all" )
2478
2481
(cl-loop do (accept-process-output (gdb--session-process session) 0.5 )
2479
2482
if (cl-loop for thread in (gdb--session-threads session)
0 commit comments