VGDB(1)
๐ VGDB(1) โ the vgdb manual ๐
okay so welcome to the vgdb(1) page, bestie. The main character is vgdb, and yes, itโs giving โValgrind to GDBโ energy. ๐
๐ธ NAME ๐ธ
vgdb โ the intermediary between Valgrind and GDB or a shell. Thatโs the whole vibe. ๐ซถ
โจ SYNOPSIS โจ
vgdb [options]
๐ DESCRIPTION ๐
vgdb (โValgrind to GDBโ) is used as an intermediary between Valgrind and GDB or a shell. It has three usage modes:
- As a standalone utility, it is used from a shell command line to send monitor commands to a process running under Valgrind. For this usage, the
vgdbOPTION(s) must be followed by the monitor command to send. To send more than one command, separate them with the-coption. ๐ฌ - In combination with the GDB
target remote |command, it is used as the relay application between GDB and the Valgrind gdbserver. For this usage, only OPTION(s) can be given, but no COMMAND can be given. ๐ - In the
--multimode,vgdbuses the extended remote protocol to communicate with GDB. This allows you to view output from both valgrind and GDB in the GDB session. This is accomplished via thetarget extended-remote | vgdb --multicommand. In this mode you no longer need to start valgrind yourself.vgdbwill start up valgrind when gdb tells it to run a new program. For this usage, thevgdbOPTIONS(s) can also include--valgrindand--vargsto describe how valgrind should be started. ๐
๐ฆ OPTIONS ๐ฆ
--pid=<number>โ Specifies the PID of the process to whichvgdbmust connect. This option is useful in case more than one Valgrind gdbserver can be connected to. If the--pidargument is not given and multiple Valgrind gdbserver processes are running,vgdbwill report the list of such processes and then exit. ๐ต๏ธโโ๏ธ--vgdb-prefixโ Must be given to both Valgrind andvgdbif you want to change the default prefix for the FIFOs (named pipes) used for communication between the Valgrind gdbserver andvgdb. ๐--wait=<number>โ Instructsvgdbto search for available Valgrind gdbservers for the specified number of seconds. This makes it possible to start avgdbprocess before starting the Valgrind gdbserver with which you intend thevgdbto communicate. This option is useful when used in conjunction with a--vgdb-prefixthat is unique to the process you want to wait for. Also, if you use the--waitargument in the GDBtarget remotecommand, you must set the GDBremotetimeoutto a value bigger than the--waitargument value. See option--max-invoke-ms(just below) for an example of setting theremotetimeoutvalue. โณ--max-invoke-ms=<number>โ Gives the number of milliseconds after whichvgdbwill force the invocation of gdbserver embedded in Valgrind. The default value is100milliseconds. A value of0disables forced invocation. The forced invocation is used whenvgdbis connected to a Valgrind gdbserver, and the Valgrind process has all its threads blocked in a system call.
If you specify a large value, you might need to increase the GDB remotetimeout value from its default value of 2 seconds. You should ensure that the timeout (in seconds) is bigger than the --max-invoke-ms value. For example, for --max-invoke-ms=5000, the following GDB command is suitable:
(gdb) set remotetimeout 6
๐ฅ
--cmd-time-out=<number>โ Instructs a standalonevgdbto exit if the Valgrind gdbserver it is connected to does not process a command in the specified number of seconds. The default value is to never time out. ๐--port=<portnr>โ Instructsvgdbto use tcp/ip and listen for GDB on the specified port nr rather than to use a pipe to communicate with GDB. Using tcp/ip allows to have GDB running on one computer and debugging a Valgrind process running on another target computer. Example:
# On the target computer, start your program under valgrind using
valgrind --vgdb-error=0 prog
# and then in another shell, run:
vgdb --port=1234
On the computer which hosts GDB, execute the command:
gdb prog
(gdb) target remote targetip:1234
where targetip is the ip address or hostname of the target computer. ๐
--vgdb-multiโ Makesvgdbstart in extended-remote mode and to wait for gdb to tell us what to run. ๐ฎ--valgrindโ The path to valgrind to use, in extended-remote mode. If not specified, the system valgrind will be launched. ๐ง--vargsโ Options to run valgrind with, in extended-remote mode. For example-q. Everything following--vargswill be provided as arguments to valgrind as is. This is only for supplying valgrind options. The program executable and its arguments are specified separately by GDB and should NOT be included here. ๐ซ-cโ To give more than one command to a standalonevgdb, separate the commands by an option-c. Example:
vgdb v.set log_output -c leak_check any
๐ฌ
-lโ Instructs a standalonevgdbto report the list of the Valgrind gdbserver processes running and then exit. ๐-Tโ Instructsvgdbto add timestamps tovgdbinformation messages. โฐ-Dโ Instructs a standalonevgdbto show the state of the shared memory used by the Valgrind gdbserver.vgdbwill exit after having shown the Valgrind gdbserver shared memory state. ๐ง-dโ Instructsvgdbto produce debugging output. Give multiple-dargs to increase the verbosity. When giving-dto a relayvgdb, you better redirect the standard error (stderr) ofvgdbto a file to avoid interaction between GDB andvgdbdebugging output. ๐
๐ SEE ALSO ๐
valgrind(1)$INSTALL/share/doc/valgrind/html/index.htmlhttp://www.valgrind.org/docs/manual/index.html- Debugging your program using Valgrind's gdbserver and GDB[1]
- vgdb[2]
- Valgrind monitor commands[3]
๐ AUTHOR ๐
Philippe Waroquiers. Respect. ๐ซถ
๐ NOTES ๐
- Debugging your program using Valgrind's gdbserver and GDB
http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver - vgdb
http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.vgdb - Valgrind monitor commands
http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands
๐ Thatโs the page, bestie! This is from Release 3.27.1, dated 06/23/2026 โ VGDB(1) signing off. Periodt. ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: valgrind 3.27.1-160000.1.1 ยท GFDL-1.2-only AND GPL-3.0-or-later
- opensuse-leap 16.0: valgrind 3.27.1-160000.1.1 ยท GFDL-1.2-only AND GPL-3.0-or-later
- opensuse-leap 16.0: valgrind 3.27.1-160000.1.1 ยท GFDL-1.2-only AND GPL-3.0-or-later
- opensuse-leap 16.0: valgrind 3.27.1-160000.1.1 ยท GFDL-1.2-only AND GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms