summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi/mi-console.c')
-rw-r--r--gdb/mi/mi-console.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c
index c1b6e9f7b33..aca008640fd 100644
--- a/gdb/mi/mi-console.c
+++ b/gdb/mi/mi-console.c
@@ -37,13 +37,14 @@ struct mi_console_file
struct ui_file *raw;
struct ui_file *buffer;
const char *prefix;
+ char quote;
};
int mi_console_file_magic;
struct ui_file *
mi_console_file_new (struct ui_file *raw,
- const char *prefix)
+ const char *prefix, char quote)
{
struct ui_file *ui_file = ui_file_new ();
struct mi_console_file *mi_console = XMALLOC (struct mi_console_file);
@@ -51,6 +52,7 @@ mi_console_file_new (struct ui_file *raw,
mi_console->raw = raw;
mi_console->buffer = mem_fileopen ();
mi_console->prefix = prefix;
+ mi_console->quote = quote;
set_ui_file_fputs (ui_file, mi_console_file_fputs);
set_ui_file_flush (ui_file, mi_console_file_flush);
set_ui_file_data (ui_file, mi_console, mi_console_file_delete);
@@ -96,9 +98,17 @@ mi_console_raw_packet (void *data,
if (length_buf > 0)
{
fputs_unfiltered (mi_console->prefix, mi_console->raw);
- fputs_unfiltered ("\"", mi_console->raw);
- fputstrn_unfiltered (buf, length_buf, '"', mi_console->raw);
- fputs_unfiltered ("\"\n", mi_console->raw);
+ if (mi_console->quote)
+ {
+ fputs_unfiltered ("\"", mi_console->raw);
+ fputstrn_unfiltered (buf, length_buf, mi_console->quote, mi_console->raw);
+ fputs_unfiltered ("\"\n", mi_console->raw);
+ }
+ else
+ {
+ fputstrn_unfiltered (buf, length_buf, 0, mi_console->raw);
+ fputs_unfiltered ("\n", mi_console->raw);
+ }
gdb_flush (mi_console->raw);
}
}