/* Frame unwinder for frames using the libunwind library.
- Copyright 2003 Free Software Foundation, Inc.
+ Copyright 2003, 2004 Free Software Foundation, Inc.
Written by Jeff Johnston, contributed by Red Hat Inc.
static int libunwind_initialized;
static struct gdbarch_data *libunwind_descr_handle;
-#ifndef LIBUNWIND_SO
-#define LIBUNWIND_SO "libunwind.so"
-#endif
-
/* Required function pointers from libunwind. */
static int (*unw_get_reg_p) (unw_cursor_t *, unw_regnum_t, unw_word_t *);
static int (*unw_get_fpreg_p) (unw_cursor_t *, unw_regnum_t, unw_fpreg_t *);
#define STRINGIFY2(name) #name
#define STRINGIFY(name) STRINGIFY2(name)
+#ifndef LIBUNWIND_SO
+#define LIBUNWIND_SO "libunwind-" STRINGIFY(UNW_TARGET) ".so"
+#endif
+
static char *get_reg_name = STRINGIFY(UNW_OBJ(get_reg));
static char *get_fpreg_name = STRINGIFY(UNW_OBJ(get_fpreg));
static char *get_saveloc_name = STRINGIFY(UNW_OBJ(get_save_loc));
uw_sp_regnum = descr->gdb2uw (SP_REGNUM);
ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp);
if (ret < 0)
- error ("Can't get libunwind sp register.");
+ error (_("Can't get libunwind sp register."));
cache->base = (CORE_ADDR)fp;
gdb_assert (regnum >= 0);
if (!target_has_registers)
- error ("No registers.");
+ error (_("No registers."));
*optimizedp = 0;
*addrp = 0;
*lvalp = not_lval;
*realnump = -1;
- memset (valuep, 0, register_size (current_gdbarch, regnum));
+ if (valuep)
+ memset (valuep, 0, register_size (current_gdbarch, regnum));
if (uw_regnum < 0)
return;
if (ret < 0)
return;
- memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
+ if (valuep)
+ memcpy (valuep, ptr, register_size (current_gdbarch, regnum));
if (unw_get_saveloc_p (&cache->cursor, uw_regnum, &sl) < 0)
return;