line[0] = '\0'; /* Terminate saved (now empty) cmd line */
instream = stdin;
- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
- current_directory = gdb_dirbuf;
-
gdb_stdout = stdio_fileopen (stdout);
gdb_stderr = stdio_fileopen (stderr);
gdb_stdlog = gdb_stderr; /* for moment */
gdb_stdtargerr = gdb_stderr; /* for moment */
gdb_stdtargin = gdb_stdin; /* for moment */
+ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+ /* Don't use *_filtered or warning() (which relies on
+ current_target) until after initialize_all_files(). */
+ fprintf_unfiltered (gdb_stderr,
+ _("%s: warning: error finding working directory: %s\n"),
+ argv[0], safe_strerror (errno));
+
+ current_directory = gdb_dirbuf;
+
/* Set the sysroot path. */
#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT);