diff options
author | Kevin Buettner <kevinb@redhat.com> | 2003-12-13 03:51:56 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2003-12-13 03:51:56 +0000 |
commit | 503ff15d3831702b6020a5e0f37540cbd41c77d2 (patch) | |
tree | 367596708b459f9314dc3d07750ac94fb2e3336a /gdb/ia64-tdep.c | |
parent | 3a4c93712ee832e295da2fe741210f341c1594e3 (diff) | |
download | gdb-503ff15d3831702b6020a5e0f37540cbd41c77d2.zip gdb-503ff15d3831702b6020a5e0f37540cbd41c77d2.tar.gz gdb-503ff15d3831702b6020a5e0f37540cbd41c77d2.tar.bz2 |
From David Mosberger <davidm@hpl.hp.com>:
* libunwind-frame.c (unw_find_dyn_list_p): Replace most arguments
with a single unw_dyn_info_t pointer.
(libunwind_find_dyn_list): Likewise.
* libunwind-frame.h: Likewise.
* ia64-tdep.c (ia64_find_unwind_table): Switch to using
UNW_INFO_FORMAT_REMOTE_TABLE so we can avoid having to read in the
entire unwind-table at once. Support for this table format has
been added to libunwind v0.95.
(ia64_find_proc_info_x): Adjust for remote-unwind-table changes.
(ia64_get_dyn_info_list): Adjust for interface change for
libunwind_find_dyn_list().
Diffstat (limited to 'gdb/ia64-tdep.c')
-rw-r--r-- | gdb/ia64-tdep.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 19f18b7..88e0e20 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -2452,23 +2452,11 @@ ia64_find_unwind_table (struct objfile *objfile, unw_word_t ip, dip->start_ip = segbase; dip->end_ip = dip->start_ip + p_text->p_memsz; dip->gp = FIND_GLOBAL_POINTER (ip); - dip->format = UNW_INFO_FORMAT_TABLE; - dip->u.ti.name_ptr = (unw_word_t) bfd_get_filename (bfd); - dip->u.ti.segbase = segbase; - dip->u.ti.table_len = p_unwind->p_memsz / sizeof (unw_word_t); - - /* The following can happen in corner cases where dynamically - generated code falls into the same page that contains the - data-segment and the page-offset of the code is within the first - page of the executable. */ - if (ip < dip->start_ip || ip >= dip->end_ip) - return -UNW_ENOINFO; - - /* Read in the libunwind table. */ - *buf = xmalloc (p_unwind->p_memsz); - target_read_memory (p_unwind->p_vaddr + load_base, (char *)(*buf), p_unwind->p_memsz); - - dip->u.ti.table_data = (unw_word_t *)(*buf); + dip->format = UNW_INFO_FORMAT_REMOTE_TABLE; + dip->u.rti.name_ptr = (unw_word_t) bfd_get_filename (bfd); + dip->u.rti.segbase = segbase; + dip->u.rti.table_len = p_unwind->p_memsz / sizeof (unw_word_t); + dip->u.rti.table_data = p_unwind->p_vaddr + load_base; return 0; } @@ -2490,22 +2478,32 @@ ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, version. */ if (get_kernel_table (ip, &di) < 0) return -UNW_ENOINFO; + + if (gdbarch_debug >= 1) + fprintf_unfiltered (gdb_stdlog, "%s: %lx -> " + "(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx," + "length=%lu,data=%p)\n", __FUNCTION__, + ip, (char *)di.u.ti.name_ptr, + di.u.ti.segbase, di.start_ip, di.end_ip, + di.gp, di.u.ti.table_len, di.u.ti.table_data); } else { ret = ia64_find_unwind_table (sec->objfile, ip, &di, &buf); if (ret < 0) return ret; - } - if (gdbarch_debug >= 1) - fprintf_unfiltered (gdb_stdlog, "acquire_unwind_info: %lx -> " - "(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx," - "length=%lu,data=%p)\n", ip, (char *)di.u.ti.name_ptr, - di.u.ti.segbase, di.start_ip, di.end_ip, - di.gp, di.u.ti.table_len, di.u.ti.table_data); + if (gdbarch_debug >= 1) + fprintf_unfiltered (gdb_stdlog, "%s: %lx -> " + "(name=`%s',segbase=%lx,start=%lx,end=%lx,gp=%lx," + "length=%lu,data=%lx)\n", __FUNCTION__, + ip, (char *)di.u.rti.name_ptr, + di.u.rti.segbase, di.start_ip, di.end_ip, + di.gp, di.u.rti.table_len, di.u.rti.table_data); + } - ret = libunwind_search_unwind_table (&as, ip, &di, pi, need_unwind_info, arg); + ret = libunwind_search_unwind_table (&as, ip, &di, pi, need_unwind_info, + arg); /* We no longer need the dyn info storage so free it. */ xfree (buf); @@ -2545,10 +2543,7 @@ ia64_get_dyn_info_list (unw_addr_space_t as, ret = ia64_find_unwind_table (objfile, ip, &di, &buf); if (ret >= 0) { - addr = libunwind_find_dyn_list (as, di.u.ti.table_data, - (di.u.ti.table_len - * sizeof (di.u.ti.table_data[0])), - di.u.ti.segbase, di.gp, arg); + addr = libunwind_find_dyn_list (as, &di, arg); /* We no longer need the dyn info storage so free it. */ xfree (buf); |