This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011 Philippe Waroquiers
+ Copyright (C) 2011-2011 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
VG_(umsg)("embedded gdbserver: reading from %s\n", from_gdb);
VG_(umsg)("embedded gdbserver: writing to %s\n", to_gdb);
VG_(umsg)("embedded gdbserver: shared mem %s\n", shared_mem);
- VG_(umsg)("CONTROL ME using: vgdb --pid=%d%s%s ...command...\n",
+ VG_(umsg)("\n");
+ VG_(umsg)("TO CONTROL THIS PROCESS USING vgdb (which you probably\n"
+ "don't want to do, unless you know exactly what you're doing,\n"
+ "or are doing some strange experiment):\n"
+ " %s/../../bin/vgdb --pid=%d%s%s ...command...\n",
+ VG_LIBDIR,
pid, (name_default ? "" : " --vgdb="),
(name_default ? "" : name));
- VG_(umsg)("DEBUG ME using: (gdb) target remote | vgdb --pid=%d%s%s\n",
- pid, (name_default ? "" : " --vgdb="),
- (name_default ? "" : name));
- VG_(umsg)(" --pid optional if only one valgrind process is running\n");
+ }
+ if (VG_(clo_verbosity) > 1
+ || VG_(clo_vgdb_error) < 999999999) {
+ VG_(umsg)("\n");
+ VG_(umsg)(
+ "TO DEBUG THIS PROCESS USING GDB: start GDB like this\n"
+ " /path/to/gdb %s\n"
+ "and then give GDB the following command\n"
+ " target remote | %s/../../bin/vgdb --pid=%d%s%s\n",
+ VG_(args_the_exename),
+ VG_LIBDIR,
+ pid, (name_default ? "" : " --vgdb="),
+ (name_default ? "" : name)
+ );
+ VG_(umsg)("--pid is optional if only one valgrind process is running\n");
+ VG_(umsg)("\n");
}
if (!mknod_done) {
" --child-silent-after-fork=no|yes omit child output between fork & exec? [no]\n"
" --vgdb=no|yes|full activate gdbserver? [yes]\n"
" full is slower but provides precise watchpoint/step\n"
-" --vgdb-error=<number> invoke gdbserver after <number> errors [%d] \n"
+" --vgdb-error=<number> invoke gdbserver after <number> errors [%d]\n"
+" to get started quickly, use --vgdb-error=0\n"
+" and follow the on-screen directions\n"
" --track-fds=no|yes track open file descriptors? [no]\n"
" --time-stamp=no|yes add timestamps to log messages? [no]\n"
" --log-fd=<number> log messages to file descriptor [2=stderr]\n"
return retval;
}
-ULong VG_(bbs_done) (void)
-{
- return bbs_done;
-}
-
/* ---------------------------------------------------------------------
The scheduler proper.
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011 Philippe Waroquiers
+ Copyright (C) 2011-2011 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
extern void VG_(disable_vgdb_poll) (void );
extern void VG_(force_vgdb_poll) ( void );
-/* nr of bbs done since startup. */
-extern ULong VG_(bbs_done) (void);
-
/* Stats ... */
extern void VG_(print_scheduler_stats) ( void );
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011 Philippe Waroquiers
+ Copyright (C) 2011-2011 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
xreflabel="gdbserver simple example">
<title>Quick Start: debugging in 3 steps</title>
+<para>The simplest way to get started is to run Valgrind with the
+flag <option>--vgdb-error=0</option>. Then follow the on-screen
+directions, which give you the precise commands needed to start GDB
+and connect it to your program.</para>
+
+<para>Otherwise, here's a slightly more verbose overview.</para>
+
<para>If you want to debug a program with GDB when using the Memcheck
tool, start Valgrind the following way:
<screen><![CDATA[
filter_memcheck_monitor filter_stderr filter_vgdb
EXTRA_DIST = \
+ README_DEVELOPERS \
mcbreak.stderrB.exp \
mcbreak.stderr.exp \
mcbreak.stdinB.gdb \
dir=`dirname $0`
$dir/../tests/filter_stderr_basic |
-sed -e '/^Copyright (C) /d'
+sed -e '/^Copyright (C) /d' \
+ \
+ -e '/TO DEBUG THIS PROCESS USING GDB/d' \
+ -e '/\/path\/to\/gdb/d' \
+ -e '/and then give GDB the following command/d' \
+ -e '/target remote |/d' \
+ -e '/pid is optional if only one valgrind process is running/d'
(action at startup) vgdb me ...
+
+
HEAP SUMMARY:
in use at exit: 0 bytes in 0 blocks
total heap usage: 0 allocs, 0 frees, 0 bytes allocated
(action at startup) vgdb me ...
+
+
Test 1: Invalid write of size 4
at 0x........: test1 (faultstatus.c:105)
by 0x........: main (faultstatus.c:168)
(action at startup) vgdb me ...
+
+
Test 1: Invalid write of size 4
at 0x........: test1 (faultstatus.c:105)
by 0x........: main (faultstatus.c:168)
(action at startup) vgdb me ...
+
+
breakme function called from line 19
before reading 0/4/8
u: Expected value at 0
Nulgrind, the minimal Valgrind tool
(action at startup) vgdb me ...
+
+
loops/sleep_ms/burn/threads_spec: 1000000000 1000000000 1000000000 BSBSBSBS
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
This file is part of Valgrind, a dynamic binary instrumentation
framework.
- Copyright (C) 2011 Philippe Waroquiers
+ Copyright (C) 2011-2011 Philippe Waroquiers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
--child-silent-after-fork=no|yes omit child output between fork & exec? [no]
--vgdb=no|yes|full activate gdbserver? [yes]
full is slower but provides precise watchpoint/step
- --vgdb-error=<number> invoke gdbserver after <number> errors [999999999]
+ --vgdb-error=<number> invoke gdbserver after <number> errors [999999999]
+ to get started quickly, use --vgdb-error=0
+ and follow the on-screen directions
--track-fds=no|yes track open file descriptors? [no]
--time-stamp=no|yes add timestamps to log messages? [no]
--log-fd=<number> log messages to file descriptor [2=stderr]
--child-silent-after-fork=no|yes omit child output between fork & exec? [no]
--vgdb=no|yes|full activate gdbserver? [yes]
full is slower but provides precise watchpoint/step
- --vgdb-error=<number> invoke gdbserver after <number> errors [999999999]
+ --vgdb-error=<number> invoke gdbserver after <number> errors [999999999]
+ to get started quickly, use --vgdb-error=0
+ and follow the on-screen directions
--track-fds=no|yes track open file descriptors? [no]
--time-stamp=no|yes add timestamps to log messages? [no]
--log-fd=<number> log messages to file descriptor [2=stderr]