* [PATCH] Remove ada_value_print_inner
@ 2021-10-20 20:27 Tom Tromey
2021-10-29 13:46 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2021-10-20 20:27 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
I noticed that the only caller of ada_value_print_inner is
valprint.c:do_val_print (via ada_language::value_print_inner), meaning
that the try/catch logic in this function is redundant. This patch
removes the wrapper function.
Regression tested on x86-64 Fedora 34.
---
gdb/ada-valprint.c | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index e725cd3276e..4a28d20c57e 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -978,12 +978,12 @@ ada_val_print_ref (struct type *type, const gdb_byte *valaddr,
}
/* See the comment on ada_value_print. This function differs in that
- it does not catch evaluation errors (leaving that to
- ada_value_print). */
+ it does not catch evaluation errors (leaving that to its
+ caller). */
-static void
-ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
- const struct value_print_options *options)
+void
+ada_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
+ const struct value_print_options *options)
{
struct type *type = ada_check_typedef (value_type (val));
@@ -1071,25 +1071,6 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
}
}
-/* See ada-lang.h. */
-
-void
-ada_value_print_inner (struct value *val, struct ui_file *stream,
- int recurse,
- const struct value_print_options *options)
-{
- try
- {
- ada_value_print_1 (val, stream, recurse, options);
- }
- catch (const gdb_exception_error &except)
- {
- fprintf_styled (stream, metadata_style.style (),
- _("<error reading variable: %s>"),
- except.what ());
- }
-}
-
void
ada_value_print (struct value *val0, struct ui_file *stream,
const struct value_print_options *options)
--
2.31.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove ada_value_print_inner
2021-10-20 20:27 [PATCH] Remove ada_value_print_inner Tom Tromey
@ 2021-10-29 13:46 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2021-10-29 13:46 UTC (permalink / raw)
To: Tom Tromey via Gdb-patches; +Cc: Tom Tromey
>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:
Tom> I noticed that the only caller of ada_value_print_inner is
Tom> valprint.c:do_val_print (via ada_language::value_print_inner), meaning
Tom> that the try/catch logic in this function is redundant. This patch
Tom> removes the wrapper function.
I'm checking this in.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-29 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 20:27 [PATCH] Remove ada_value_print_inner Tom Tromey
2021-10-29 13:46 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).