* c-valprint.c (print_function_pointer_address): Move...
authorTom Tromey <tromey@redhat.com>
Thu, 1 Mar 2012 18:25:19 +0000 (18:25 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 1 Mar 2012 18:25:19 +0000 (18:25 +0000)
* valprint.c: ... here.  Make non-static.
* m2-valprint.c (print_function_pointer_address): Remove.
* valprint.h (print_function_pointer_address): Declare.

gdb/ChangeLog
gdb/c-valprint.c
gdb/m2-valprint.c
gdb/valprint.c
gdb/valprint.h

index 48ebb4b33995199810820cb3c49d383e904b8748..1bc8dd7ccd6fad8541f491fbf5220969bda4e63d 100644 (file)
@@ -1,3 +1,10 @@
+2012-03-01  Tom Tromey  <tromey@redhat.com>
+
+       * 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.
+
 2012-03-01  Joel Brobecker  <brobecker@adacore.com>
 
        * NEWS: Document the fact that one can provide a condition when
index 25c6688e89d5febee83cb0ac5cdb91f62e14dd3a..0054dc0408a45d0a5391da9f209b37dfa6329025 100644 (file)
 #include "target.h"
 \f
 
-/* Print function pointer with inferior address ADDRESS onto stdio
-   stream STREAM.  */
-
-static 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);
-}
-
-
 /* A helper for c_textual_element_type.  This checks the name of the
    typedef.  This is bogus but it isn't apparent that the compiler
    provides us the help we may need.  */
index 4378b00ff9a80ca2426757f59027ebd0f7c295bd..abe1960502b39e89942f8499cf8aefd6b2bf3283 100644 (file)
@@ -43,27 +43,6 @@ m2_print_array_contents (struct type *type, const gdb_byte *valaddr,
                         int len);
 
 
-/* Print function pointer with inferior address ADDRESS onto stdio
-   stream STREAM.  */
-
-static 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);
-}
-
 /* get_long_set_bounds - assigns the bounds of the long set to low and
                          high.  */
 
index b894be982a8ca1582994d4a922b831673839c20a..a348cf48cdb2e296b4cfa94a345f8104fca40173 100644 (file)
@@ -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.  */
     
index a34d09b461ca17d96f4863c9db9a7376f520a329..234a18a18cb1253c4250322370b4563f123b510c 100644 (file)
@@ -148,6 +148,11 @@ extern void print_hex_chars (struct ui_file *, const gdb_byte *,
 extern void print_char_chars (struct ui_file *, struct type *,
                              const gdb_byte *, unsigned int, enum bfd_endian);
 
+extern void print_function_pointer_address (struct gdbarch *gdbarch,
+                                           CORE_ADDR address,
+                                           struct ui_file *stream,
+                                           int addressprint);
+
 int read_string (CORE_ADDR addr, int len, int width, unsigned int fetchlimit,
                 enum bfd_endian byte_order, gdb_byte **buffer,
                 int *bytes_read);