/* Top level stuff for GDB, the GNU debugger.
- Copyright (C) 1986-2021 Free Software Foundation, Inc.
+ Copyright (C) 1986-2022 Free Software Foundation, Inc.
This file is part of GDB.
int dbx_commands = 0;
/* System root path, used to find libraries etc. */
-char *gdb_sysroot = 0;
+std::string gdb_sysroot;
/* GDB datadir, used to store data files. */
std::string gdb_datadir;
/* Option type -ix. */
CMDARG_INIT_FILE,
-
+
/* Option type -iex. */
CMDARG_INIT_COMMAND,
- /* Option type -sx. */
+ /* Option type -eix. */
CMDARG_EARLYINIT_FILE,
- /* Option type -sex. */
+ /* Option type -eiex. */
CMDARG_EARLYINIT_COMMAND
};
/* Prefix warning messages with the command name. */
gdb::unique_xmalloc_ptr<char> tmp_warn_preprint
- (xstrprintf ("%s: warning: ", gdb_program_name));
+ = xstrprintf ("%s: warning: ", gdb_program_name);
warning_pre_print = tmp_warn_preprint.get ();
current_directory = getcwd (NULL, 0);
perror_warning_with_name (_("error finding working directory"));
/* Set the sysroot path. */
- gdb_sysroot
- = xstrdup (relocate_gdb_directory (TARGET_SYSTEM_ROOT,
- TARGET_SYSTEM_ROOT_RELOCATABLE).c_str ());
+ gdb_sysroot = relocate_gdb_directory (TARGET_SYSTEM_ROOT,
+ TARGET_SYSTEM_ROOT_RELOCATABLE);
- if (*gdb_sysroot == '\0')
- {
- xfree (gdb_sysroot);
- gdb_sysroot = xstrdup (TARGET_SYSROOT_PREFIX);
- }
+ if (gdb_sysroot.empty ())
+ gdb_sysroot = TARGET_SYSROOT_PREFIX;
debug_file_directory
- = xstrdup (relocate_gdb_directory (DEBUGDIR,
- DEBUGDIR_RELOCATABLE).c_str ());
+ = relocate_gdb_directory (DEBUGDIR, DEBUGDIR_RELOCATABLE);
gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
GDB_DATADIR_RELOCATABLE);
gdb::alternate_signal_stack signal_stack;
/* Initialize all files. */
- gdb_init (gdb_program_name);
+ gdb_init ();
/* Process early init files and early init options from the command line. */
if (!inhibit_gdbinit)
execute_cmdargs (&cmdarg_vec, CMDARG_EARLYINIT_FILE,
CMDARG_EARLYINIT_COMMAND, &ret);
+ /* Initialize the extension languages. */
+ ext_lang_initialization ();
+
+ /* Recheck if we're starting up quietly after processing the startup
+ scripts and commands. */
+ if (!quiet)
+ quiet = check_quiet_mode ();
+
/* Now that gdb_init has created the initial inferior, we're in
position to set args for that inferior. */
if (set_args)
if (print_version)
{
print_gdb_version (gdb_stdout, false);
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
printf_filtered ("\n");
exit (0);
}
if (print_configuration)
{
print_gdb_configuration (gdb_stdout);
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
printf_filtered ("\n");
exit (0);
}
print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
printf_filtered ("\n");
gdb_flush (gdb_stdout); /* Force to screen during slow
operations. */
print_gdb_version (gdb_stdout, true);
if (symarg)
printf_filtered ("..");
- wrap_here ("");
+ gdb_stdout->wrap_here (0);
printf_filtered ("\n");
gdb_flush (gdb_stdout); /* Force to screen during slow
operations. */