From b1e6fd1961bf6906b9990e2a260f410b6b474272 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 7eb3b7bd68c..4e3cf01b069 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 499213a8cb3..ec0d14ebbae 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.30.2