aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2003-08-26 17:33:22 +0000
committerJeff Johnston <jjohnstn@redhat.com>2003-08-26 17:33:22 +0000
commitaf8b88dd22728115a948af995888e982bb3942b6 (patch)
treeac3aa460cc14b4ecf4217e47e4d97b7f3dec208e /gdb
parent093872ec2ef8a704a6ae6cfafde30fa43295bcbf (diff)
downloadgdb-af8b88dd22728115a948af995888e982bb3942b6.zip
gdb-af8b88dd22728115a948af995888e982bb3942b6.tar.gz
gdb-af8b88dd22728115a948af995888e982bb3942b6.tar.bz2
2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
* ia64-tdep.c (ia64_convert_from_func_addr): New function. (ia64_gdbarch_init): Call set_gdbarch_convert_from_func_addr().
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ia64-tdep.c18
2 files changed, 23 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22213ef..7d68388 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-26 Jeff Johnston <jjohnstn@redhat.com>
+
+ * ia64-tdep.c (ia64_convert_from_func_addr): New function.
+ (ia64_gdbarch_init): Call set_gdbarch_convert_from_func_addr().
+
2003-08-26 Jason Merrill <jason@redhat.com>
* dwarf2read.c (dwarf_attr_name): Move DW_AT_MIPS_linkage_name
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index e5e5ae8..1f1eb0e 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -2281,6 +2281,23 @@ find_func_descr (CORE_ADDR faddr, CORE_ADDR *fdaptr)
return fdesc;
}
+/* Use the following routine when printing out function pointers
+ so the user can see the function address rather than just the
+ function descriptor. */
+static CORE_ADDR
+ia64_convert_from_func_ptr_addr (CORE_ADDR addr)
+{
+ struct obj_section *s;
+
+ s = find_pc_section (addr);
+
+ /* check if ADDR points to a function descriptor. */
+ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
+ return read_memory_unsigned_integer (addr, 8);
+
+ return addr;
+}
+
static CORE_ADDR
ia64_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
{
@@ -2684,6 +2701,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
gdbarch, ia64_remote_translate_xfer_address);
set_gdbarch_print_insn (gdbarch, ia64_print_insn);
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
return gdbarch;
}