[18/55] Introduce m2_value_print_inner

Message ID 20191208182958.10181-19-tom@tromey.com
State New, archived
Headers

Commit Message

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

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

	* m2-valprint.c (m2_value_print_inner): New function.
	* m2-lang.h (m2_value_print_inner): Declare.
	* m2-lang.c (m2_language_defn): Use m2_value_print_inner.

Change-Id: I17b9a7146d8cc342ab2b095ee7b2b1e8a5c08726
---
 gdb/ChangeLog     |  6 ++++++
 gdb/m2-lang.c     |  2 +-
 gdb/m2-lang.h     |  5 +++++
 gdb/m2-valprint.c | 10 ++++++++++
 4 files changed, 22 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c
index 924ee0a549c..476abcb987e 100644
--- a/gdb/m2-lang.c
+++ b/gdb/m2-lang.c
@@ -394,7 +394,7 @@  extern const struct language_defn m2_language_defn =
   m2_print_type,		/* Print a type using appropriate syntax */
   m2_print_typedef,		/* Print a typedef using appropriate syntax */
   m2_val_print,			/* Print a value using appropriate syntax */
-  nullptr,			/* la_value_print_inner */
+  m2_value_print_inner,		/* la_value_print_inner */
   c_value_print,		/* Print a top-level value */
   default_read_var_value,	/* la_read_var_value */
   NULL,				/* Language specific skip_trampoline */
diff --git a/gdb/m2-lang.h b/gdb/m2-lang.h
index 96058bb4f48..49414ffcc86 100644
--- a/gdb/m2-lang.h
+++ b/gdb/m2-lang.h
@@ -40,6 +40,11 @@  extern void m2_val_print (struct type *, int, CORE_ADDR,
 			  struct value *,
 			  const struct value_print_options *);
 
+/* Implement la_value_print_inner for Modula-2.  */
+
+extern void m2_value_print_inner (struct value *, struct ui_file *, int,
+				  const struct value_print_options *);
+
 extern int get_long_set_bounds (struct type *type, LONGEST *low,
 				LONGEST *high);
 
diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c
index 4dc0fe18e6a..9ad5ca3e0b2 100644
--- a/gdb/m2-valprint.c
+++ b/gdb/m2-valprint.c
@@ -503,3 +503,13 @@  m2_val_print (struct type *type, int embedded_offset,
       break;
     }
 }
+
+/* See m2-lang.h.  */
+
+void
+m2_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
+		      const struct value_print_options *options)
+{
+  m2_val_print (value_type (val), value_embedded_offset (val),
+		value_address (val), stream, recurse, val, options);
+}