[20/55] Introduce f_value_print_innner

Message ID 20191208182958.10181-21-tom@tromey.com
State New
Headers show
Series
  • Remove val_print
Related show

Commit Message

Tom Tromey Dec. 8, 2019, 6:29 p.m.
This introduces f_value_print_innner.

gdb/ChangeLog
2019-12-08  Tom Tromey  <tom@tromey.com>

	* f-valprint.c (f_value_print_innner): New function.
	* f-lang.h (f_value_print_innner): Declare.
	* f-lang.c (f_language_defn): Use f_value_print_innner.

Change-Id: Idad231ae7a8fd07a65fc82f13d790b1fae899ba2
---
 gdb/ChangeLog    |  6 ++++++
 gdb/f-lang.c     |  2 +-
 gdb/f-lang.h     |  6 ++++++
 gdb/f-valprint.c | 10 ++++++++++
 4 files changed, 23 insertions(+), 1 deletion(-)

-- 
2.17.2

Patch

diff --git a/gdb/f-lang.c b/gdb/f-lang.c
index b8a684e5cf5..0d587ea020b 100644
--- a/gdb/f-lang.c
+++ b/gdb/f-lang.c
@@ -647,7 +647,7 @@  extern const struct language_defn f_language_defn =
   f_print_type,			/* Print a type using appropriate syntax */
   f_print_typedef,		/* Print a typedef using appropriate syntax */
   f_val_print,			/* Print a value using appropriate syntax */
-  nullptr,			/* la_value_print_inner */
+  f_value_print_innner,		/* la_value_print_inner */
   c_value_print,		/* FIXME */
   default_read_var_value,	/* la_read_var_value */
   NULL,				/* Language specific skip_trampoline */
diff --git a/gdb/f-lang.h b/gdb/f-lang.h
index cf6024c4454..8b0f3f262df 100644
--- a/gdb/f-lang.h
+++ b/gdb/f-lang.h
@@ -41,6 +41,12 @@  extern void f_val_print (struct type *, int, CORE_ADDR,
 			 struct value *,
 			 const struct value_print_options *);
 
+/* Implement la_value_print_inner for Fortran.  */
+
+extern void f_value_print_innner (struct value *val, struct ui_file *stream,
+				  int recurse,
+				  const struct value_print_options *options);
+
 /* Language-specific data structures */
 
 /* A common block.  */
diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
index 10aeb7dc53d..9eccabbcd52 100644
--- a/gdb/f-valprint.c
+++ b/gdb/f-valprint.c
@@ -370,6 +370,16 @@  f_val_print (struct type *type, int embedded_offset,
     }
 }
 
+/* See f-lang.h.  */
+
+void
+f_value_print_innner (struct value *val, struct ui_file *stream, int recurse,
+		      const struct value_print_options *options)
+{
+  f_val_print (value_type (val), value_embedded_offset (val),
+	       value_address (val), stream, recurse, val, options);
+}
+
 static void
 info_common_command_for_block (const struct block *block, const char *comname,
 			       int *any_printed)