diff mbox

[19/55] Introduce pascal_value_print_inner

Message ID 20191208182958.10181-20-tom@tromey.com
State New
Headers show

Commit Message

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

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

	* p-valprint.c (pascal_value_print_inner): New function.
	* p-lang.h (pascal_value_print_inner): Declare.
	* p-lang.c (pascal_language_defn): Use pascal_value_print_inner.

Change-Id: I2e560738ac59e2ee99874e65920d3f60ea179bc7
---
 gdb/ChangeLog    |  6 ++++++
 gdb/p-lang.c     |  2 +-
 gdb/p-lang.h     |  5 +++++
 gdb/p-valprint.c | 13 +++++++++++++
 4 files changed, 25 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gdb/p-lang.c b/gdb/p-lang.c
index 3229c3e9c9f..85020c4bedc 100644
--- a/gdb/p-lang.c
+++ b/gdb/p-lang.c
@@ -448,7 +448,7 @@  extern const struct language_defn pascal_language_defn =
   pascal_print_type,		/* Print a type using appropriate syntax */
   pascal_print_typedef,		/* Print a typedef using appropriate syntax */
   pascal_val_print,		/* Print a value using appropriate syntax */
-  nullptr,			/* la_value_print_inner */
+  pascal_value_print_inner,	/* la_value_print_inner */
   pascal_value_print,		/* Print a top-level value */
   default_read_var_value,	/* la_read_var_value */
   NULL,				/* Language specific skip_trampoline */
diff --git a/gdb/p-lang.h b/gdb/p-lang.h
index 1376bc2c94a..fafc86c78c4 100644
--- a/gdb/p-lang.h
+++ b/gdb/p-lang.h
@@ -42,6 +42,11 @@  extern void pascal_val_print (struct type *, int,
 			      struct value *,
 			      const struct value_print_options *);
 
+/* Implement la_value_print_inner for Pascal.  */
+
+extern void pascal_value_print_inner (struct value *, struct ui_file *, int,
+				      const struct value_print_options *);
+
 extern void pascal_value_print (struct value *, struct ui_file *,
 				const struct value_print_options *);
 
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 9420509066b..c24b8edfdeb 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -425,6 +425,19 @@  pascal_val_print (struct type *type,
 	     TYPE_CODE (type));
     }
 }
+
+/* See p-lang.h.  */
+
+void
+pascal_value_print_inner (struct value *val, struct ui_file *stream,
+			  int recurse,
+			  const struct value_print_options *options)
+
+{
+  pascal_val_print (value_type (val), value_embedded_offset (val),
+		    value_address (val), stream, recurse, val, options);
+}
+
 
 void
 pascal_value_print (struct value *val, struct ui_file *stream,