mirror of
https://github.com/ianlancetaylor/libbacktrace.git
synced 2026-03-26 03:59:06 +08:00
libbacktrace: use ELF symbol table if no debug info available
PR libbacktrace/97080 * fileline.c (backtrace_syminfo_to_full_callback): New function. (backtrace_syminfo_to_full_error_callback): New function. * elf.c (elf_nodebug): Call syminfo_fn if possible. * internal.h (struct backtrace_call_full): Define. (backtrace_syminfo_to_full_callback): Declare. (backtrace_syminfo_to_full_error_callback): Declare. * mtest.c (f3): Only check all[i] if data.index permits.
This commit is contained in:
63
mtest.c
63
mtest.c
@@ -156,40 +156,49 @@ f3 (int f1line __attribute__ ((unused)), int f2line __attribute__ ((unused)))
|
||||
}
|
||||
}
|
||||
|
||||
if (all[0].function == NULL)
|
||||
if (data.index > 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [0]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[0].function, "f3") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [0]: got %s expected %s\n",
|
||||
all[0].function, "f3");
|
||||
data.failed = 1;
|
||||
if (all[0].function == NULL)
|
||||
{
|
||||
fprintf (stderr, "test1: [0]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[0].function, "f3") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [0]: got %s expected %s\n",
|
||||
all[0].function, "f3");
|
||||
data.failed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (all[1].function == NULL)
|
||||
if (data.index > 1)
|
||||
{
|
||||
fprintf (stderr, "test1: [1]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[1].function, "f2") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [1]: got %s expected %s\n",
|
||||
all[0].function, "f2");
|
||||
data.failed = 1;
|
||||
if (all[1].function == NULL)
|
||||
{
|
||||
fprintf (stderr, "test1: [1]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[1].function, "f2") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [1]: got %s expected %s\n",
|
||||
all[0].function, "f2");
|
||||
data.failed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (all[2].function == NULL)
|
||||
if (data.index > 2)
|
||||
{
|
||||
fprintf (stderr, "test1: [2]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[2].function, "test1") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [2]: got %s expected %s\n",
|
||||
all[0].function, "test1");
|
||||
data.failed = 1;
|
||||
if (all[2].function == NULL)
|
||||
{
|
||||
fprintf (stderr, "test1: [2]: missing function name\n");
|
||||
data.failed = 1;
|
||||
}
|
||||
else if (strcmp (all[2].function, "test1") != 0)
|
||||
{
|
||||
fprintf (stderr, "test1: [2]: got %s expected %s\n",
|
||||
all[0].function, "test1");
|
||||
data.failed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
printf ("%s: backtrace_full noinline\n", data.failed ? "FAIL" : "PASS");
|
||||
|
||||
Reference in New Issue
Block a user