aboutsummaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-12-30 10:31:19 +0000
committerMike Frysinger <vapier@gentoo.org>2014-02-08 07:01:38 -0500
commit0b7c7473b9ffaf5128acc40d53685e1c8bd5de73 (patch)
tree64f0dca0f1e39930da8a6ba07111bfe6458e0a4d /debug
parentac8cc9e300a002228eb7e660df3e7b333d9a7414 (diff)
downloadglibc-0b7c7473b9ffaf5128acc40d53685e1c8bd5de73.tar
glibc-0b7c7473b9ffaf5128acc40d53685e1c8bd5de73.tar.gz
glibc-0b7c7473b9ffaf5128acc40d53685e1c8bd5de73.tar.bz2
glibc-0b7c7473b9ffaf5128acc40d53685e1c8bd5de73.zip
tst-backtrace4: expand output even on failures
When debugging failures in this test, it's helpful to see as much output as possible. So rather than returning immediately, let the code run as far as it can. We still mark failures as soon as they happen. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'debug')
-rw-r--r--debug/tst-backtrace4.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/debug/tst-backtrace4.c b/debug/tst-backtrace4.c
index a98775a6e2..26fbdd00fc 100644
--- a/debug/tst-backtrace4.c
+++ b/debug/tst-backtrace4.c
@@ -49,12 +49,16 @@ handle_signal (int signum)
/* Get the backtrace addresses. */
n = backtrace (addresses, sizeof (addresses) / sizeof (addresses[0]));
- printf ("Obtained backtrace with %d functions\n", n);
- /* Check that there are at least six functions. */
+ printf ("Obtained backtrace with %d functions (but wanted at least %d)\n",
+ n, NUM_FUNCTIONS);
+ /* Check that there are at least six functions. */
if (n < NUM_FUNCTIONS)
{
FAIL ();
- return;
+ /* Only return if we got no symbols at all. The partial output is
+ still useful for debugging failures. */
+ if (n <= 0)
+ return;
}
/* Convert them to symbols. */
symbols = backtrace_symbols (addresses, n);
@@ -68,10 +72,7 @@ handle_signal (int signum)
printf ("Function %d: %s\n", i, symbols[i]);
/* Check that the function names obtained are accurate. */
if (!match (symbols[0], "handle_signal"))
- {
- FAIL ();
- return;
- }
+ FAIL ();
/* Do not check name for signal trampoline. */
for (i = 2; i < n - 1; i++)
if (!match (symbols[i], "fn"))