In general, if you don't know the exact name of the buffer, you need to call buffer-list to obtain the list of buffers and filter the result to only act on the desired buffer(s).
(defun erase-buffers-matching (regexp)
"Erase the content of all buffers whose name matches REGEXP."
(interactive "sErase buffers matching: ")
I made this work by passing argument when launching gdb.
M-x gdb RET gdb -i=mi -ex "target extended-remote <remote>:44421" -ex "set remote exec-file ./executable" --args "-c config.xml"
Then in gdb launched i also had to set set non-stop off.
I ran gdbserver as gdbserver --multi :44421 in the folder on remote where executable was.
It worked. But ...