From a887499c6b363aa97a6dd11807878ee9fa406e35 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 19 Apr 2024 15:46:51 -0400 Subject: gdb: make target debug functions return std::string Change the functions in target-debug.h to return string representations in an std::string, such that they don't need to know how the printing part is done. This also helps the following patch that makes the debug prints in debug_target one-liners. Update target-delegates.c (through make-target-delegates.py) to do the printing. Add an overload of gdb_puts to avoid using `.c_str ()`. Change-Id: I55cbff1c1b03a3b24a81740e34c6ad41ac4f8453 Approved-By: Tom Tromey --- gdb/utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/utils.h') diff --git a/gdb/utils.h b/gdb/utils.h index 9635089..f0189c7 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -205,6 +205,8 @@ extern void set_screen_width_and_height (int width, int height); extern void gdb_puts (const char *, struct ui_file *); +extern void gdb_puts (const std::string &s, ui_file *stream); + extern void gdb_putc (int c, struct ui_file *); extern void gdb_putc (int c); -- cgit v1.1