0

I trying to follow the instruction on connecting to valgrind using gdb. Valgrind memcheck is starts properly and asks to connect using following gdb command:

target remote | vgdb --pid=53181

but when I run this command, I get an error

Remote communication error. Target disconnected.: Connection reset by peer

what is my mistake?

George Vinokhodov
  • 327
  • 1
  • 4
  • 10

1 Answers1

0

It appears that error

Remote communication error. Target disconnected.: Connection reset by peer.

is general and may indicate invalid command as well. If you run in gdb

target remote | something

it will give you the same error message.

It appeared for me, that extra space after | symbol was excess.

Correct command was actually

target remote |vgdb --pid=53181

My GDB version is GNU gdb (Ubuntu 10.2-0ubuntu1~18.04~2) 10.2

George Vinokhodov
  • 327
  • 1
  • 4
  • 10
  • That seems very strange. I have never seen any gdb version needing or not needing a space before/after the | in the target remote command. I have just checked again with GDB 10.2 and it works with or without space. For sure, the above behaviour and answer does not apply generally. I suggest to retest your hypothesis, and if confirm, to give the exact versions of GDB build, the platform, etc ... – phd Oct 22 '22 at 13:27
  • Also, giving: "target remote | something" gives first a message the something is "not found". – phd Oct 22 '22 at 13:29