mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 12:03:41 +01:00
Do not print garbage proc info in tests/Gtest-bt.c
Check the return value of the unw_get_proc_info() call to avoid printing garbage if the call fails.
This commit is contained in:
parent
8203c955c8
commit
1c1dbbe296
1 changed files with 4 additions and 2 deletions
|
@ -82,10 +82,12 @@ do_backtrace (void)
|
|||
{
|
||||
printf ("%016lx %-32s (sp=%016lx)\n", (long) ip, buf, (long) sp);
|
||||
|
||||
unw_get_proc_info (&cursor, &pi);
|
||||
printf ("\tproc=%lx-%lx\n\thandler=%lx lsda=%lx gp=%lx",
|
||||
if (unw_get_proc_info (&cursor, &pi) == 0)
|
||||
{
|
||||
printf ("\tproc=0x%lx-0x%lx\n\thandler=0x%lx lsda=0x%lx gp=0x%lx",
|
||||
(long) pi.start_ip, (long) pi.end_ip,
|
||||
(long) pi.handler, (long) pi.lsda, (long) pi.gp);
|
||||
}
|
||||
|
||||
#if UNW_TARGET_IA64
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue