aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2008-05-29 00:19:33 +0000
committerJoel Brobecker <brobecker@gnat.com>2008-05-29 00:19:33 +0000
commitfcac911af1c9b3f79e93e0317d594dc99794c39a (patch)
tree6ebe40984726ab84c3c064b8be10f8cd850db07b
parent1aafe37a5957d4b859c437ef3774986a6288c72b (diff)
downloadgdb-fcac911af1c9b3f79e93e0317d594dc99794c39a.zip
gdb-fcac911af1c9b3f79e93e0317d594dc99794c39a.tar.gz
gdb-fcac911af1c9b3f79e93e0317d594dc99794c39a.tar.bz2
* ia64-tdep.c (ia64_convert_from_func_ptr_addr): Improve the heuristic
that identifies function descriptors outside of the .opd section.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ia64-tdep.c15
2 files changed, 16 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b32c75e..39bef3c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-28 Joel Brobecker <brobecker@adacore.com>
+
+ * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Improve the heuristic
+ that identifies function descriptors outside of the .opd section.
+
2008-05-28 Aleksandar Ristovski <aristovski@qnx.com>
* breakpoint.c (print_exception_catchpoint): In CLI add 'Temporary' for
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index ec0d14e..32e0f69 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -3229,11 +3229,18 @@ ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
return read_memory_unsigned_integer (addr, 8);
- /* If ADDR points to a section that is not executable, then it cannot
- be pointing to a function. So it must be pointing to a function
- descriptor. */
+ /* Normally, functions live inside a section that is executable.
+ So, if ADDR points to a non-executable section, then treat it
+ as a function descriptor and return the target address iff
+ the target address itself points to a section that is executable. */
if (s && (s->the_bfd_section->flags & SEC_CODE) == 0)
- return read_memory_unsigned_integer (addr, 8);
+ {
+ CORE_ADDR pc = read_memory_unsigned_integer (addr, 8);
+ struct obj_section *pc_section = find_pc_section (pc);
+
+ if (pc_section && (pc_section->the_bfd_section->flags & SEC_CODE))
+ return pc;
+ }
/* There are also descriptors embedded in vtables. */
if (s)