/* Core dump and executable file functions above target vector, for GDB.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994
+ Copyright 1986, 1987, 1989, 1991-1994, 2000
Free Software Foundation, Inc.
This file is part of GDB.
symfile = t->to_core_file_to_sym_file (filename);
if (symfile)
{
- char *symfile_copy = strdup (symfile);
+ char *symfile_copy = xstrdup (symfile);
make_cleanup (free, symfile_copy);
symbol_file_command (symfile_copy, from_tty);
return;
/* If the timestamp of the exec file has changed, reopen it. */
- filename = strdup (bfd_get_filename (exec_bfd));
+ filename = xstrdup (bfd_get_filename (exec_bfd));
make_cleanup (free, filename);
mtime = bfd_get_mtime (exec_bfd);
res = stat (filename, &st);
int status;
CORE_ADDR memaddr;
{
+ struct ui_file *tmp_stream = mem_fileopen ();
+ make_cleanup_ui_file_delete (tmp_stream);
+
if (status == EIO)
{
/* Actually, address between memaddr and memaddr + len
was out of bounds. */
- error_begin ();
- printf_filtered ("Cannot access memory at address ");
- print_address_numeric (memaddr, 1, gdb_stdout);
- printf_filtered (".\n");
- return_to_top_level (RETURN_ERROR);
+ fprintf_unfiltered (tmp_stream, "Cannot access memory at address ");
+ print_address_numeric (memaddr, 1, tmp_stream);
}
else
{
- error_begin ();
- printf_filtered ("Error accessing memory address ");
- print_address_numeric (memaddr, 1, gdb_stdout);
- printf_filtered (": %s.\n",
+ fprintf_filtered (tmp_stream, "Error accessing memory address ");
+ print_address_numeric (memaddr, 1, tmp_stream);
+ fprintf_filtered (tmp_stream, ": %s.",
safe_strerror (status));
- return_to_top_level (RETURN_ERROR);
}
+
+ error_stream (tmp_stream);
}
/* Same as target_read_memory, but report an error if can't read. */