what you really want is to run gdb as follows:
Mx gdb ret
gdb --annotate = 3 myprog
(gdb) target remote 192.168.1.1:1234
The key looks like -annotate = 3, I'm not sure what tramp is or why you want to use ssh for something (gdb will connect directly to the host that you pass it to), but this works for me. I had the same problem connecting qemu to localhost.
source share