aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2003-04-22 21:41:40 +0000
committernjn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9>2003-04-22 21:41:40 +0000
commit7d9f94dda63c0e604774f491ed6b3decbf5c3ce5 (patch)
treecb5fffe13d8928c17449833b8ccecf8206188a3f
parent4e59bd9d4deb0a04d673c9af09c5e92054c6a424 (diff)
downloadvalgrind-7d9f94dda63c0e604774f491ed6b3decbf5c3ce5.tar.gz
Added "Int exitcode" argument to SK_(fini)(), because it could be useful
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 a5019735-40e9-0310-863c-91ae7b9d1cf9
-rw-r--r--Makefile.am2
-rw-r--r--addrcheck/ac_main.c2
-rw-r--r--cachegrind/cg_main.c2
-rw-r--r--corecheck/cc_main.c2
-rw-r--r--coregrind/vg_default.c2
-rw-r--r--coregrind/vg_main.c2
-rw-r--r--example/ex_main.c2
-rw-r--r--helgrind/hg_main.c2
-rw-r--r--include/vg_skin.h7
-rw-r--r--lackey/lk_main.c4
-rwxr-xr-xlackey/tests/filter_stderr2
-rw-r--r--memcheck/mc_main.c2
-rw-r--r--none/nl_main.c2
13 files changed, 20 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index cdb6f36c8..9e9e1d67e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
-AUTOMAKE_OPTIONS = 1.4
+AUTOMAKE_OPTIONS = 1.5
## coregrind must come before memcheck, addrcheck, helgrind, for
## vg_replace_malloc.o.
diff --git a/addrcheck/ac_main.c b/addrcheck/ac_main.c
index 2df76da66..1e259cd95 100644
--- a/addrcheck/ac_main.c
+++ b/addrcheck/ac_main.c
@@ -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 );
}
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 24a69d2a3..943b4989a 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -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,
diff --git a/corecheck/cc_main.c b/corecheck/cc_main.c
index 340a78df8..b30d94c96 100644
--- a/corecheck/cc_main.c
+++ b/corecheck/cc_main.c
@@ -56,7 +56,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
return cb;
}
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
{
}
diff --git a/coregrind/vg_default.c b/coregrind/vg_default.c
index 800e258c3..6aea85e25 100644
--- a/coregrind/vg_default.c
+++ b/coregrind/vg_default.c
@@ -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)");
}
diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c
index 902b5f072..513aa8c94 100644
--- a/coregrind/vg_main.c
+++ b/coregrind/vg_main.c
@@ -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*/ );
diff --git a/example/ex_main.c b/example/ex_main.c
index 0f57ddcce..5e3938173 100644
--- a/example/ex_main.c
+++ b/example/ex_main.c
@@ -28,7 +28,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
return cb;
}
-void SK_(fini)(void)
+void SK_(fini)(exitcode)
{
}
diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c
index 340d31182..e85d15f08 100644
--- a/helgrind/hg_main.c
+++ b/helgrind/hg_main.c
@@ -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();
diff --git a/include/vg_skin.h b/include/vg_skin.h
index 2fe3e2255..24b159964 100644
--- a/include/vg_skin.h
+++ b/include/vg_skin.h
@@ -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 );
/* ------------------------------------------------------------------ */
diff --git a/lackey/lk_main.c b/lackey/lk_main.c
index 477006311..a22692211 100644
--- a/lackey/lk_main.c
+++ b/lackey/lk_main.c
@@ -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);
}
/*--------------------------------------------------------------------*/
diff --git a/lackey/tests/filter_stderr b/lackey/tests/filter_stderr
index 6fd7ebdbe..1f415be4b 100755
--- a/lackey/tests/filter_stderr
+++ b/lackey/tests/filter_stderr
@@ -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]\+/ \
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c
index e77456107..149bb2381 100644
--- a/memcheck/mc_main.c
+++ b/memcheck/mc_main.c
@@ -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) );
diff --git a/none/nl_main.c b/none/nl_main.c
index b823bb51f..a7283dcf1 100644
--- a/none/nl_main.c
+++ b/none/nl_main.c
@@ -53,7 +53,7 @@ UCodeBlock* SK_(instrument)(UCodeBlock* cb, Addr a)
return cb;
}
-void SK_(fini)(void)
+void SK_(fini)(Int exitcode)
{
}