diff options
author | Tom Tromey <tom@tromey.com> | 2020-03-13 17:39:52 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-03-13 18:03:39 -0600 |
commit | 2b4e573d62be3a59057895054b1b5faa67557ce6 (patch) | |
tree | ad488a86ece918a596682abee9dc414ad57fe2af /gdb/valprint.c | |
parent | a1f6a07c3d1d3a34d36d4e49f0fd3c66554e41b2 (diff) | |
download | gdb-2b4e573d62be3a59057895054b1b5faa67557ce6.zip gdb-2b4e573d62be3a59057895054b1b5faa67557ce6.tar.gz gdb-2b4e573d62be3a59057895054b1b5faa67557ce6.tar.bz2 |
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 <tom@tromey.com>
* 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) <la_value_print_inner>: 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.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index aab43d4..e0a3424 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -1092,9 +1092,13 @@ do_val_print (struct value *full_value, try { - language->la_val_print (type, embedded_offset, address, - stream, recurse, val, - &local_opts); + if (full_value != nullptr && language->la_value_print_inner != nullptr) + language->la_value_print_inner (full_value, stream, recurse, + &local_opts); + else + language->la_val_print (type, embedded_offset, address, + stream, recurse, val, + &local_opts); } catch (const gdb_exception_error &except) { |