#endif
#include <fcntl.h>
-#include <readline/readline.h>
+#include "readline/readline.h"
#include "gdb_string.h"
#include "gdbcore.h"
struct vmap *map_vmap (bfd *, bfd *);
-void (*file_changed_hook) (char *);
+void (*deprecated_file_changed_hook) (char *);
/* Prototypes for local functions */
-static void add_to_section_table (bfd *, sec_ptr, void *);
-
static void exec_close (int);
static void file_command (char *, int);
static void exec_files_info (struct target_ops *);
-static void bfdsec_to_vmap (bfd *, sec_ptr, void *);
-
static int ignore (CORE_ADDR, char *);
static void init_exec_ops (void);
char *scratch_pathname;
int scratch_chan;
- scratch_chan = openp (getenv ("PATH"), 1, filename,
+ scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
&scratch_pathname);
#if defined(__GO32__) || defined(_WIN32) || defined(__CYGWIN__)
{
char *exename = alloca (strlen (filename) + 5);
strcat (strcpy (exename, filename), ".exe");
- scratch_chan = openp (getenv ("PATH"), 1, exename, write_files ?
- O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0, &scratch_pathname);
+ scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, exename,
+ write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY, 0,
+ &scratch_pathname);
}
#endif
if (scratch_chan < 0)
push_target (&exec_ops);
/* Tell display code (if any) about the changed file name. */
- if (exec_file_display_hook)
- (*exec_file_display_hook) (filename);
+ if (deprecated_exec_file_display_hook)
+ (*deprecated_exec_file_display_hook) (filename);
}
+ bfd_cache_close_all ();
}
/* Process the first arg in ARGS as the new exec file.
the exec file, but that's rough. */
exec_file_command (arg, from_tty);
symbol_file_command (arg, from_tty);
- if (file_changed_hook)
- file_changed_hook (arg);
+ if (deprecated_file_changed_hook)
+ deprecated_file_changed_hook (arg);
}
\f
we cast it back to its proper type. */
static void
-add_to_section_table (bfd *abfd, sec_ptr asect, void *table_pp_char)
+add_to_section_table (bfd *abfd, struct bfd_section *asect,
+ void *table_pp_char)
{
struct section_table **table_pp = (struct section_table **) table_pp_char;
flagword aflag;
Returns 0 if OK, 1 on error. */
int
-build_section_table (bfd *some_bfd, struct section_table **start,
+build_section_table (struct bfd *some_bfd, struct section_table **start,
struct section_table **end)
{
unsigned count;
}
\f
static void
-bfdsec_to_vmap (bfd *abfd, sec_ptr sect, void *arg3)
+bfdsec_to_vmap (struct bfd *abfd, struct bfd_section *sect, void *arg3)
{
struct vmap_and_bfd *vmap_bfd = (struct vmap_and_bfd *) arg3;
struct vmap *vp;
if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0)
return;
- if (STREQ (bfd_section_name (abfd, sect), ".text"))
+ if (DEPRECATED_STREQ (bfd_section_name (abfd, sect), ".text"))
{
vp->tstart = bfd_section_vma (abfd, sect);
vp->tend = vp->tstart + bfd_section_size (abfd, sect);
vp->tvma = bfd_section_vma (abfd, sect);
vp->toffs = sect->filepos;
}
- else if (STREQ (bfd_section_name (abfd, sect), ".data"))
+ else if (DEPRECATED_STREQ (bfd_section_name (abfd, sect), ".data"))
{
vp->dstart = bfd_section_vma (abfd, sect);
vp->dend = vp->dstart + bfd_section_size (abfd, sect);
file itself are wrong. Each section must be changed separately. The\n\
``info files'' command lists all the sections and their addresses.");
- add_show_from_set
+ deprecated_add_show_from_set
(add_set_cmd ("write", class_support, var_boolean, (char *) &write_files,
"Set writing into executable and core files.",
&setlist),