In a plain terminal, I can run gdb, connect to gdb server via 'target remote :nnnn` and then use the 'monitor' command to send commands to the remote app, and the results from running those commands on the remote app are displayed at the gdb command line.
Under gud/gdb, if I type the same 'monitor xxx' command, the results of the command, if the command has output, do not get echoed on the gud comint command line. The monitor interface does work -- I can send output-less monitor commands and observe that they are followed. The issue is that if the remote command has output, it does not make its way all the way back to the gud command line.
I can create a rudimentary workaround, printing each line to the Messages buffer, with code such as:
(defun gts-gud-gdb-mon (mon-command) "send command as monitor command, collect output" (interactive "MMonitor command: ") (let* ((gdb-command (format "monitor %s" mon-command)) (out-lines (gud-gdb-run-command-fetch-lines gdb-command gud-comint-buffer))) (dolist (l out-lines) (message (format "monitor output line: %s." l)))))
But I would like to either (1) be able to type 'monitor xxxx' and see multiple lines of output at the gud command line, or (2) have a new window, "monitor", that echos the result of any monitor commands.
How can I see the output of 'monitor' commands within gud?