This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 04/15] Avoid string_file in tui_make_status_line
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Wed, 14 Aug 2019 10:21:21 -0600
- Subject: [PATCH 04/15] Avoid string_file in tui_make_status_line
- References: <20190814162132.31424-1-tom@tromey.com>
tui_make_status_line uses string_file where a simple std::string
constructor would do. This makes this change.
gdb/ChangeLog
2019-08-14 Tom Tromey <tom@tromey.com>
* tui/tui-stack.c (tui_make_status_line): Use string constructor.
---
gdb/ChangeLog | 4 ++++
gdb/tui/tui-stack.c | 8 +++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index c67ac1ba549..1d7491dff93 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -128,11 +128,9 @@ tui_make_status_line (struct tui_locator_window *loc)
line_width = MIN_LINE_WIDTH;
/* Translate PC address. */
- string_file pc_out;
-
- fputs_filtered (loc->gdbarch? paddress (loc->gdbarch, loc->addr) : "??",
- &pc_out);
-
+ std::string pc_out (loc->gdbarch
+ ? paddress (loc->gdbarch, loc->addr)
+ : "??");
const char *pc_buf = pc_out.c_str ();
int pc_width = pc_out.size ();
--
2.17.2