On Thu, 2012-02-09 at 11:36 +0000, Rob wrote:
> The gdbserver is a great new feature but I am having trouble getting it to 
> stop on the desired error.
> 
> 
> If I have previously run valgrind (eg. overnight) and have the output, I 
> can't seem to determine 
> the correct error count to cause a subsequent run to stop at a particular 
> error.  The count of the
>  error I want is higher than the number of errors apparent in the preceding 
> output (presumably due
>  to valgrind not printing duplicate errors and/or the suppression file I am 
> using).  Is there an 
> easy way to identify the correct number, or would it be useful to add the 
> error number to
>  the valgrind output? eg:
> 
> ==6098== Conditional jump or move depends on uninitialised value(s) [error 
> #17]
> 
> thanks,
> Rob

Adding the error nr in the Valgrind output would help, but I am not
sure the improvement in gdbserver usage is worth always printing an
error nr (and adding an option --with-error-nr=yes/no looks an overkill
to me). Unless an error nr would be generally useful ? See e.g. how
the 'loss record nr' is now used in 3.8.0SVN to give more details (e.g.
the list of blocks leaked) about a leak.

In any case, it looks more logical (and might be sufficient) to have
--vgdb-error compared to the nr of shown errors rather than to the
nr of found (and possibly suppressed/possibly not shown errors).

Can you try the patch below and see if that is working and
sufficient for you ?

Thanks

Philippe


Index: coregrind/m_errormgr.c
===================================================================
--- coregrind/m_errormgr.c      (revision 12373)
+++ coregrind/m_errormgr.c      (working copy)
@@ -79,6 +79,9 @@
 /* Running count of unsuppressed errors detected. */
 static UInt n_errs_found = 0;
 
+/*  Running count of errors shown. */
+static Int  n_errs_shown = 0;
+
 /* Running count of suppressed errors detected. */
 static UInt n_errs_suppressed = 0;
 
@@ -498,7 +501,7 @@
    /* if user wants to debug from a certain error nr, then wait for gdb/vgdb */
    if (VG_(clo_vgdb) != Vg_VgdbNo
        && allow_db_attach 
-       && VG_(dyn_vgdb_error) <= n_errs_found) {
+       && VG_(dyn_vgdb_error) <= n_errs_shown) {
       VG_(umsg)("(action on error) vgdb me ... \n");
       VG_(gdbserver)( err->tid );
       VG_(umsg)("Continuing ...\n");
@@ -638,8 +641,6 @@
 
 
 
-static Int  n_errs_shown = 0;
-
 /* Top-level entry point to the error management subsystem.
    All detected errors are notified here; this routine decides if/when the
    user should see the error. */



------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to