aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gdb/main.c b/gdb/main.c
index ca34bf1..eac7089 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1,6 +1,6 @@
/* Top level stuff for GDB, the GNU debugger.
- Copyright (C) 1986-2024 Free Software Foundation, Inc.
+ Copyright (C) 1986-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -19,6 +19,7 @@
#include "annotate.h"
#include "exceptions.h"
+#include "gdbsupport/common-inferior.h"
#include "top.h"
#include "ui.h"
#include "target.h"
@@ -399,7 +400,7 @@ start_event_loop ()
try
{
- result = gdb_do_one_event ();
+ result = current_interpreter ()->do_one_event ();
}
catch (const gdb_exception_forced_quit &ex)
{
@@ -420,6 +421,7 @@ start_event_loop ()
get around to resetting the prompt, which leaves readline
in a messed-up state. Reset it here. */
current_ui->prompt_state = PROMPT_NEEDED;
+ current_ui->line_buffer.clear ();
top_level_interpreter ()->on_command_error ();
/* This call looks bizarre, but it is required. If the user
entered a command that caused an error,
@@ -672,6 +674,8 @@ captured_main_1 (struct captured_main_args *context)
/* Ensure stderr is unbuffered. A Cygwin pty or pipe is implemented
as a Windows pipe, and Windows buffers on pipes. */
setvbuf (stderr, NULL, _IONBF, BUFSIZ);
+
+ windows_initialize_console ();
#endif
/* Note: `error' cannot be called before this point, because the
@@ -1327,10 +1331,8 @@ captured_main_1 (struct captured_main_args *context)
}
static void
-captured_main (void *data)
+captured_main (captured_main_args *context)
{
- struct captured_main_args *context = (struct captured_main_args *) data;
-
captured_main_1 (context);
/* NOTE: cagney/1999-11-07: There is probably no reason for not