]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Added "Int exitcode" argument to SK_(fini)(), because it could be useful
authorNicholas Nethercote <njn@valgrind.org>
Tue, 22 Apr 2003 21:41:40 +0000 (21:41 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 22 Apr 2003 21:41:40 +0000 (21:41 +0000)
for skins.

Changed lackey to print out the exit code.

Changed AUTOMAKE_OPTIONS back to 1.5 (whoops)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1538

13 files changed:
Makefile.am
addrcheck/ac_main.c
cachegrind/cg_main.c
corecheck/cc_main.c
coregrind/vg_default.c
coregrind/vg_main.c
example/ex_main.c
helgrind/hg_main.c
include/vg_skin.h
lackey/lk_main.c
lackey/tests/filter_stderr
memcheck/mc_main.c
none/nl_main.c

index cdb6f36c82c5d4956e0ccf6d7bb478cfb784f369..9e9e1d67e644e77f34f0e9ca5b1165a6f1f777b7 100644 (file)
@@ -1,5 +1,5 @@
 
-AUTOMAKE_OPTIONS = 1.4
+AUTOMAKE_OPTIONS = 1.5
 
 ## coregrind must come before memcheck, addrcheck, helgrind, for
 ##   vg_replace_malloc.o.
index 2df76da6603c1ea918726d90022f3cb0bdfc876e..1e259cd9511e0564c7657b98d5622391853cca44 100644 (file)
@@ -1243,7 +1243,7 @@ void SK_(post_clo_init) ( void )
 {
 }
 
-void SK_(fini) ( void )
+void SK_(fini) ( Int exitcode )
 {
    MAC_(common_fini)( ac_detect_memory_leaks );
 }
index 24a69d2a3b83bb0719f99207b1856b47bfa8d720..943b4989a5ef4367b8f9ae177b889f8816a875dc 100644 (file)
@@ -1674,7 +1674,7 @@ void percentify(Int n, Int pow, Int field_width, char buf[])
    for (i = 0; i < space; i++)  buf[i] = ' ';
 }
 
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
    CC D_total;
    ULong L2_total_m, L2_total_mr, L2_total_mw,
index 340a78df8530f46a021887e0314a200fc6b8aa82..b30d94c9666ebaf30d8dbd9d274835bbc29e2ccf 100644 (file)
@@ -56,7 +56,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
     return cb;
 }
 
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
 }
 
index 800e258c3ebf08e3b9718236f55d1a84a583df58..6aea85e25d70db5bc32fc19be361bcb6684cf552 100644 (file)
@@ -89,7 +89,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr not_used)
 }
 
 __attribute__ ((weak))
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
    fund_panic("SK_(fini)");
 }
index 902b5f072bee5cfd9d7b33a4e51c20b2e28d7c7b..513aa8c9446c79a0816dea09758f306dea92f10c 100644 (file)
@@ -1480,7 +1480,7 @@ void VG_(main) ( void )
    if (VG_(needs).core_errors || VG_(needs).skin_errors)
       VG_(show_all_errors)();
 
-   SK_(fini)();
+   SK_(fini)( VG_(exitcode) );
 
    VG_(do_sanity_checks)( True /*include expensive checks*/ );
 
index 0f57ddcceff7a449c57da3c9f52b4bbda4cb5fcc..5e393817367170266a1f9501ea65cfefd24aedbe 100644 (file)
@@ -28,7 +28,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
     return cb;
 }
 
-void SK_(fini)(void)
+void SK_(fini)(exitcode)
 {
 }
 
index 340d31182584fc5fdc5c963f1122673f8871ec58..e85d15f08f810a0ca7b6ef61ad54f714476d3eb7 100644 (file)
@@ -3394,7 +3394,7 @@ void SK_(post_clo_init)(void)
 }
 
 
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
    if (DEBUG_LOCK_TABLE) {
       pp_all_LockSets();
index 2fe3e2255166fbcef643ca0cb5e479f6226f6fb1..24b1599647bd6d2a346ca852d17af0146bece80b 100644 (file)
@@ -1653,8 +1653,11 @@ extern void        SK_(post_clo_init)( void );
    'orig_addr' is the address of the first instruction in the block. */
 extern UCodeBlock* SK_(instrument)   ( UCodeBlock* cb, Addr orig_addr );
 
-/* Finish up, print out any results, etc. */
-extern void        SK_(fini)         ( void );
+/* Finish up, print out any results, etc.  `exitcode' is program's exit
+   code.  The shadow (if the `shadow_regs' need is set) can be found with
+   VG_(get_shadow_archreg)(R_EBX), since %ebx holds the argument to the
+   exit() syscall.  */
+extern void        SK_(fini)         ( Int exitcode );
 
 
 /* ------------------------------------------------------------------ */
index 4770063114ee594f301896c0b035b0661331b06e..a22692211384e38c4153c675bdaf64380a3fb28b 100644 (file)
@@ -201,7 +201,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb_in, Addr orig_addr)
    return cb;
 }
 
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
     VG_(message)(Vg_UserMsg,
                  "Counted %d calls to _dl_runtime_resolve()", n_dlrr_calls);
@@ -227,6 +227,8 @@ void SK_(fini)(void)
     VG_(message)(Vg_UserMsg, "     UInstrs : x86_instr = %3u : 10",
                              10 * n_UInstrs / n_x86_instrs);
 
+    VG_(message)(Vg_UserMsg, "");
+    VG_(message)(Vg_UserMsg, "Exit code:     %d", exitcode);
 }
 
 /*--------------------------------------------------------------------*/
index 6fd7ebdbe90ea964fceda579a18d320fe77e2d80..1f415be4b4dac94ca27bd46f9534537e97754068 100755 (executable)
@@ -22,6 +22,8 @@ $dir/../../tests/filter_stderr_basic    |
 #       UInstrs : BB        = 111 : 10
 #       UInstrs : x86_instr =  27 : 10
 #
+#  Exit code:     0
+#
 # ...so chop all lines between first and last (inclusive)
 sed "/^Counted [0-9]\+ calls to _dl_runtime_resolve()$/ ,   \
      /UInstrs : x86_instrs = [0-9]\+ : [0-9]\+/             \
index e77456107d656d4dcced832e269ea928e9f7bd73..149bb238153d4908eedf72eca15efdb499aeb558 100644 (file)
@@ -1613,7 +1613,7 @@ void SK_(post_clo_init) ( void )
 {
 }
 
-void SK_(fini) ( void )
+void SK_(fini) ( Int exitcode )
 {
    MAC_(common_fini)( MC_(detect_memory_leaks) );
    
index b823bb51f1e47046d016d7fa62cbaa355c82ccff..a7283dcf1e21a537af9436cba4b84092ca6e4f2f 100644 (file)
@@ -53,7 +53,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
     return cb;
 }
 
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
 {
 }