Created attachment 163977 [details] patch There are some redundancies, some functions that are already present in remote-utils.c, used by valgrind were copied to vgdb.c. remote-utils.c/server.h provides functions for core valgrind code and tools. The reason vgdb can't directly use the functions provided there is that valgrind gdbserver cannot use libc, but vgdb can and does. The patch attached adds remote-utils-shared.c/.h for sharing code between vgdb.c and m_gdbserver/server.c. This removes code redundancies that was introduced for vgdb.c by vgdb --multi implementation.
Very nice. Hopefully we can share more utility functions in the future. Since remote-utils-shared.c is based on some functions from remote-utils.c I have also copied the Copyright header from that file. commit ec73dcb1826091b3cbdd43a4a37522e33c3ce786 (HEAD -> master, origin/master, origin/HEAD) Author: Alexandra Petlanova Hajkova <ahajkova@redhat.com> Date: Wed Dec 6 03:14:53 2023 -0500 remote-utils-shared: Created files for sharing code between vgdb.c and m_gdbserver/server.c. This removes code redundancies that was introduced for vgdb.c by vgdb --multi implementation.