libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [PATCH 2/6] UNW_REMOTE_ONLY fixes


From: Ken Werner
Subject: [Libunwind-devel] [PATCH 2/6] UNW_REMOTE_ONLY fixes
Date: Thu, 27 Oct 2011 10:38:08 +0200

Exclude <link.h> because it is only required for local unwinding when
iterating over the program headers.

Have the following DWARF related functions available in case of
UNW_REMOTE_ONLY because they are used by libunwind-ptrace:
  dwarf_find_debug_frame
  locate_debug_info
  find_binary_for_address
  load_debug_frame
  debug_frame_tab_new
  debug_frame_tab_append
  debug_frame_tab_shrink
  debug_frame_tab_compare

Signed-off-by: Ken Werner <address@hidden>
---
 include/dwarf.h                 |    4 ++++
 src/dwarf/Gfind_proc_info-lsb.c |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/dwarf.h b/include/dwarf.h
index 1d4f5df..cdf9f24 100644
--- a/include/dwarf.h
+++ b/include/dwarf.h
@@ -39,7 +39,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.  */
 struct dwarf_cursor;   /* forward-declaration */
 
 #include "dwarf-config.h"
+#ifndef UNW_REMOTE_ONLY
 #include <link.h>
+#endif
 #include <pthread.h>
 
 /* DWARF expression opcodes.  */
@@ -378,10 +380,12 @@ struct dwarf_callback_data
 #define dwarf_step                     UNW_OBJ (dwarf_step)
 
 extern int dwarf_init (void);
+#ifndef UNW_REMOTE_ONLY
 extern int dwarf_callback (struct dl_phdr_info *info, size_t size, void *ptr);
 extern int dwarf_find_proc_info (unw_addr_space_t as, unw_word_t ip,
                                 unw_proc_info_t *pi,
                                 int need_unwind_info, void *arg);
+#endif /* !UNW_REMOTE_ONLY */
 extern int dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug,
                                 struct dl_phdr_info *info, unw_word_t ip);
 extern int dwarf_search_unwind_table (unw_addr_space_t as,
diff --git a/src/dwarf/Gfind_proc_info-lsb.c b/src/dwarf/Gfind_proc_info-lsb.c
index 22899d8..77d1c00 100644
--- a/src/dwarf/Gfind_proc_info-lsb.c
+++ b/src/dwarf/Gfind_proc_info-lsb.c
@@ -79,6 +79,7 @@ linear_search (unw_addr_space_t as, unw_word_t ip,
     }
   return -UNW_ENOINFO;
 }
+#endif /* !UNW_REMOTE_ONLY */
 
 #ifdef CONFIG_DEBUG_FRAME
 /* Load .debug_frame section from FILE.  Allocates and returns space
@@ -555,6 +556,8 @@ dwarf_find_debug_frame (int found, unw_dyn_info_t *di_debug,
 
 #endif /* CONFIG_DEBUG_FRAME */
 
+#ifndef UNW_REMOTE_ONLY
+
 /* ptr is a pointer to a dwarf_callback_data structure and, on entry,
    member ip contains the instruction-pointer we're looking
    for.  */
-- 
1.7.5.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]