summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 2f7954a48de..680c44b3776 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8661,16 +8661,10 @@ remote_send (char **buf,
static std::string
escape_buffer (const char *buf, int n)
{
- struct cleanup *old_chain;
- struct ui_file *stb;
-
- stb = mem_fileopen ();
- old_chain = make_cleanup_ui_file_delete (stb);
+ string_file stb;
- fputstrn_unfiltered (buf, n, '\\', stb);
- std::string str = ui_file_as_string (stb);
- do_cleanups (old_chain);
- return str;
+ stb.putstrn (buf, n, '\\');
+ return std::move (stb.string ());
}
/* Display a null-terminated packet on stdout, for debugging, using C