* ==================== OTHER CHANGES ====================
+ - Addition of GDB server monitor command 'v.info open_fds' that gives the
+ list of open file descriptors and additional details.
+
* ==================== FIXED BUGS ====================
The following bugs have been fixed or resolved. Note that "n-i-bz"
307155 [390] filter_gdb should filter out syscall-template.S T_PSEUDO
308321 [390] testsuite memcheck filter interferes with gdb_filter
308341 [390] vgdb should report process exit (or fatal signal)
+308644 [390] vgdb command for having the info for the track-fds option
n-i-bz [390] report error for vgdb snapshot requested before execution
n-i-bz [390] Some wrong command line options could be ignored
VG_(gdb_printf) (
"general valgrind monitor commands:\n"
-" help [debug] : monitor command help. With debug: + debugging commands\n"
+" help [debug] : monitor command help. With debug: + debugging commands\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.info open_fds : show open file descriptors (only if --track-fds=yes)\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"
wcmd = strtok_r (NULL, " ", &ssaveptr);
switch (kwdid = VG_(keyword_id)
("all_errors n_errs_found last_error gdbserver_status memory"
- " scheduler",
+ " scheduler open_fds",
wcmd, kwd_report_all)) {
case -2:
case -1:
VG_(show_sched_status) ();
ret = 1;
break;
+ case 6: /* open_fds */
+ if (VG_(clo_track_fds))
+ VG_(show_open_fds) ("");
+ else
+ VG_(gdb_printf)
+ ("Valgrind must be started with --track-fds=yes"
+ " to show open fds\n");
+ ret = 1;
+ break;
default:
vg_assert(0);
}
/* Print out file descriptor summary and stats. */
if (VG_(clo_track_fds))
- VG_(show_open_fds)();
+ VG_(show_open_fds)("at exit");
/* Call the tool's finalisation function. This makes Memcheck's
leak checker run, and possibly chuck a bunch of leak errors into
/* Dump out a summary, and a more detailed list, of open file descriptors. */
-void VG_(show_open_fds) (void)
+void VG_(show_open_fds) (HChar* when)
{
OpenFd *i = allocated_fds;
- VG_(message)(Vg_UserMsg, "FILE DESCRIPTORS: %d open at exit.\n", fd_count);
+ VG_(message)(Vg_UserMsg, "FILE DESCRIPTORS: %d open %s.\n", fd_count, when);
while (i) {
if (i->pathname) {
/* fd leakage calls. */
extern void VG_(init_preopened_fds) ( void );
-extern void VG_(show_open_fds) ( void );
+extern void VG_(show_open_fds) ( HChar* when );
// When the final thread is done, where shall I call to shutdown the
// system cleanly? Is set once at startup (in m_main) and never
value of the <option>--vgdb-error</option> argument.</para>
</listitem>
+ <listitem>
+ <para><varname>v.info open_fds</varname> shows the list of open file
+ descriptors and details related to the file descriptor.
+ This only works if <option>--track-fds=yes</option>
+ was given at Valgrind startup.</para>
+ </listitem>
+
<listitem>
<para><varname>v.set {gdb_output | log_output |
mixed_output}</varname> allows redirection of the Valgrind output
</term>
<listitem>
<para>When enabled, Valgrind will print out a list of open file
- descriptors on exit. Along with each file descriptor is printed a
- stack backtrace of where the file was opened and any details
- relating to the file descriptor such as the file name or socket
- details.</para>
+ descriptors on exit or on request, via the gdbserver monitor
+ command <varname>v.info open_fds</varname>. Along with each
+ file descriptor is printed a stack backtrace of where the file
+ was opened and any details relating to the file descriptor such
+ as the file name or socket details.</para>
</listitem>
</varlistentry>
general valgrind monitor commands:
- help [debug] : monitor command help. With debug: + debugging commands
+ help [debug] : monitor command help. With debug: + debugging commands
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.info open_fds : show open file descriptors (only if --track-fds=yes)
v.kill : kill the Valgrind process
v.set gdb_output : set valgrind output to gdb
v.set log_output : set valgrind output to log
with len > 1, will also show "interior pointers")
general valgrind monitor commands:
- help [debug] : monitor command help. With debug: + debugging commands
+ help [debug] : monitor command help. With debug: + debugging commands
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.info open_fds : show open file descriptors (only if --track-fds=yes)
v.kill : kill the Valgrind process
v.set gdb_output : set valgrind output to gdb
v.set log_output : set valgrind output to log
relaying data between gdb and process ....
vgdb-error value changed from 0 to 999999
general valgrind monitor commands:
- help [debug] : monitor command help. With debug: + debugging commands
+ help [debug] : monitor command help. With debug: + debugging commands
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.info open_fds : show open file descriptors (only if --track-fds=yes)
v.kill : kill the Valgrind process
v.set gdb_output : set valgrind output to gdb
v.set log_output : set valgrind output to log