* [pushed] Remove unnecessary block from execute_fn_to_ui_file
@ 2024-05-18 16:59 Tom Tromey
2024-05-18 17:02 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2024-05-18 16:59 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
I noticed that execute_fn_to_ui_file has an extra, unnecessary block.
This patch removes it.
---
gdb/top.c | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/gdb/top.c b/gdb/top.c
index b93ef0a69b5..b5a129f59fc 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -609,22 +609,20 @@ execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn)
scoped_restore save_async = make_scoped_restore (¤t_ui->async, 0);
- {
- ui_out_redirect_pop redirect_popper (current_uiout, file);
-
- scoped_restore save_stdout
- = make_scoped_restore (&gdb_stdout, file);
- scoped_restore save_stderr
- = make_scoped_restore (&gdb_stderr, file);
- scoped_restore save_stdlog
- = make_scoped_restore (&gdb_stdlog, file);
- scoped_restore save_stdtarg
- = make_scoped_restore (&gdb_stdtarg, file);
- scoped_restore save_stdtargerr
- = make_scoped_restore (&gdb_stdtargerr, file);
-
- fn ();
- }
+ ui_out_redirect_pop redirect_popper (current_uiout, file);
+
+ scoped_restore save_stdout
+ = make_scoped_restore (&gdb_stdout, file);
+ scoped_restore save_stderr
+ = make_scoped_restore (&gdb_stderr, file);
+ scoped_restore save_stdlog
+ = make_scoped_restore (&gdb_stdlog, file);
+ scoped_restore save_stdtarg
+ = make_scoped_restore (&gdb_stdtarg, file);
+ scoped_restore save_stdtargerr
+ = make_scoped_restore (&gdb_stdtargerr, file);
+
+ fn ();
}
/* See top.h. */
--
2.44.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [pushed] Remove unnecessary block from execute_fn_to_ui_file
2024-05-18 16:59 [pushed] Remove unnecessary block from execute_fn_to_ui_file Tom Tromey
@ 2024-05-18 17:02 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2024-05-18 17:02 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:
Tom> - scoped_restore save_stdtargerr
Tom> - = make_scoped_restore (&gdb_stdtargerr, file);
Apparently I forgot to rebase before emailing, because gdb_stdtargerr
doesn't exist any more. Anyway this is fixed in the actual patch.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-18 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-18 16:59 [pushed] Remove unnecessary block from execute_fn_to_ui_file Tom Tromey
2024-05-18 17:02 ` 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).