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 | af330e3409f14823c6e86bc5d6d35de4aa00f966 (patch) | |
tree | e983d2f441a4aba8f316250ca67a4fce7163d7fe /gdb/ia64-tdep.c | |
parent | 11a40a4764e3f556a720372beb15dba15f914737 (diff) | |
download | gdb-af330e3409f14823c6e86bc5d6d35de4aa00f966.tar.gz |
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 19f18b7faa1..88e0e20c072 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); |