From 2b4e573d62be3a59057895054b1b5faa67557ce6 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 13 Mar 2020 17:39:52 -0600 Subject: Introduce la_value_print_inner The plan for removing val_print is, essentially, to first duplicate printing code as needed to use the value API; and then remove the val_print code. This makes it possible to do the changes incrementally while keeping everything working. This adds a new la_value_print_inner function pointer to struct language_defn. Eventually this will replace la_val_print. This patch also changes printing to prefer this API, when available -- but no language defines it yet. gdb/ChangeLog 2020-03-13 Tom Tromey * valprint.c (do_val_print): Call la_value_print_inner, if available. * rust-lang.c (rust_language_defn): Update. * p-lang.c (pascal_language_defn): Update. * opencl-lang.c (opencl_language_defn): Update. * objc-lang.c (objc_language_defn): Update. * m2-lang.c (m2_language_defn): Update. * language.h (struct language_defn) : New member. * language.c (unknown_language_defn, auto_language_defn): Update. * go-lang.c (go_language_defn): Update. * f-lang.c (f_language_defn): Update. * d-lang.c (d_language_defn): Update. * c-lang.c (c_language_defn, cplus_language_defn) (asm_language_defn, minimal_language_defn): Update. * ada-lang.c (ada_language_defn): Update. --- gdb/c-lang.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/c-lang.c') diff --git a/gdb/c-lang.c b/gdb/c-lang.c index cd3e1ff..3526674 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -904,6 +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, /* Print a top-level value */ default_read_var_value, /* la_read_var_value */ NULL, /* Language specific skip_trampoline */ @@ -1049,6 +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, /* Print a top-level value */ default_read_var_value, /* la_read_var_value */ cplus_skip_trampoline, /* Language specific skip_trampoline */ @@ -1103,6 +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, /* Print a top-level value */ default_read_var_value, /* la_read_var_value */ NULL, /* Language specific skip_trampoline */ @@ -1157,6 +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, /* Print a top-level value */ default_read_var_value, /* la_read_var_value */ NULL, /* Language specific skip_trampoline */ -- cgit v1.1