diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 4428fa72c78..f51b53c2eb3 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1143,9 +1143,14 @@ gdb-non-stop-handler (setq gdb-non-stop nil) (setq gdb-supports-non-stop nil)) (setq gdb-supports-non-stop t) - (gdb-input "-gdb-set target-async 1" 'ignore) + (gdb-input "-gdb-set mi-async 1" 'gdb-set-mi-async-handler) (gdb-input "-list-target-features" 'gdb-check-target-async))) +(defun gdb-set-mi-async-handler() + (goto-char (point-min)) + (if (re-search-forward "No symbol" nil t) + (gdb-input "-gdb-set target-async 1" 'ignore))) + (defun gdb-check-target-async () (goto-char (point-min)) (unless (re-search-forward "async" nil t)