aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog10
-rw-r--r--gdb/c-lang.c8
-rw-r--r--gdb/c-lang.h5
-rw-r--r--gdb/c-valprint.c11
-rw-r--r--gdb/objc-lang.c2
-rw-r--r--gdb/opencl-lang.c2
6 files changed, 32 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 734f77e..add19fe 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,15 @@
2020-03-13 Tom Tromey <tom@tromey.com>
+ * opencl-lang.c (opencl_language_defn): Use c_value_print_inner.
+ * objc-lang.c (objc_language_defn): Use c_value_print_inner.
+ * c-valprint.c (c_value_print_inner): New function.
+ * c-lang.h (c_value_print_inner): Declare.
+ * c-lang.c (c_language_defn, cplus_language_defn)
+ (asm_language_defn, minimal_language_defn): Use
+ c_value_print_inner.
+
+2020-03-13 Tom Tromey <tom@tromey.com>
+
* p-valprint.c (pascal_object_print_value_fields): Now static.
* p-lang.h (pascal_object_print_value_fields): Don't declare.
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 3526674..c919f02 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -904,7 +904,7 @@ extern const struct language_defn c_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_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 */
@@ -1050,7 +1050,7 @@ extern const struct language_defn cplus_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
default_read_var_value, /* la_read_var_value */
cplus_skip_trampoline, /* Language specific skip_trampoline */
@@ -1105,7 +1105,7 @@ extern const struct language_defn asm_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_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 */
@@ -1160,7 +1160,7 @@ extern const struct language_defn minimal_language_defn =
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_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/c-lang.h b/gdb/c-lang.h
index b8bc380..7638ccf 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -87,6 +87,11 @@ extern void c_val_print (struct type *,
struct value *,
const struct value_print_options *);
+/* Implement la_value_print_inner for the C family of languages. */
+
+extern void c_value_print_inner (struct value *, struct ui_file *, int,
+ const struct value_print_options *);
+
extern void c_value_print (struct value *, struct ui_file *,
const struct value_print_options *);
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index bee0c18..b5ae3fa 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -557,6 +557,17 @@ c_val_print (struct type *type,
break;
}
}
+
+/* See c-lang.h. */
+
+void
+c_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
+{
+ c_val_print (value_type (val), value_embedded_offset (val),
+ value_address (val), stream, recurse, val, options);
+}
+
void
c_value_print (struct value *val, struct ui_file *stream,
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index c277dc9..5126e9f 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -382,7 +382,7 @@ extern const struct language_defn objc_language_defn = {
c_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_value_print_inner, /* la_value_print_inner */
c_value_print, /* Print a top-level value */
default_read_var_value, /* la_read_var_value */
objc_skip_trampoline, /* Language specific skip_trampoline */
diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
index c4afa3a..a480798 100644
--- a/gdb/opencl-lang.c
+++ b/gdb/opencl-lang.c
@@ -1061,7 +1061,7 @@ extern const struct language_defn opencl_language_defn =
opencl_print_type, /* Print a type using appropriate syntax */
c_print_typedef, /* Print a typedef using appropriate syntax */
c_val_print, /* Print a value using appropriate syntax */
- nullptr, /* la_value_print_inner */
+ c_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 */