From: "J. Johnston" <jjohnstn@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: patch to display ia64 function pointers
Date: Thu, 31 Jul 2003 22:01:00 -0000 [thread overview]
Message-ID: <3F2991AA.2050400@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
The following patch fixes the problem when displaying structs or function
pointers that actually point to a function descriptor per the ia64 ABI.
Currently, the function descriptor pointer is erroneously interpreted as
pointing to a function and so gdb spits out some meaningless information.
With the patch, you get to see the actual function that the pointer
is referencing via the function descriptor.
Ok to commit?
2003-07-31 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().
[-- Attachment #2: ia64-tdep.funcdesc.patch --]
[-- Type: text/plain, Size: 1575 bytes --]
Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.92
diff -u -p -r1.92 ia64-tdep.c
--- ia64-tdep.c 23 Jul 2003 18:32:19 -0000 1.92
+++ ia64-tdep.c 31 Jul 2003 21:55:46 -0000
@@ -1852,6 +1852,23 @@ find_func_descr (CORE_ADDR faddr, CORE_A
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_push_dummy_call (struct gdbarch *gdbarch, CORE_ADDR func_addr,
struct regcache *regcache, CORE_ADDR bp_addr,
@@ -2277,6 +2294,7 @@ ia64_gdbarch_init (struct gdbarch_info i
set_gdbarch_deprecated_register_convertible (gdbarch, ia64_register_convertible);
set_gdbarch_deprecated_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual);
set_gdbarch_deprecated_register_convert_to_raw (gdbarch, ia64_register_convert_to_raw);
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
set_gdbarch_use_struct_convention (gdbarch, ia64_use_struct_convention);
set_gdbarch_deprecated_extract_return_value (gdbarch, ia64_extract_return_value);
next reply other threads:[~2003-07-31 22:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-31 22:01 J. Johnston [this message]
2003-08-25 21:12 ` Kevin Buettner
2003-08-26 17:34 ` J. Johnston
2003-08-26 22:37 ` [patch] missing case in epilogue stub detection Jafa
2003-08-26 22:45 ` Daniel Jacobowitz
2003-08-26 23:01 ` Jafa
2003-09-07 15:16 ` Daniel Jacobowitz
2003-09-09 3:00 ` Andrew Cagney
2003-08-26 19:46 RFA: patch to display ia64 function pointers Michael Elizabeth Chastain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F2991AA.2050400@redhat.com \
--to=jjohnstn@redhat.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox