[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 11/19] Do not print garbage proc info in tests/
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 11/19] Do not print garbage proc info in tests/Gtest-bt.c |
Date: |
Wed, 5 Sep 2012 14:50:19 +0300 |
Check the return value of the unw_get_proc_info() call to avoid printing
garbage if the call fails.
---
tests/Gtest-bt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 57ace85..68eba92 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -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
{
--
1.7.9.5
- [Libunwind-devel] [PATCH 00/19] misc fixes, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 04/19] PPC: add missing debug level in Debug() calls in Gstep.c, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 02/19] Check __builtin___clear_cache() at configuration time, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 03/19] HPPA: fix common_init() bitrot, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 01/19] Annotate unused argument in mark_as_used() to avoid -Wextra compiler noise, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 05/19] PPC: return failure from the unw_get_proc_info() stub, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 06/19] Remove free() NULL pointer checks in load_debug_frame() error path, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 08/19] Rename `backtrace' to `do_backtrace' in tests/Gtest-init.cxx, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 07/19] Eliminate one heap allocation in dwarf_find_debug_frame(), Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 09/19] Check correct variable for offset in tests/Gtest-init.cxx, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 11/19] Do not print garbage proc info in tests/Gtest-bt.c,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 14/19] Provide manual page for `unw_backtrace()', Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 12/19] Avoid LLVM -Wunused-value warning in src/dwarf/Gexpr.c, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 13/19] Remove AC_FUNC_MEMCMP check from configure.in, Tommi Rantala, 2012/09/05
- [Libunwind-devel] [PATCH 10/19] Change test-varargs to check libunwind backtracing, Tommi Rantala, 2012/09/05