Author: sewardj
Date: 2011-06-28 09:20:39 +0100 (Tue, 28 Jun 2011)
New Revision: 11844
Log:
valgrind and tool mon. cmds prefixes changes + doc fixes + new vgdb option
--cmd-time-out
* changed prefixes of Valgrind core monitor commands from vg. to v.
* removed prefixes of Tool monitor commands
* memcheck leak_check 'leakpossible' arg renamed to 'possibleleak'
* memcheck make_memory 'ifaddressabledefined' arg renamed to
'Definedifaddressable'
(with uppercase D to avoid confusion with 'defined' arg).
* vgdb options
- Some doc updates : more logical option order documentation,
specify 'standalone' for options aimed at standalone usage.
- added option --cmd-time-out for standalone vgdb
(comment of Josef Weindendorfer, needed to interface with a callgrind GUI)
* updated tests according to the above.
* updated documentation according to the above.
* some additional minor doc fixes/clarifications
(Philippe Waroquiers, phi...@sk...). Bug 214909
comment 111.
Modified:
trunk/callgrind/docs/cl-manual.xml
trunk/callgrind/main.c
trunk/coregrind/m_gdbserver/README_DEVELOPERS
trunk/coregrind/m_gdbserver/server.c
trunk/coregrind/vgdb.c
trunk/docs/xml/manual-core-adv.xml
trunk/gdbserver_tests/Makefile.am
trunk/gdbserver_tests/README_DEVELOPERS
trunk/gdbserver_tests/invoker
trunk/gdbserver_tests/mcbreak.stdinB.gdb
trunk/gdbserver_tests/mcclean_after_fork.stdinB.gdb
trunk/gdbserver_tests/mchelp.stderrB.exp
trunk/gdbserver_tests/mchelp.stdoutB.exp
trunk/gdbserver_tests/mchelp.vgtest
trunk/gdbserver_tests/mcinfcallRU.stdinB.gdb
trunk/gdbserver_tests/mcinfcallWSRU.stdinB.gdb
trunk/gdbserver_tests/mcinvokeRU.stderrB.exp
trunk/gdbserver_tests/mcinvokeRU.vgtest
trunk/gdbserver_tests/mcinvokeWS.stderrB.exp
trunk/gdbserver_tests/mcinvokeWS.vgtest
trunk/gdbserver_tests/mcleak.stdinB.gdb
trunk/gdbserver_tests/mcmain_pic.stdinB.gdb
trunk/gdbserver_tests/mcsignopass.stdinB.gdb
trunk/gdbserver_tests/mcsigpass.stdinB.gdb
trunk/gdbserver_tests/mcvabits.stdinB.gdb
trunk/gdbserver_tests/mcwatchpoints.stdinB.gdb
trunk/gdbserver_tests/mssnapshot.stderrB.exp
trunk/gdbserver_tests/mssnapshot.stdinB.gdb
trunk/gdbserver_tests/nlcontrolc.stdinB.gdb
trunk/gdbserver_tests/nlpasssigalrm.stdinB.gdb
trunk/gdbserver_tests/nlsigvgdb.stdinB.gdb
trunk/massif/docs/ms-manual.xml
trunk/massif/ms_main.c
trunk/memcheck/docs/mc-manual.xml
trunk/memcheck/mc_errors.c
trunk/memcheck/mc_include.h
trunk/memcheck/mc_leakcheck.c
trunk/memcheck/mc_main.c
Modified: trunk/callgrind/docs/cl-manual.xml
===================================================================
--- trunk/callgrind/docs/cl-manual.xml 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/callgrind/docs/cl-manual.xml 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1083,12 +1083,12 @@
<itemizedlist>
<listitem>
- <para><varname>ct.dump [<dump_hint>]</varname> requests to dump the
+ <para><varname>dump [<dump_hint>]</varname> requests to dump the
profile data. </para>
</listitem>
<listitem>
- <para><varname>ct.zero</varname> requests to zero the profile data
+ <para><varname>zero</varname> requests to zero the profile data
counters. </para>
</listitem>
Modified: trunk/callgrind/main.c
===================================================================
--- trunk/callgrind/main.c 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/callgrind/main.c 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1360,9 +1360,9 @@
{
VG_(gdb_printf) ("\n");
VG_(gdb_printf) ("callgrind monitor commands:\n");
- VG_(gdb_printf) (" ct.dump [<dump_hint>]\n");
+ VG_(gdb_printf) (" dump [<dump_hint>]\n");
VG_(gdb_printf) (" dump counters\n");
- VG_(gdb_printf) (" ct.zero\n");
+ VG_(gdb_printf) (" zero\n");
VG_(gdb_printf) (" zero counters\n");
VG_(gdb_printf) ("\n");
}
@@ -1377,7 +1377,7 @@
VG_(strcpy) (s, req);
wcmd = VG_(strtok_r) (s, " ", &ssaveptr);
- switch (VG_(keyword_id) ("help ct.dump ct.zero",
+ switch (VG_(keyword_id) ("help dump zero",
wcmd, kwd_report_duplicated_matches)) {
case -2: /* multiple matches */
return True;
@@ -1386,11 +1386,11 @@
case 0: /* help */
print_monitor_help();
return True;
- case 1: { /* ct.dump */
+ case 1: { /* dump */
CLG_(dump_profile)(req, False);
return True;
}
- case 2: { /* ct.zero */
+ case 2: { /* zero */
CLG_(zero_all_cost)(False);
return True;
}
Modified: trunk/coregrind/m_gdbserver/README_DEVELOPERS
===================================================================
--- trunk/coregrind/m_gdbserver/README_DEVELOPERS 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/coregrind/m_gdbserver/README_DEVELOPERS 2011-06-28 08:20:39 UTC (rev 11844)
@@ -307,10 +307,11 @@
TODO and/or additional nice things to have
------------------------------------------
* many options can be changed on-line without problems.
- => would be nice to have a vg.option command that would evaluate
+ => would be nice to have a v.option command that would evaluate
its arguments like the startup options of m_main.c and tool clo processing.
-* have a mc.who_points_at <address> | <loss_record_nr>
+* have a memcheck monitor command
+ who_points_at <address> | <loss_record_nr>
that would describe the addresses where a pointer is found
to address (or address leaked at loss_record_nr>)
This would allow to interactively searching who is "keeping" a piece
@@ -355,10 +356,10 @@
* more client requests can be programmed in various tools. Currently,
there are only a few standard valgrind or memcheck client requests
implemented.
- vg.suppression [generate|add|delete] might be an interesting command:
+ v.suppression [generate|add|delete] might be an interesting command:
generate would output a suppression, add/delete would add a suppression
in memory for the last (or selected?) error.
- vg.break on fn calls/entry/exit + commands associated to it
+ v.break on fn calls/entry/exit + commands associated to it
(such as search leaks)?
Modified: trunk/coregrind/m_gdbserver/server.c
===================================================================
--- trunk/coregrind/m_gdbserver/server.c 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/coregrind/m_gdbserver/server.c 2011-06-28 08:20:39 UTC (rev 11844)
@@ -115,7 +115,7 @@
Note that in case of ambiguous command, 1 is returned.
*sink_wanted_at_return is modified if one of the commands
- 'vg.set *_output' is handled.
+ 'v.set *_output' is handled.
*/
static
int handle_gdb_valgrind_command (char* mon, OutputSink* sink_wanted_at_return)
@@ -133,9 +133,9 @@
strcpy (s, mon);
wcmd = strtok_r (s, " ", &ssaveptr);
/* NB: if possible, avoid introducing a new command below which
- starts with the same 4 first letters as an already existing
+ starts with the same 3 first letters as an already existing
command. This ensures a shorter abbreviation for the user. */
- switch (VG_(keyword_id) ("help vg.set vg.info vg.wait vg.kill vg.translate",
+ switch (VG_(keyword_id) ("help v.set v.info v.wait v.kill v.translate",
wcmd, kwd_report_duplicated_matches)) {
case -2:
ret = 1;
@@ -159,26 +159,26 @@
VG_(gdb_printf) (
"general valgrind monitor commands:\n"
" help [debug] : monitor command help. With debug: + debugging commands\n"
-" vg.wait [<ms>] : sleep <ms> (default 0) then continue\n"
-" vg.info all_errors : show all errors found so far\n"
-" vg.info last_error : show last error found\n"
-" vg.info n_errs_found : show the nr of errors found so far\n"
-" vg.kill : kill the Valgrind process\n"
-" vg.set gdb_output : set valgrind output to gdb\n"
-" vg.set log_output : set valgrind output to log\n"
-" vg.set mixed_output : set valgrind output to log, interactive output to gdb\n"
-" vg.set vgdb-error <errornr> : debug me at error >= <errornr> \n");
+" v.wait [<ms>] : sleep <ms> (default 0) then continue\n"
+" v.info all_errors : show all errors found so far\n"
+" v.info last_error : show last error found\n"
+" v.info n_errs_found : show the nr of errors found so far\n"
+" v.kill : kill the Valgrind process\n"
+" v.set gdb_output : set valgrind output to gdb\n"
+" v.set log_output : set valgrind output to log\n"
+" v.set mixed_output : set valgrind output to log, interactive output to gdb\n"
+" v.set vgdb-error <errornr> : debug me at error >= <errornr> \n");
if (int_value) { VG_(gdb_printf) (
"debugging valgrind internals monitor commands:\n"
-" vg.info gdbserver_status : show gdbserver status\n"
-" vg.info memory : show valgrind heap memory stats\n"
-" vg.set debuglog <level> : set valgrind debug log level to <level>\n"
-" vg.translate <addr> [<traceflags>] : debug translation of <addr> with <traceflags>\n"
+" v.info gdbserver_status : show gdbserver status\n"
+" v.info memory : show valgrind heap memory stats\n"
+" v.set debuglog <level> : set valgrind debug log level to <level>\n"
+" v.translate <addr> [<traceflags>] : debug translation of <addr> with <traceflags>\n"
" (default traceflags 0b00100000 : show after instrumentation)\n"
" An additional flag 0b100000000 allows to show gdbserver instrumentation\n");
}
break;
- case 1: /* vg.set */
+ case 1: /* v.set */
ret = 1;
wcmd = strtok_r (NULL, " ", &ssaveptr);
switch (kwdid = VG_(keyword_id)
@@ -230,7 +230,7 @@
vg_assert (0);
}
break;
- case 2: /* vg.info */ {
+ case 2: /* v.info */ {
ret = 1;
wcmd = strtok_r (NULL, " ", &ssaveptr);
switch (kwdid = VG_(keyword_id)
@@ -265,7 +265,7 @@
}
break;
}
- case 3: /* vg.wait */
+ case 3: /* v.wait */
wcmd = strtok_r (NULL, " ", &ssaveptr);
if (wcmd != NULL) {
int_value = strtol (wcmd, &endptr, 10);
@@ -275,10 +275,10 @@
VG_(gdb_printf) ("gdbserver: continuing after wait ...\n");
ret = 1;
break;
- case 4: /* vg.kill */
+ case 4: /* v.kill */
kill_request ("monitor command request to kill this process\n");
break;
- case 5: { /* vg.translate */
+ case 5: { /* v.translate */
Addr address;
SizeT verbosity = 0x20;
Modified: trunk/coregrind/vgdb.c
===================================================================
--- trunk/coregrind/vgdb.c 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/coregrind/vgdb.c 2011-06-28 08:20:39 UTC (rev 11844)
@@ -31,6 +31,7 @@
#include "pub_core_threadstate.h"
#include "pub_core_gdbserver.h"
+#include <limits.h>
#include <unistd.h>
#include <string.h>
#include <poll.h>
@@ -93,6 +94,10 @@
#undef PTRACEINVOKER
#endif
+// Outputs information for the user about ptrace_scope protection
+// or ptrace not working.
+static void ptrace_restrictions_msg(void);
+
static int debuglevel;
static struct timeval dbgtv;
/* if level <= debuglevel, print timestamp, then print provided by debug info */
@@ -476,14 +481,26 @@
Bool attach (int pid, char *msg)
{
long res;
+ static Bool output_error = True;
+ static Bool initial_attach = True;
+ // For a ptrace_scope protected system, we do not want to output
+ // repetitively attach error. We will output once an error
+ // for the initial_attach. Once the 1st attach has succeeded, we
+ // again show all errors.
DEBUG(1, "%s PTRACE_ATTACH pid %d\n", msg, pid);
res = ptrace (PTRACE_ATTACH, pid, NULL, NULL);
if (res != 0) {
- ERROR(errno, "%s PTRACE_ATTACH pid %d %ld\n", msg, pid, res);
+ if (output_error || debuglevel > 0) {
+ ERROR(errno, "%s PTRACE_ATTACH pid %d %ld\n", msg, pid, res);
+ if (initial_attach)
+ output_error = False;
+ }
return False;
}
+ initial_attach = False;
+ output_error = True;
return waitstopped(pid, SIGSTOP, msg);
}
@@ -791,6 +808,7 @@
static
Bool invoke_gdbserver (int pid)
{
+ static Bool ptrace_restrictions_msg_given = False;
long res;
Bool stopped;
struct user user_mod;
@@ -813,7 +831,11 @@
DEBUG(1, "attach to 'main' pid %d\n", pid);
if (!attach(pid, "attach main pid")) {
- ERROR(0, "error attach main pid %d\n", pid);
+ if (!ptrace_restrictions_msg_given) {
+ ptrace_restrictions_msg_given = True;
+ ERROR(0, "error attach main pid %d\n", pid);
+ ptrace_restrictions_msg();
+ }
return False;
}
@@ -1074,14 +1096,21 @@
(if PTRACE_INVOKER is defined) to ensure that the gdbserver code is
called soon by valgrind. */
static int max_invoke_ms = 100;
+#define NEVER 99999999
+static int cmd_time_out = NEVER;
static
void *invoke_gdbserver_in_valgrind(void *v_pid)
{
+ struct timeval cmd_max_end_time;
+ Bool cmd_started = False;
+ struct timeval invoke_time;
+
int pid = *(int *)v_pid;
int written_by_vgdb_before_sleep;
int seen_by_valgrind_before_sleep;
int invoked_written = -1;
+ unsigned int usecs;
pthread_cleanup_push(cleanup_restore_and_detach, v_pid);
@@ -1093,15 +1122,44 @@
"seen_by_valgrind_before_sleep %d\n",
written_by_vgdb_before_sleep,
seen_by_valgrind_before_sleep);
- if (usleep(1000 * max_invoke_ms) != 0) {
+ if (cmd_time_out != NEVER
+ && !cmd_started
+ && written_by_vgdb_before_sleep > seen_by_valgrind_before_sleep) {
+ /* A command was started. Record the time at which it was started. */
+ DEBUG(1, "IO for command started\n");
+ gettimeofday(&cmd_max_end_time, NULL);
+ cmd_max_end_time.tv_sec += cmd_time_out;
+ cmd_started = True;
+ }
+ if (max_invoke_ms > 0) {
+ usecs = 1000 * max_invoke_ms;
+ gettimeofday(&invoke_time, NULL);
+ invoke_time.tv_sec += max_invoke_ms / 1000;
+ invoke_time.tv_usec += 1000 * (max_invoke_ms % 1000);
+ invoke_time.tv_sec += invoke_time.tv_usec / (1000 * 1000);
+ invoke_time.tv_usec = invoke_time.tv_usec % (1000 * 1000);
+ } else {
+ usecs = 0;
+ }
+ if (cmd_started) {
+ // 0 usecs here means the thread just has to check gdbserver eats
+ // the characters in <= cmd_time_out seconds.
+ // We will just wait by 1 second max at a time.
+ if (usecs == 0 || usecs > 1000 * 1000)
+ usecs = 1000 * 1000;
+ }
+ if (usleep(usecs) != 0) {
if (errno == EINTR)
continue;
XERROR (errno, "error usleep\n");
}
- /* if nothing happened during our sleep, let's try to wake up valgrind */
+ /* If nothing happened during our sleep, let's try to wake up valgrind
+ or check for cmd time out. */
if (written_by_vgdb_before_sleep == VS_written_by_vgdb
&& seen_by_valgrind_before_sleep == VS_seen_by_valgrind
&& VS_written_by_vgdb > VS_seen_by_valgrind) {
+ struct timeval now;
+ gettimeofday(&now, NULL);
DEBUG(2,
"after sleep "
"written_by_vgdb %d "
@@ -1115,20 +1173,33 @@
XERROR (errno,
"invoke_gdbserver_in_valgrind: "
"check for pid %d existence failed\n", pid);
-
- #if defined(PTRACEINVOKER)
- /* only need to wake up if the nr written has changed since
- last invoke. */
- if (invoked_written != written_by_vgdb_before_sleep) {
- if (invoke_gdbserver(pid)) {
- /* If invoke succesful, no need to invoke again
- for the same value of written_by_vgdb_before_sleep. */
- invoked_written = written_by_vgdb_before_sleep;
+ if (cmd_started) {
+ if (timercmp (&now, &cmd_max_end_time, >))
+ XERROR (0,
+ "pid %d did not handle a command in %d seconds\n",
+ pid, cmd_time_out);
+ }
+ if (max_invoke_ms > 0 && timercmp (&now, &invoke_time, >=)) {
+ #if defined(PTRACEINVOKER)
+ /* only need to wake up if the nr written has changed since
+ last invoke. */
+ if (invoked_written != written_by_vgdb_before_sleep) {
+ if (invoke_gdbserver(pid)) {
+ /* If invoke succesful, no need to invoke again
+ for the same value of written_by_vgdb_before_sleep. */
+ invoked_written = written_by_vgdb_before_sleep;
+ }
}
+ #else
+ DEBUG(2, "invoke_gdbserver via ptrace not (yet) implemented\n");
+ #endif
}
- #else
- DEBUG(2, "invoke_gdbserver via ptrace not (yet) implemented\n");
- #endif
+ } else {
+ // Something happened => restart timer check.
+ if (cmd_time_out != NEVER) {
+ DEBUG(2, "some IO was done => restart command\n");
+ cmd_started = False;
+ }
}
}
pthread_cleanup_pop(0);
@@ -1531,7 +1602,7 @@
in the valgrind process can stay stopped if vgdb main
exits before the invoke thread had time to detach from
all valgrind threads. */
- if (max_invoke_ms > 0) {
+ if (max_invoke_ms > 0 || cmd_time_out != NEVER) {
int join;
/* It is surprisingly complex to properly shutdown or exit the
@@ -1705,7 +1776,7 @@
int nc;
- if (max_invoke_ms > 0)
+ if (max_invoke_ms > 0 || cmd_time_out != NEVER)
pthread_create(&invoke_gdbserver_in_valgrind_thread, NULL,
invoke_gdbserver_in_valgrind, (void *) &pid);
@@ -1803,7 +1874,7 @@
/* report to user the existence of a vgdb-able valgrind process
with given pid */
static
-void report_pid (int pid)
+void report_pid (int pid, Bool on_stdout)
{
char cmdline_file[100];
char cmdline[1000];
@@ -1824,14 +1895,14 @@
cmdline[sz] = 0;
close (fd);
}
- fprintf(stderr, "use --pid=%d for %s\n", pid, cmdline);
- fflush(stderr);
+ fprintf((on_stdout ? stdout : stderr), "use --pid=%d for %s\n", pid, cmdline);
+ fflush((on_stdout ? stdout : stderr));
}
-/* Eventually produces additional usage information documenting the
+/* Possibly produces additional usage information documenting the
ptrace restrictions. */
static
-void ptrace_restrictions(void)
+void ptrace_restrictions_msg(void)
{
# ifdef PR_SET_PTRACER
char *ptrace_scope_setting_file = "/proc/sys/kernel/yama/ptrace_scope";
@@ -1875,28 +1946,32 @@
" Only OPTION(s) can be given.\n"
"\n"
" OPTIONS are [--pid=<number>] [--vgdb-prefix=<prefix>]\n"
-" [--max-invoke-ms=<number>] [--wait=<number>] [-d] [-D] [-l]\n"
+" [--wait=<number>] [--max-invoke-ms=<number>]\n"
+" [--cmd-time-out=<number>] [-l] [-D] [-d]\n"
+" \n"
" --pid arg must be given if multiple Valgrind gdbservers are found.\n"
" --vgdb-prefix arg must be given to both Valgrind and vgdb utility\n"
" if you want to change the default prefix for the FIFOs communication\n"
" between the Valgrind gdbserver and vgdb.\n"
-" --wait arg tells vgdb to check during the specified number\n"
+" --wait (default 0) tells vgdb to check during the specified number\n"
" of seconds if a Valgrind gdbserver can be found.\n"
-" --max-invoke-ms gives the nr of milli-seconds after which vgdb will force\n"
-" the invocation of the Valgrind gdbserver (if the Valgrind process\n"
-" is blocked in a system call).\n"
+" --max-invoke-ms (default 100) gives the nr of milli-seconds after which vgdb\n"
+" will force the invocation of the Valgrind gdbserver (if the Valgrind\n"
+" process is blocked in a system call).\n"
+" --cmd-time-out (default 99999999) tells vgdb to exit if the found Valgrind\n"
+" gdbserver has not processed a command after number seconds\n"
+" -l arg tells to show the list of running Valgrind gdbserver and then exit.\n"
+" -D arg tells to show shared mem status and then exit.\n"
" -d arg tells to show debug info. Multiple -d args for more debug info\n"
-" -D arg tells to show shared mem status and then exit.\n"
-" -l arg tells to show the list of running Valgrind gdbserver and then exit.\n"
"\n"
" -h --help shows this message\n"
" To get help from the Valgrind gdbserver, use vgdb help\n"
"\n"
);
- ptrace_restrictions();
+ ptrace_restrictions_msg();
}
-/* If show_list, shows the list of Valgrind processes with gdbserver activated.
+/* If show_list, outputs on stdout the list of Valgrind processes with gdbserver activated.
and then exits.
else if arg_pid == -1, waits maximum check_trials seconds to discover
@@ -1992,7 +2067,7 @@
&& kill (newpid, 0) == 0) {
nr_valid_pid++;
if (show_list) {
- report_pid (newpid);
+ report_pid (newpid, /*on_stdout*/ True);
pid = newpid;
} else if (arg_pid != -1) {
if (arg_pid == newpid) {
@@ -2004,10 +2079,10 @@
(stderr,
"no --pid= arg given"
" and multiple valgrind pids found:\n");
- report_pid (pid);
+ report_pid (pid, /*on_stdout*/ False);
}
pid = -2;
- report_pid (newpid);
+ report_pid (newpid, /*on_stdout*/ False);
} else {
pid = newpid;
}
@@ -2057,14 +2132,18 @@
{
const char *eq_pos = strchr(arg, '=');
char *wrong;
+ long long int long_value;
if (eq_pos == NULL)
return False;
- *value = strtol(eq_pos+1, &wrong, 10);
+ long_value = strtoll(eq_pos+1, &wrong, 10);
+ if (long_value < 0 || long_value > INT_MAX)
+ return False;
if (*wrong)
return False;
+ *value = (int) long_value;
return True;
}
@@ -2115,24 +2194,29 @@
} else if (is_opt(argv[i], "--pid=")) {
int newpid;
if (!numeric_val(argv[i], &newpid)) {
- fprintf (stderr, "invalid pid argument %s\n", argv[i]);
+ fprintf (stderr, "invalid --pid argument %s\n", argv[i]);
arg_errors++;
} else if (arg_pid != -1) {
- fprintf (stderr, "multiple pid arguments given\n");
+ fprintf (stderr, "multiple --pid arguments given\n");
arg_errors++;
} else {
arg_pid = newpid;
}
} else if (is_opt(argv[i], "--wait=")) {
if (!numeric_val(argv[i], &check_trials)) {
- fprintf (stderr, "invalid wait argument %s\n", argv[i]);
+ fprintf (stderr, "invalid --wait argument %s\n", argv[i]);
arg_errors++;
}
} else if (is_opt(argv[i], "--max-invoke-ms=")) {
if (!numeric_val(argv[i], &max_invoke_ms)) {
- fprintf (stderr, "invalid max-invoke-ms argument %s\n", argv[i]);
+ fprintf (stderr, "invalid --max-invoke-ms argument %s\n", argv[i]);
arg_errors++;
}
+ } else if (is_opt(argv[i], "--cmd-time-out=")) {
+ if (!numeric_val(argv[i], &cmd_time_out)) {
+ fprintf (stderr, "invalid --cmd-time-out argument %s\n", argv[i]);
+ arg_errors++;
+ }
} else if (is_opt(argv[i], "--vgdb-prefix=")) {
vgdb_prefix = argv[i] + 14;
} else if (is_opt(argv[i], "-c")) {
@@ -2179,6 +2263,14 @@
"Can't use both -D and -l options\n");
}
+ if (max_invoke_ms > 0
+ && cmd_time_out != NEVER
+ && (cmd_time_out * 1000) <= max_invoke_ms) {
+ arg_errors++;
+ fprintf (stderr,
+ "--max-invoke-ms must be < --cmd-time-out * 1000\n");
+ }
+
if (show_list && arg_pid != -1) {
arg_errors++;
fprintf (stderr,
Modified: trunk/docs/xml/manual-core-adv.xml
===================================================================
--- trunk/docs/xml/manual-core-adv.xml 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/docs/xml/manual-core-adv.xml 2011-06-28 08:20:39 UTC (rev 11844)
@@ -495,23 +495,23 @@
<para>Each tool can also provide tool-specific monitor commands.
An example of a tool specific monitor command is the Memcheck monitor
-command <computeroutput>mc.leak_check full
+command <computeroutput>leak_check full
reachable any</computeroutput>. This requests a full reporting of the
allocated memory blocks. To have this leak check executed, use the GDB
command:
<screen><![CDATA[
-(gdb) monitor mc.leak_check full reachable any
+(gdb) monitor leak_check full reachable any
]]></screen>
</para>
-<para>GDB will send the <computeroutput>mc.leak_check</computeroutput>
+<para>GDB will send the <computeroutput>leak_check</computeroutput>
command to the Valgrind gdbserver. The Valgrind gdbserver will
execute the monitor command itself, if it recognises it to be a Valgrind core
monitor command. If it is not recognised as such, it is assumed to
be tool-specific and is handed to the tool for execution. For example:
</para>
<programlisting><![CDATA[
-(gdb) monitor mc.leak_check full reachable any
+(gdb) monitor leak_check full reachable any
==2418== 100 bytes in 1 blocks are still reachable in loss record 1 of 1
==2418== at 0x4006E9E: malloc (vg_replace_malloc.c:236)
==2418== by 0x804884F: main (prog.c:88)
@@ -529,23 +529,25 @@
<para>As with other GDB commands, the Valgrind gdbserver will accept
abbreviated monitor command names and arguments, as long as the given
abbreviation is unambiguous. For example, the above
-<computeroutput>mc.leak_check</computeroutput>
+<computeroutput>leak_check</computeroutput>
command can also be typed as:
<screen><![CDATA[
-(gdb) mo mc.l f r a
+(gdb) mo l f r a
]]></screen>
The letters <computeroutput>mo</computeroutput> are recognised by GDB as being
an abbreviation for <computeroutput>monitor</computeroutput>. So GDB sends the
-string <computeroutput>mc.l f r a</computeroutput> to the Valgrind
+string <computeroutput>l f r a</computeroutput> to the Valgrind
gdbserver. The letters provided in this string are unambiguous for the
Valgrind gdbserver. This therefore gives the same output as the
unabbreviated command and arguments. If the provided abbreviation is
ambiguous, the Valgrind gdbserver will report the list of commands (or
argument values) that can match:
<programlisting><![CDATA[
-(gdb) mo mc. a r f
-mc. can match mc.get_vbits mc.leak_check mc.make_memory mc.check_memory
+(gdb) mo v. n
+v. can match v.set v.info v.wait v.kill v.translate
+(gdb) mo v.i n
+n_errs_found 0 (vgdb-error 0)
(gdb)
]]></programlisting>
</para>
@@ -555,8 +557,8 @@
lines, when given in a shell, will cause the same leak search to be executed
by the process 3145:
<screen><![CDATA[
-vgdb --pid=3145 mc.leak_check any full reachable
-vgdb --pid=3145 mc.l f r a
+vgdb --pid=3145 leak_check any full reachable
+vgdb --pid=3145 l f r a
]]></screen></para>
<para>Note that the Valgrind gdbserver automatically continues the
@@ -800,7 +802,7 @@
Whilst an inferior call is running, the Valgrind tool will report
errors as usual. If you do not want to have such errors stop the
execution of the inferior call, you can
- use <computeroutput>vg.set vgdb-error</computeroutput> to set a
+ use <computeroutput>v.set vgdb-error</computeroutput> to set a
big value before the call, then manually reset it to its original
value when the call is complete.</para>
@@ -988,10 +990,28 @@
</listitem>
<listitem>
+ <para><option>--wait=<number></option> instructs vgdb to
+ search for available Valgrind gdbservers for the specified number
+ of seconds. This makes it possible start a vgdb process
+ before starting the Valgrind gdbserver with which you intend the
+ vgdb to communicate. This option is useful when used in
+ conjunction with a <option>--vgdb-prefix</option> that is
+ unique to the process you want to wait for.
+ Also, if you use the <option>--wait</option> argument in the GDB
+ "target remote" command, you must set the GDB remotetimeout to a
+ value bigger than the --wait argument value. See option
+ <option>--max-invoke-ms</option> (just below)
+ for an example of setting the remotetimeout value.</para>
+ </listitem>
+
+ <listitem>
<para><option>--max-invoke-ms=<number></option> gives the
number of milliseconds after which vgdb will force the invocation
- of gdbserver embedded in valgrind. The default value is 100
- milliseconds. A value of 0 disables forced invocation.
+ of gdbserver embedded in Valgrind. The default value is 100
+ milliseconds. A value of 0 disables forced invocation. The forced
+ invocation is used when vgdb is connected to a Valgrind gdbserver,
+ and the Valgrind process has all its threads blocked in a system
+ call.
</para>
<para>If you specify a large value, you might need to increase the
@@ -1005,46 +1025,45 @@
]]></screen>
</para>
</listitem>
-
+
<listitem>
- <para><option>--wait=<number></option> instructs vgdb to
- search for available Valgrind gdbservers for the specified number
- of seconds. This makes it possible start a vgdb process
- before starting the Valgrind gdbserver with which you intend the
- vgdb to communicate. This option is useful when used in
- conjunction with a <option>--vgdb-prefix</option> that is
- unique to the process you want to wait for.
- Also, if you use the <option>--wait</option> argument in the GDB
- "target remote" command, you must set the GDB remotetimeout to a
- value bigger than the --wait argument value. See option
- <option>--max-invoke-ms</option> (just above)
- for an example of setting the remotetimeout value.</para>
+ <para><option>--cmd-time-out=<number></option> instructs a
+ standalone vgdb to 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.</para>
</listitem>
+
<listitem>
- <para><option>-c</option> To give more than one command, separate
- the commands by an option <option>-c</option>. Example:
+ <para><option>-c</option> To give more than one command to a
+ standalone vgdb, separate the commands by an
+ option <option>-c</option>. Example:
<screen><![CDATA[
-vgdb vg.set log_output -c mc.leak_check any
+vgdb v.set log_output -c leak_check any
]]></screen></para>
</listitem>
<listitem>
- <para><option>-d</option> instructs vgdb to produce debugging
- output. Give multiple <option>-d</option> args to increase the
- verbosity.</para>
+ <para><option>-l</option> instructs a standalone vgdb to report
+ the list of the Valgrind gdbserver processes running and then
+ exit.</para>
</listitem>
-
+
<listitem>
- <para><option>-D</option> instructs vgdb to show the state of the
- shared memory used by the Valgrind gdbserver. vgdb will exit after
- having shown the Valgrind gdbserver shared memory state.</para>
+ <para><option>-D</option> instructs a standalone vgdb to show the
+ state of the shared memory used by the Valgrind gdbserver. vgdb
+ will exit after having shown the Valgrind gdbserver shared memory
+ state.</para>
</listitem>
<listitem>
- <para><option>-l</option> instructs vgdb to report the list of
- the Valgrind gdbserver processes running and then exit.</para>
+ <para><option>-d</option> instructs vgdb to produce debugging
+ output. Give multiple <option>-d</option> args to increase the
+ verbosity. When giving <option>-d</option> to a relay vgdb, you better
+ redirect the standard error (stderr) of vgdb to a file to avoid
+ interaction between GDB and vgdb debugging output.</para>
</listitem>
+
</itemizedlist>
</sect2>
@@ -1069,23 +1088,23 @@
</listitem>
<listitem>
- <para><varname>vg.info all_errors</varname> shows all errors found
+ <para><varname>v.info all_errors</varname> shows all errors found
so far.</para>
</listitem>
<listitem>
- <para><varname>vg.info last_error</varname> shows the last error
+ <para><varname>v.info last_error</varname> shows the last error
found.</para>
</listitem>
<listitem>
- <para><varname>vg.info n_errs_found</varname> shows the number of
+ <para><varname>v.info n_errs_found</varname> shows the number of
errors found so far and the current value of the
<option>--vgdb-error</option>
argument.</para>
</listitem>
<listitem>
- <para><varname>vg.set {gdb_output | log_output |
+ <para><varname>v.set {gdb_output | log_output |
mixed_output}</varname> allows redirection of the Valgrind output
(e.g. the errors detected by the tool). The default setting is
<computeroutput>mixed_output</computeroutput>.</para>
@@ -1093,7 +1112,7 @@
<para>With <computeroutput>mixed_output</computeroutput>, the
Valgrind output goes to the Valgrind log (typically stderr) while
the output of the interactive GDB monitor commands (e.g.
- <computeroutput>vg.info last_error</computeroutput>)
+ <computeroutput>v.info last_error</computeroutput>)
is displayed by GDB.</para>
<para>With <computeroutput>gdb_output</computeroutput>, both the
@@ -1106,7 +1125,7 @@
</listitem>
<listitem>
- <para><varname>vg.wait [ms (default 0)]</varname> instructs
+ <para><varname>v.wait [ms (default 0)]</varname> instructs
Valgrind gdbserver to sleep "ms" milli-seconds and then
continue. When sent from a standalone vgdb, if this is the last
command, the Valgrind process will continue the execution of the
@@ -1117,14 +1136,14 @@
</listitem>
<listitem>
- <para><varname>vg.kill</varname> requests the gdbserver to kill
+ <para><varname>v.kill</varname> requests the gdbserver to kill
the process. This can be used from a standalone vgdb to properly
kill a Valgrind process which is currently expecting a vgdb
connection.</para>
</listitem>
<listitem>
- <para><varname>vg.set vgdb-error <errornr></varname>
+ <para><varname>v.set vgdb-error <errornr></varname>
dynamically changes the value of the
<option>--vgdb-error</option> argument. A
typical usage of this is to start with
@@ -1142,7 +1161,7 @@
<itemizedlist>
<listitem>
- <para><varname>vg.info gdbserver_status</varname> shows the
+ <para><varname>v.info gdbserver_status</varname> shows the
gdbserver status. In case of problems (e.g. of communications),
this showns the values of some relevant Valgrind gdbserver internal
variables. Note that the variables related to breakpoints and
@@ -1156,7 +1175,7 @@
</listitem>
<listitem>
- <para><varname>vg.info memory</varname> shows the statistics of
+ <para><varname>v.info memory</varname> shows the statistics of
Valgrind's internal heap management. If
option <option>--profile-heap=yes</option> was given, detailed
statistics will be output.
@@ -1164,14 +1183,14 @@
</listitem>
<listitem>
- <para><varname>vg.set debuglog <intvalue></varname> sets the
+ <para><varname>v.set debuglog <intvalue></varname> sets the
Valgrind debug log level to <intvalue>. This allows to
dynamically change the log level of Valgrind e.g. when a problem
is detected.</para>
</listitem>
<listitem>
- <para><varname>vg.translate <address>
+ <para><varname>v.translate <address>
[<traceflags>]</varname> shows the translation of the block
containing <computeroutput>address</computeroutput> with the given
trace flags. The <computeroutput>traceflags</computeroutput> value
Modified: trunk/gdbserver_tests/Makefile.am
===================================================================
--- trunk/gdbserver_tests/Makefile.am 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/Makefile.am 2011-06-28 08:20:39 UTC (rev 11844)
@@ -44,6 +44,11 @@
mcleak.stdinB.gdb \
mcleak.stdoutB.exp \
mcleak.vgtest \
+ mcmain_pic.stderrB.exp \
+ mcmain_pic.stderr.exp \
+ mcmain_pic.stdinB.gdb \
+ mcmain_pic.stdoutB.exp \
+ mcmain_pic.stdout.exp \
mcmain_pic.vgtest \
mcmain_pic.stderrB.exp \
mcmain_pic.stderr.exp \
Modified: trunk/gdbserver_tests/README_DEVELOPERS
===================================================================
--- trunk/gdbserver_tests/README_DEVELOPERS 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/README_DEVELOPERS 2011-06-28 08:20:39 UTC (rev 11844)
@@ -144,11 +144,11 @@
Validate monitor commands abbreviation recognition
***************************************************
-mo vg.info all_errors # to show all errors recorded so far
-mo vg.i a # the same
-mo v # must give an error: v can match vg.set vg.info
-mo vg # the same vg
-mo vg. # the same vg.
+mo v.info all_errors # to show all errors recorded so far
+mo v.i a # the same
+mo v # must give an error: v can match v.set v.info
+mo v # the same v
+mo v. # the same v.
test of gdb detaching or dying
******************************
@@ -159,11 +159,11 @@
gdb ./t
set remotetimeout 100
target remote|vgdb
-detach valgrind continues
+detach valgrind continues
target remote|vgdb reattach
-detach valgrind continues
+detach valgrind continues
target remote|vgdb reattach
-monitor vg.wait no effect
+monitor v.wait no effect
@@ -177,14 +177,14 @@
gdb ./t
set remotetimeout 1000
target remote | vgdb
-mo vg.set vgdb-error 1000 # so that valgrind does stop only at error 1000 and after
-mo vg.set gdb_output # to have further valgrind errors output in gdb
+mo v.set vgdb-error 1000 # so that valgrind does stop only at error 1000 and after
+mo v.set gdb_output # to have further valgrind errors output in gdb
c # continue, some errors will appear
C-c # interrupt program
-mo vg.set log_output # to set back the valgrind output to normal process log output
-mo mc.l # leak output to appear in log of process
-mo vg.set mixed_output
-mo mc.l # leak output to appear in gdb
+mo v.set log_output # to set back the valgrind output to normal process log output
+mo l # leak output to appear in log of process
+mo v.set mixed_output
+mo l # leak output to appear in gdb
@@ -207,7 +207,7 @@
In another window, do:
while true
do
- vgdb mc.leak
+ vgdb leak
sleep 1
done
Modified: trunk/gdbserver_tests/invoker
===================================================================
--- trunk/gdbserver_tests/invoker 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/invoker 2011-06-28 08:20:39 UTC (rev 11844)
@@ -4,7 +4,7 @@
# The first argument is the nr of times vgdb has to be called.
# rest of args are given to vgdb
# At the end of the loop, an additional call is done
-# but adding " -c vg.kill" to kill Valgrind process.
+# but adding " -c v.kill" to kill Valgrind process.
LOOPS=$1
shift
@@ -16,4 +16,4 @@
i=`expr $i + 1`
done
-./vgdb "$@" -c vg.kill
+./vgdb "$@" -c v.kill
Modified: trunk/gdbserver_tests/mcbreak.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcbreak.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcbreak.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcbreak
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
define checkstep
set $old_pc=$pc
@@ -25,7 +25,7 @@
checkstep
checkstep
#
-monitor vg.set vgdb-error 0
+monitor v.set vgdb-error 0
#
next
print whoami("first")
@@ -57,13 +57,13 @@
# delete all breaks
delete
continue
-monitor vg.info n_errs_found
+monitor v.info n_errs_found
# inferior call "in the middle" of an instruction is not working at least
# on all platforms, so comment the below.
# print whoami("after error: inferior call pushed from mcbreak.stdinB.gdb")
checkstep
-monitor vg.set vgdb-error 0
+monitor v.set vgdb-error 0
continue
# stop the process a.o. to avoid non deterministic output
-monitor vg.kill
+monitor v.kill
quit
Modified: trunk/gdbserver_tests/mcclean_after_fork.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcclean_after_fork.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcclean_after_fork.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcclean_after_fork
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# put a break in main, and then a watch
# also put breaks in code that only the child will execute.
@@ -21,5 +21,5 @@
#
# we should now have encountered the read watchpoint in the parent.
# let's kill the parent:
-monitor vg.kill
+monitor v.kill
quit
Modified: trunk/gdbserver_tests/mchelp.stderrB.exp
===================================================================
--- trunk/gdbserver_tests/mchelp.stderrB.exp 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mchelp.stderrB.exp 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,5 +1,5 @@
sending command help to pid ....
sending command help debug to pid ....
-sending command vg.kill to pid ....
+sending command v.kill to pid ....
readchar: Got EOF
error reading packet
Modified: trunk/gdbserver_tests/mchelp.stdoutB.exp
===================================================================
--- trunk/gdbserver_tests/mchelp.stdoutB.exp 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mchelp.stdoutB.exp 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,66 +1,66 @@
general valgrind monitor commands:
help [debug] : monitor command help. With debug: + debugging commands
- vg.wait [<ms>] : sleep <ms> (default 0) then continue
- vg.info all_errors : show all errors found so far
- vg.info last_error : show last error found
- vg.info n_errs_found : show the nr of errors found so far
- vg.kill : kill the Valgrind process
- vg.set gdb_output : set valgrind output to gdb
- vg.set log_output : set valgrind output to log
- vg.set mixed_output : set valgrind output to log, interactive output to gdb
- vg.set vgdb-error <errornr> : debug me at error >= <errornr>
+ v.wait [<ms>] : sleep <ms> (default 0) then continue
+ v.info all_errors : show all errors found so far
+ v.info last_error : show last error found
+ v.info n_errs_found : show the nr of errors found so far
+ v.kill : kill the Valgrind process
+ v.set gdb_output : set valgrind output to gdb
+ v.set log_output : set valgrind output to log
+ v.set mixed_output : set valgrind output to log, interactive output to gdb
+ v.set vgdb-error <errornr> : debug me at error >= <errornr>
memcheck monitor commands:
- mc.get_vbits <addr> [<len>]
+ get_vbits <addr> [<len>]
returns validity bits for <len> (or 1) bytes at <addr>
bit values 0 = valid, 1 = invalid, __ = unaddressable byte
- Example: mc.get_vbits 0x........ 10
- mc.make_memory [noaccess|undefined
- |defined|ifaddressabledefined] <addr> [<len>]
+ Example: get_vbits 0x........ 10
+ make_memory [noaccess|undefined
+ |defined|Definedifaddressable] <addr> [<len>]
mark <len> (or 1) bytes at <addr> with the given accessibility
- mc.check_memory [addressable|defined] <addr> [<len>]
+ check_memory [addressable|defined] <addr> [<len>]
check that <len> (or 1) bytes at <addr> have the given accessibility
and outputs a description of <addr>
- mc.leak_check [full*|summary] [reachable|leakpossible*|definiteleak]
+ leak_check [full*|summary] [reachable|possibleleak*|definiteleak]
[increased*|changed|any]
* = defaults
- Examples: mc.leak_check
- mc.leak_check summary any
+ Examples: leak_check
+ leak_check summary any
general valgrind monitor commands:
help [debug] : monitor command help. With debug: + debugging commands
- vg.wait [<ms>] : sleep <ms> (default 0) then continue
- vg.info all_errors : show all errors found so far
- vg.info last_error : show last error found
- vg.info n_errs_found : show the nr of errors found so far
- vg.kill : kill the Valgrind process
- vg.set gdb_output : set valgrind output to gdb
- vg.set log_output : set valgrind output to log
- vg.set mixed_output : set valgrind output to log, interactive output to gdb
- vg.set vgdb-error <errornr> : debug me at error >= <errornr>
+ v.wait [<ms>] : sleep <ms> (default 0) then continue
+ v.info all_errors : show all errors found so far
+ v.info last_error : show last error found
+ v.info n_errs_found : show the nr of errors found so far
+ v.kill : kill the Valgrind process
+ v.set gdb_output : set valgrind output to gdb
+ v.set log_output : set valgrind output to log
+ v.set mixed_output : set valgrind output to log, interactive output to gdb
+ v.set vgdb-error <errornr> : debug me at error >= <errornr>
debugging valgrind internals monitor commands:
- vg.info gdbserver_status : show gdbserver status
- vg.info memory : show valgrind heap memory stats
- vg.set debuglog <level> : set valgrind debug log level to <level>
- vg.translate <addr> [<traceflags>] : debug translation of <addr> with <traceflags>
+ v.info gdbserver_status : show gdbserver status
+ v.info memory : show valgrind heap memory stats
+ v.set debuglog <level> : set valgrind debug log level to <level>
+ v.translate <addr> [<traceflags>] : debug translation of <addr> with <traceflags>
(default traceflags 0b00100000 : show after instrumentation)
An additional flag 0b100000000 allows to show gdbserver instrumentation
memcheck monitor commands:
- mc.get_vbits <addr> [<len>]
+ get_vbits <addr> [<len>]
returns validity bits for <len> (or 1) bytes at <addr>
bit values 0 = valid, 1 = invalid, __ = unaddressable byte
- Example: mc.get_vbits 0x........ 10
- mc.make_memory [noaccess|undefined
- |defined|ifaddressabledefined] <addr> [<len>]
+ Example: get_vbits 0x........ 10
+ make_memory [noaccess|undefined
+ |defined|Definedifaddressable] <addr> [<len>]
mark <len> (or 1) bytes at <addr> with the given accessibility
- mc.check_memory [addressable|defined] <addr> [<len>]
+ check_memory [addressable|defined] <addr> [<len>]
check that <len> (or 1) bytes at <addr> have the given accessibility
and outputs a description of <addr>
- mc.leak_check [full*|summary] [reachable|leakpossible*|definiteleak]
+ leak_check [full*|summary] [reachable|possibleleak*|definiteleak]
[increased*|changed|any]
* = defaults
- Examples: mc.leak_check
- mc.leak_check summary any
+ Examples: leak_check
+ leak_check summary any
monitor command request to kill this process
Modified: trunk/gdbserver_tests/mchelp.vgtest
===================================================================
--- trunk/gdbserver_tests/mchelp.vgtest 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mchelp.vgtest 2011-06-28 08:20:39 UTC (rev 11844)
@@ -4,6 +4,6 @@
stdout_filter: filter_make_empty
stderr_filter: filter_make_empty
progB: vgdb
-argsB: --wait=60 --vgdb-prefix=./vgdb-prefix-mchelp -c help -c help debug -c vg.kill
+argsB: --wait=60 --vgdb-prefix=./vgdb-prefix-mchelp -c help -c help debug -c v.kill
stdoutB_filter: filter_memcheck_monitor
stderrB_filter: filter_vgdb
Modified: trunk/gdbserver_tests/mcinfcallRU.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcinfcallRU.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinfcallRU.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcinfcallRU
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# We will interrupt in a few seconds (be sure the main task is ready).
# Once it is ready, we still have to wait to be sure it is running.
@@ -15,5 +15,5 @@
# before they have a chance to execute the whoami
# thread apply all
print whoami("inferior call pushed from gdb in mcinfcallRU.stdinB.gdb")
-monitor vg.kill
+monitor v.kill
quit
Modified: trunk/gdbserver_tests/mcinfcallWSRU.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcinfcallWSRU.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinfcallWSRU.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcinfcallWSRU
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# ensure all threads are known
break sleeper_or_burner
@@ -25,5 +25,5 @@
print whoami("thread 3 inferior call pushed from gdb in mcinfcallWSRU.stdinB.gdb")
thread 4
print whoami("thread 4 inferior call pushed from gdb in mcinfcallWSRU.stdinB.gdb")
-monitor vg.kill
+monitor v.kill
quit
Modified: trunk/gdbserver_tests/mcinvokeRU.stderrB.exp
===================================================================
--- trunk/gdbserver_tests/mcinvokeRU.stderrB.exp 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinvokeRU.stderrB.exp 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,14 +1,14 @@
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.kill to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.kill to pid ....
readchar: Got EOF
error reading packet
Modified: trunk/gdbserver_tests/mcinvokeRU.vgtest
===================================================================
--- trunk/gdbserver_tests/mcinvokeRU.vgtest 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinvokeRU.vgtest 2011-06-28 08:20:39 UTC (rev 11844)
@@ -6,7 +6,7 @@
stderr_filter: filter_make_empty
# as the Valgrind process is always busy, we do not need the vgdb.ptraceinvoker prereq.
progB: invoker
-argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeRU --wait=60 -c vg.wait 0
+argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeRU --wait=60 -c v.wait 0
# if the --wait is not enough, the test will fail or block.
stdoutB_filter: filter_memcheck_monitor
stderrB_filter: filter_vgdb
Modified: trunk/gdbserver_tests/mcinvokeWS.stderrB.exp
===================================================================
--- trunk/gdbserver_tests/mcinvokeWS.stderrB.exp 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinvokeWS.stderrB.exp 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,14 +1,14 @@
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.wait 0 to pid ....
-sending command vg.kill to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.wait 0 to pid ....
+sending command v.kill to pid ....
readchar: Got EOF
error reading packet
Modified: trunk/gdbserver_tests/mcinvokeWS.vgtest
===================================================================
--- trunk/gdbserver_tests/mcinvokeWS.vgtest 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcinvokeWS.vgtest 2011-06-28 08:20:39 UTC (rev 11844)
@@ -6,7 +6,7 @@
stderr_filter: filter_make_empty
prereq: test -f vgdb.ptraceinvoker
progB: invoker
-argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeWS --wait=60 -c vg.wait 0
+argsB: 10 --vgdb-prefix=./vgdb-prefix-mcinvokeWS --wait=60 -c v.wait 0
# if the --wait is not enough, the test will fail or block
stdoutB_filter: filter_memcheck_monitor
stderrB_filter: filter_vgdb
Modified: trunk/gdbserver_tests/mcleak.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcleak.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcleak.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcleak
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
#
# insert break:
@@ -13,13 +13,13 @@
#
# fprintf(stderr, "expecting details 10 bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable any
+monitor leak_check full reachable any
continue
# VALGRIND_DO_LEAK_CHECK;
#
# fprintf(stderr, "expecting to have NO details\n"); fflush(stderr);
up
-monitor mc.leak_check full reachable increased
+monitor leak_check full reachable increased
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
@@ -27,7 +27,7 @@
# b21 = malloc (21);
# fprintf(stderr, "expecting details +10 bytes lost, +21 bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable increased
+monitor leak_check full reachable increased
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
@@ -35,41 +35,41 @@
# b32_33[i] = malloc (32+i);
# fprintf(stderr, "expecting details +65 bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable increased
+monitor leak_check full reachable increased
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# fprintf(stderr, "expecting to have NO details\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable increased
+monitor leak_check full reachable increased
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# b10++;
# fprintf(stderr, "expecting details +10 bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable increased
+monitor leak_check full reachable increased
continue
# VALGRIND_DO_ADDED_LEAK_CHECK;
#
# b10--;
# fprintf(stderr, "expecting details -10 bytes reachable, +10 bytes lost\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable changed
+monitor leak_check full reachable changed
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
# b10++;
# fprintf(stderr, "expecting details -10 bytes lost, +10 bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable changed
+monitor leak_check full reachable changed
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
# b32_33[0]--;
# fprintf(stderr, "expecting details 32 (+32) bytes lost, 33 (-32) bytes reachable\n"); fflush(stderr); breakme();
up
-monitor mc.leak_check full reachable changed
+monitor leak_check full reachable changed
continue
# VALGRIND_DO_CHANGED_LEAK_CHECK;
#
Modified: trunk/gdbserver_tests/mcmain_pic.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcmain_pic.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcmain_pic.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcmain_pic
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# break
break main
Modified: trunk/gdbserver_tests/mcsignopass.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcsignopass.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcsignopass.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcsignopass
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# instruct gdb to not pass (i.e. ignore) these signals.
#
Modified: trunk/gdbserver_tests/mcsigpass.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcsigpass.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcsigpass.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcsigpass
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
# After this continue, we will receive 5 signals.
continue
Modified: trunk/gdbserver_tests/mcvabits.stdinB.gdb
===================================================================
--- trunk/gdbserver_tests/mcvabits.stdinB.gdb 2011-06-28 07:38:17 UTC (rev 11843)
+++ trunk/gdbserver_tests/mcvabits.stdinB.gdb 2011-06-28 08:20:39 UTC (rev 11844)
@@ -1,7 +1,7 @@
# connect gdb to Valgrind gdbserver:
target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-mcvabits
echo vgdb launched process attached\n
-monitor vg.set vgdb-error 999999
+monitor v.set vgdb-error 999999
#
#
# insert break:
@@ -20,55 +20,55 @@
set $0xundefined = &undefined
#
# Verif A-bits, V-bits, Get V-bits: A,V,G [0..9]
-eval "monitor mc.check_memory addressable 0x%x 10", $0xundefined
-eval "monitor mc.check_memory defined 0x%x 10", $0xundefined
-eval "monitor mc.get_vbits 0x%x 10", $0xundefined
+eval "monitor check_memory addressable 0x%x 10", $0xundefined
+eval "monitor check_memory defined 0x%x 10", $0xundefined
+eval "monitor get_vbits 0x%x 10", $0xundefined
#
# continue till //2break:
continue
#
# A,V,G [0..9] after the undefinition of some bytes by...
[truncated message content] |