(defvar gdb-source-window nil)
(defvar gdb-inferior-status nil)
(defvar gdb-continuation nil)
+(defvar gdb-version nil)
(defvar gdb-filter-output nil
"Message to be shown in GUD console.
When `gdb-non-stop' is nil, return COMMAND unchanged."
(if gdb-non-stop
(if (and gdb-gud-control-all-threads
- (not noall))
+ (not noall)
+ (string-equal gdb-version "7.0+"))
(concat command " --all ")
- (gdb-current-context-command command t))
+ (gdb-current-context-command command))
command))
(defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
(if (re-search-forward "No symbol" nil t)
(progn
(message "This version of GDB doesn't support non-stop mode. Turning it off.")
- (setq gdb-non-stop nil))
+ (setq gdb-non-stop nil)
+ (setq gdb-version "pre-7.0"))
+ (setq gdb-version "7.0+")
(gdb-input (list "-gdb-set target-async 1" 'ignore))
(gdb-input (list "-enable-pretty-printing" 'ignore))))
(concat (car item) "\n")))
;; NOFRAME is used for gud execution control commands
-(defun gdb-current-context-command (command &optional noframe)
- "Add --thread and --frame options to gdb COMMAND.
-
-Option values are taken from `gdb-thread-number' and
-`gdb-frame-number'. If `gdb-thread-number' is nil, COMMAND is
-returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t,
-then no --frame option is added."
- ;; gdb-frame-number may be nil while gdb-thread-number is non-nil
- ;; (when current thread is running)
- (if gdb-thread-number
+(defun gdb-current-context-command (command)
+ "Add --thread to gdb COMMAND when needed."
+ (if (and gdb-thread-number
+ (string-equal gdb-version "7.0+"))
(concat command " --thread " gdb-thread-number)
command))
;; thread
(when (not gdb-register-names)
(gdb-input
- (list (concat "-data-list-register-names --thread " thread-id)
+ (list (concat "-data-list-register-names"
+ (if (string-equal gdb-version "7.0+")
+ (concat" --thread " thread-id)))
'gdb-register-names-handler)))
;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
"Display GDB threads in a new frame.")
(def-gdb-trigger-and-handler
- gdb-invalidate-threads (gdb-current-context-command "-thread-info" gud-running)
+ gdb-invalidate-threads (gdb-current-context-command "-thread-info")
gdb-thread-list-handler gdb-thread-list-handler-custom
'(start update update-threads))