diff options
Diffstat (limited to 'gdb/ia64-tdep.c')
-rw-r--r-- | gdb/ia64-tdep.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 4ec5a955cdb..f302142e9fe 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -2455,8 +2455,8 @@ ia64_access_mem (unw_addr_space_t as, } /* Call low-level function to access the kernel unwind table. */ -static int -getunwind_table (void *buf, size_t len) +static LONGEST +getunwind_table (gdb_byte **buf_p) { LONGEST x; @@ -2467,10 +2467,11 @@ getunwind_table (void *buf, size_t len) we want to preserve fall back to the running kernel's table, then we should find a way to override the corefile layer's xfer_partial method. */ - x = target_read_partial (¤t_target, TARGET_OBJECT_UNWIND_TABLE, NULL, - buf, 0, len); - return (int)x; + x = target_read_whole (¤t_target, TARGET_OBJECT_UNWIND_TABLE, + NULL, buf_p); + + return x; } /* Get the kernel unwind table. */ @@ -2481,14 +2482,15 @@ get_kernel_table (unw_word_t ip, unw_dyn_info_t *di) if (!ktab) { + gdb_byte *ktab_buf; size_t size; - size = getunwind_table (NULL, 0); - if ((int)size < 0) - return -UNW_ENOINFO; - ktab_size = size; - ktab = xmalloc (ktab_size); - getunwind_table (ktab, ktab_size); - + + ktab_size = getunwind_table (&ktab_buf); + if (ktab_size <= 0) + return -UNW_ENOINFO; + else + ktab = (struct ia64_table_entry *) ktab_buf; + for (etab = ktab; etab->start_offset; ++etab) etab->info_offset += KERNEL_START; } |