1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2025-04-01 20:02:17 +02:00

Fix compiler warnings on x86_64

This commit is contained in:
Arun Sharma 2009-10-16 14:01:50 -07:00
parent af9daf66af
commit 491d576529
5 changed files with 128 additions and 118 deletions

View file

@ -178,6 +178,11 @@ typedef sigset_t intrmask_t;
extern intrmask_t unwi_full_mask;
/* Silence compiler warnings about variables which are used only if libunwind
is configured in a certain way */
static inline void mark_as_used(void *v) {
}
#if defined(CONFIG_BLOCK_SIGNALS)
# define SIGPROCMASK(how, new_mask, old_mask) \
sigprocmask((how), (new_mask), (old_mask))
@ -191,11 +196,13 @@ extern intrmask_t unwi_full_mask;
#define lock_acquire(l,m) \
do { \
SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &(m)); \
mark_as_used(&(m)); \
mutex_lock (l); \
} while (0)
#define lock_release(l,m) \
do { \
mutex_unlock (l); \
mark_as_used(&(m)); \
SIGPROCMASK (SIG_SETMASK, &(m), NULL); \
} while (0)
@ -272,10 +279,10 @@ do { \
# define Dprintf(format...)
#endif
static ALWAYS_INLINE void
static ALWAYS_INLINE int
print_error (const char *string)
{
write (2, string, strlen (string));
return write (2, string, strlen (string));
}
#define mi_init UNWI_ARCH_OBJ(mi_init)

View file

@ -416,7 +416,6 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
struct dwarf_eh_frame_hdr *hdr;
unw_accessors_t *a;
long n;
struct unw_debug_frame_list *fdesc = 0;
int found = 0;
ip = cb_data->ip;
@ -576,7 +575,8 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
}
#ifdef CONFIG_DEBUG_FRAME
{
struct unw_debug_frame_list *fdesc = 0;
Debug (15, "Trying to find .debug_frame\n");
di = &cb_data->di_debug;
fdesc = locate_debug_info (unw_local_addr_space, info, ip, info->dlpi_name);
@ -709,6 +709,7 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
(long) di->u.ti.segbase, (long) di->u.ti.table_len,
(long) di->gp, (long) di->u.ti.table_data);
}
}
#endif /* CONFIG_DEBUG_FRAME */
return found;

View file

@ -29,7 +29,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
HIDDEN int
dwarf_step (struct dwarf_cursor *c)
{
unw_word_t prev_cfa = c->cfa;
int ret;
if ((ret = dwarf_find_save_locs (c)) >= 0) {

View file

@ -71,7 +71,7 @@ x86_64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
{
Debug (8, "resuming at ip=%llx via setcontext()\n",
(unsigned long long) c->dwarf.ip);
_Ux86_64_setcontext (uc);
setcontext (uc);
}
#else
# warning Implement me!

View file

@ -58,6 +58,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define x86_64_lock UNW_OBJ(lock)
#define x86_64_local_resume UNW_OBJ(local_resume)
#define x86_64_local_addr_space_init UNW_OBJ(local_addr_space_init)
#define setcontext UNW_ARCH_OBJ (setcontext)
#if 0
#define x86_64_scratch_loc UNW_OBJ(scratch_loc)
#endif
@ -65,6 +66,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
extern void x86_64_local_addr_space_init (void);
extern int x86_64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor,
void *arg);
extern int setcontext (const ucontext_t *ucp);
#if 0
extern dwarf_loc_t x86_64_scratch_loc (struct cursor *c, unw_regnum_t reg);
#endif