]> git.ipfire.org Git - thirdparty/valgrind.git/commit
server.c: handle qExecAndArgs remote protocol packet
authorAlexandra Hájková <ahajkova@redhat.com>
Wed, 15 Oct 2025 10:27:25 +0000 (06:27 -0400)
committerMark Wielaard <mark@klomp.org>
Fri, 24 Oct 2025 14:42:00 +0000 (16:42 +0200)
commitf80358f109d1bce25d2013579e5d4b933b502797
treee1c178c1d71a70a598aefa73846c168e29962a41
parent4e3a4a2f729c9af05392a305caae0e2ce8332b61
server.c: handle qExecAndArgs remote protocol packet

New qExecAndArgs packet has been added recently to GDB's remote
protocol.

The new qExecAndArgs packet is sent from GDB, and gdbserver replies
with a packet that includes the executable filename and the arguments
string that were used for starting the initial inferior.

On the GDB side this information can be used to update GDB's state,
the 'show remote exec-file' will reflect how gdbserver was started,
and 'show args' will reflect the arguments used for starting the
inferior.

When running valgrind together with GDB like this:

./vg-in-place --tool=memcheck --vgdb-error=0 /bin/ls -lh

~/build/gdb/gdb/gdb
target remote | coregrind/vgdb
We can now ask GDB to show the executable's arguments:

(gdb) show args

Argument list to give program being debugged when it is started is "-lh".

or the executable's name:

(gdb) show remote exec-file
The remote exec-file is "/bin/ls".
coregrind/m_gdbserver/server.c