]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
* compare vgdb-error with n_errs_shown, not with n_errs_found.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 15 Feb 2012 22:29:30 +0000 (22:29 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 15 Feb 2012 22:29:30 +0000 (22:29 +0000)
  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

NEWS
coregrind/m_errormgr.c
coregrind/m_gdbserver/server.c
coregrind/pub_core_errormgr.h
docs/xml/manual-core-adv.xml
gdbserver_tests/mcbreak.stderrB.exp

diff --git a/NEWS b/NEWS
index 9c4352aebd4608bf63bc8dfdabe7daf39476f120..e169ac1ce336a1fef00d9251efd2685c1d657b5a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -58,7 +58,7 @@ where XXXXXX is the bug number as listed below.
 290974  vgdb must align pages to VKI_SHMLBA (16KB) on ARM 
 293088  Add some VEX sanity checks for ppc64 unhandled instructions
 294055  regtest none/tests/shell fails when locale is not set to C
-
+294190  --vgdb-error=xxx can be out of sync with errors shown to the user
 
 Release 3.7.0 (5 November 2011)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 793542c952c65ab85f625681dc38e5cb698b6e54..1d0869051c779b57e5fe3c7fc0ec702cb0fcbe35 100644 (file)
@@ -82,6 +82,9 @@ static UInt n_errs_found = 0;
 /* 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 @@ UInt VG_(get_n_errs_found)( void )
    return n_errs_found;
 }
 
+UInt VG_(get_n_errs_shown)( void )
+{
+   return n_errs_shown;
+}
+
 /*------------------------------------------------------------*/
 /*--- Suppression type                                     ---*/
 /*------------------------------------------------------------*/
@@ -498,7 +506,7 @@ void do_actions_on_error(Error* err, Bool allow_db_attach)
    /* 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 @@ void construct_error ( Error* err, ThreadId tid, ErrorKind ekind, Addr a,
 
 
 
-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 @@ void VG_(maybe_record_error) ( ThreadId tid,
    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 @@ Bool VG_(unique_error) ( ThreadId tid, ErrorKind ekind, Addr a, Char* s,
       }
 
       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;
 
index a1a26087f54958c9d49126840c74ab4d27420d65..d8e6094d6dcb96c9618094dac3a91df587124fd4 100644 (file)
@@ -246,8 +246,9 @@ int handle_gdb_valgrind_command (char* mon, OutputSink* sink_wanted_at_return)
          VG_(show_all_errors)(/* verbosity */ 2, /* xml */ False);
          break;
       case  1: // n_errs_found
-         VG_(gdb_printf) ("n_errs_found %d (vgdb-error %d)\n", 
+         VG_(gdb_printf) ("n_errs_found %d n_errs_shown %d (vgdb-error %d)\n", 
                           VG_(get_n_errs_found) (),
+                          VG_(get_n_errs_shown) (),
                           VG_(dyn_vgdb_error));
          break;
       case 2: // last_error
index c9f5aa950c62427fdadc367957cd7f2f6842ea9b..4cd0ace32f5fec82c99249b54b2bb74c5d92afaf 100644 (file)
@@ -67,6 +67,7 @@ extern Bool VG_(is_action_requested)      ( Char* action, Bool* clo );
 extern Bool VG_(showing_core_errors)      ( void );
 
 extern UInt VG_(get_n_errs_found)         ( void );
+extern UInt VG_(get_n_errs_shown)         ( void );
 
 extern void VG_(print_errormgr_stats)     ( void );
 
index 3b602f9a01ac88383ecd36a0519cc21646294cef..97ded71a57261b01c40c24d17927f5b82b15ba9c 100644 (file)
@@ -381,7 +381,7 @@ specifying either <option>--vgdb=yes</option>
 or <option>--vgdb=full</option>.  A secondary command line option,
 <option>--vgdb-error=number</option>, can be used to tell the gdbserver
 only to become active once the specified number of errors have been
-reported.  A value of zero will therefore cause
+shown.  A value of zero will therefore cause
 the gdbserver to become active at startup, which allows you to
 insert breakpoints before starting the run.  For example:
 <screen><![CDATA[
@@ -625,7 +625,7 @@ argument values) that can match:
 (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)
+n_errs_found 0 n_errs_shown 0 (vgdb-error 0)
 (gdb) 
 ]]></programlisting>
 </para>
@@ -1196,9 +1196,8 @@ line, by using a standalone vgdb, or from GDB, by using GDB's
 
   <listitem>
     <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>
+    errors found so far, the nr of errors shown so far and the current
+    value of the <option>--vgdb-error</option> argument.</para>
   </listitem>
 
   <listitem>
index d5eaecf10b8bb29169f572913dad4289458cf39f..3bf12a0ff25bd4732543a6b90fcc2a297731510e 100644 (file)
@@ -1,7 +1,7 @@
 relaying data between gdb and process ....
 vgdb-error value changed from 0 to 999999
 vgdb-error value changed from 999999 to 0
-n_errs_found 1 (vgdb-error 0)
+n_errs_found 1 n_errs_shown 1 (vgdb-error 0)
 vgdb-error value changed from 0 to 0
 monitor command request to kill this process
 Remote connection closed