summaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-03-01 18:25:18 +0000
committerTom Tromey <tromey@redhat.com>2012-03-01 18:25:18 +0000
commit021c6b73b067169f7776f15fff84b4921e0888e4 (patch)
tree2d8ad76de91bd9f1150ae87035d70f416300a98b /gdb/valprint.c
parentda131ab01383f3e555146dc6567e0fb1d9855567 (diff)
downloadgdb-021c6b73b067169f7776f15fff84b4921e0888e4.tar.gz
* c-valprint.c (print_function_pointer_address): Move...
* valprint.c: ... here. Make non-static. * m2-valprint.c (print_function_pointer_address): Remove. * valprint.h (print_function_pointer_address): Declare.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index b894be982a8..a348cf48cdb 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -1161,6 +1161,31 @@ print_char_chars (struct ui_file *stream, struct type *type,
}
}
+/* Print function pointer with inferior address ADDRESS onto stdio
+ stream STREAM. */
+
+void
+print_function_pointer_address (struct gdbarch *gdbarch,
+ CORE_ADDR address,
+ struct ui_file *stream,
+ int addressprint)
+{
+ CORE_ADDR func_addr
+ = gdbarch_convert_from_func_ptr_addr (gdbarch, address,
+ &current_target);
+
+ /* If the function pointer is represented by a description, print
+ the address of the description. */
+ if (addressprint && func_addr != address)
+ {
+ fputs_filtered ("@", stream);
+ fputs_filtered (paddress (gdbarch, address), stream);
+ fputs_filtered (": ", stream);
+ }
+ print_address_demangle (gdbarch, func_addr, stream, demangle);
+}
+
+
/* Print on STREAM using the given OPTIONS the index for the element
at INDEX of an array whose index type is INDEX_TYPE. */