From f249c6e196ff4e8d058ab60198d212d344d89bd0 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 6 May 2008 20:03:03 +0000 Subject: [PATCH] * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Treat addresses pointing inside a non-executable section as function descriptors. --- gdb/ChangeLog | 5 +++++ gdb/ia64-tdep.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7eb3b7bd68..4e3cf01b06 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-05-06 Joel Brobecker + + * ia64-tdep.c (ia64_convert_from_func_ptr_addr): Treat addresses + pointing inside a non-executable section as function descriptors. + 2008-05-06 Pedro Alves * inf-loop.c (inferior_event_handler): Run all continuations and diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 499213a8cb..ec0d14ebba 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -3229,6 +3229,12 @@ 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. */ + if (s && (s->the_bfd_section->flags & SEC_CODE) == 0) + return read_memory_unsigned_integer (addr, 8); + /* There are also descriptors embedded in vtables. */ if (s) { -- 2.11.0