* compare vgdb-error with n_errs_shown, not with n_errs_found.
  Using n_errs_shown allows the user to stop on an error
  identified in a previous run by counting errors shown.
* shows also n_errs_shown in monitor command v.info n_errs_found
* slightly clarified the manual, updated to new output of v.info n_errs_found



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12388 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_errormgr.c b/coregrind/m_errormgr.c
index 793542c..1d08690 100644
--- a/coregrind/m_errormgr.c
+++ b/coregrind/m_errormgr.c
@@ -82,6 +82,9 @@
 /* Running count of suppressed errors detected. */
 static UInt n_errs_suppressed = 0;
 
+/* Running count of errors shown. */
+static UInt n_errs_shown = 0;
+
 /* Running count of unsuppressed error contexts. */
 static UInt n_err_contexts = 0;
 
@@ -171,6 +174,11 @@
    return n_errs_found;
 }
 
+UInt VG_(get_n_errs_shown)( void )
+{
+   return n_errs_shown;
+}
+
 /*------------------------------------------------------------*/
 /*--- Suppression type                                     ---*/
 /*------------------------------------------------------------*/
@@ -498,7 +506,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 +646,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. */
@@ -796,12 +802,12 @@
    p->supp = is_suppressible_error(&err);
    errors  = p;
    if (p->supp == NULL) {
+      /* update stats */
       n_err_contexts++;
       n_errs_found++;
+      n_errs_shown++;
       /* Actually show the error; more complex than you might think. */
       pp_Error( p, /*allow_db_attach*/True, VG_(clo_xml) );
-      /* update stats */
-      n_errs_shown++;
    } else {
       n_supp_contexts++;
       n_errs_suppressed++;
@@ -848,10 +854,10 @@
       }
 
       if (print_error) {
-         /* Actually show the error; more complex than you might think. */
-         pp_Error(&err, allow_db_attach, VG_(clo_xml));
          /* update stats */
          n_errs_shown++;
+         /* Actually show the error; more complex than you might think. */
+         pp_Error(&err, allow_db_attach, VG_(clo_xml));
       }
       return False;