+2014-02-08 Mike Frysinger <vapier@gentoo.org>
+
+ * debug/tst-backtrace4.c (handle_signal): Add NUM_FUNCTIONS to output.
+ Only return early when n is <= 0. Delete unused return statement.
+
2014-02-08 Mike Frysinger <vapier@gentoo.org>
* debug/Makefile (CFLAGS-tst-longjmp_chk3.c): Define.
/* 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);
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"))