Filtering the message is probably easy, but as Jim pointed out, it will probably
have unintended consequences later on. Besides, extracting the version could
enable a lot of different things down the line.
I had actually started on a "check-gdb-version-string", but was never able to
get it to work. In fact, revisiting that code now makes we wonder if any of these
"handlers" are actually working as intended.
From what I can see, the handlers scan the current buffer (which one is that anyways?)
to determine whether to do some operations. However, adding some prints to
these handlers reveal that they seem to always be empty:
(defun gdb-non-stop-handler ()
(goto-char (point-min))
(print (buffer-substring-no-properties (point-min) (point-max)))
(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-supports-non-stop nil))
(setq gdb-supports-non-stop t)
(gdb-input "-gdb-set mi-async on" 'ignore)
(gdb-input "-list-target-features" 'gdb-check-mi-async)))
(defun gdb-version-handler ()
"Set the version of gdb currently being used."
(message "Searching for GDB version...")
(goto-char (point-min))
(print (buffer-substring-no-properties (point-min) (point-max)))
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
(print (buffer-substring-no-properties (point-min) (point-max)))
(when (re-search-forward "GNU gdb (GDB) \\(.+\\)" nil t)
(message
"Attempting to retrieve GDB version: %s" (match-string 1))
(setq gdb-version (match-string 1)))))
I also tried to change the buffer in the `gdb-version-handler`, but that didn't
actually change anything. Am I making some wrong assumption here? To me
at least, it does not make sense that these are empty.
Best regards,
Gustaf