the possibly relocated path to python's lib directory. */
char *python_libdir = 0;
-struct ui_file *gdb_stdout;
-struct ui_file *gdb_stderr;
-struct ui_file *gdb_stdlog;
-struct ui_file *gdb_stdin;
/* Target IO streams. */
struct ui_file *gdb_stdtargin;
struct ui_file *gdb_stdtarg;
for (p = tmp_sys_gdbinit; IS_DIR_SEPARATOR (*p); ++p)
continue;
relocated_sysgdbinit = concat (gdb_datadir, SLASH_STRING, p,
- NULL);
+ (char *) NULL);
xfree (tmp_sys_gdbinit);
}
else
#ifdef HAVE_SIGALTSTACK
stack_t ss;
- ss.ss_sp = xmalloc (SIGSTKSZ);
+ /* FreeBSD versions older than 11.0 use char * for ss_sp instead of
+ void *. This cast works with both types. */
+ ss.ss_sp = (char *) xmalloc (SIGSTKSZ);
ss.ss_size = SIGSTKSZ;
ss.ss_flags = 0;
static int
captured_command_loop (void *data)
{
+ struct ui *ui = current_ui;
+
/* Top-level execution commands can be run in the background from
here on. */
- interpreter_async = 1;
+ current_ui->async = 1;
current_interp_command_loop ();
/* FIXME: cagney/1999-11-05: A correct command_loop() implementaton
error) we try to quit. If the quit is aborted, catch_errors()
which called this catch the signal and restart the command
loop. */
- quit_command (NULL, instream == stdin);
+ quit_command (NULL, ui->instream == stdin);
return 1;
}
static int
captured_main (void *data)
{
+ struct ui *ui = current_ui;
struct captured_main_args *context = (struct captured_main_args *) data;
int argc = context->argc;
char **argv = context->argv;
dirarg = (char **) xmalloc (dirsize * sizeof (*dirarg));
ndir = 0;
- clear_quit_flag ();
- saved_command_line = (char *) xmalloc (saved_command_line_size);
- saved_command_line[0] = '\0';
- instream = stdin;
+ saved_command_line = (char *) xstrdup ("");
+ ui->instream = stdin;
#ifdef __MINGW32__
/* Ensure stderr is unbuffered. A Cygwin pty or pipe is implemented
#ifdef WITH_PYTHON_PATH
{
/* For later use in helping Python find itself. */
- char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", NULL);
+ char *tmp = concat (WITH_PYTHON_PATH, SLASH_STRING, "lib", (char *) NULL);
python_libdir = relocate_gdb_directory (tmp, PYTHON_PATH_RELOCATABLE);
xfree (tmp);
{
/* Find it. */
- struct interp *interp = interp_lookup (interpreter_p);
+ struct interp *interp = interp_lookup (current_ui, interpreter_p);
if (interp == NULL)
error (_("Interpreter `%s' unrecognized"), interpreter_p);