A following patch will add one more defaulted parameter.
gdb/ChangeLog:
2020-05-19 Pedro Alves <palves@redhat.com>
* gdb_bfd.h: (gdb_bfd_open): Default to 'fd' parameter to -1.
Adjust all callers.
+2020-05-19 Pedro Alves <palves@redhat.com>
+
+ * gdb_bfd.h: (gdb_bfd_open): Default to 'fd' parameter to -1.
+ Adjust all callers.
+
2020-05-19 Yoshinori Sato <ysato@users.sourceforge.jp>
* h8300-tdep.c (h8300_is_argument_spill): Change how we check
}
/* We expect to be silent on the non-existing files. */
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget);
if (debug_bfd == NULL)
{
gdb::unique_xmalloc_ptr<char> filename
(tilde_expand (file_names.object_file ()));
- gdb_bfd_ref_ptr abfd (gdb_bfd_open (filename.get (), gnutarget, -1));
+ gdb_bfd_ref_ptr abfd (gdb_bfd_open (filename.get (), gnutarget));
if (abfd == NULL)
error (_("\"%s\": could not open as compiled module: %s"),
filename.get (), bfd_errmsg (bfd_get_error ()));
/* First try the file name given in the section. If that doesn't
work, try to use the build-id instead. */
- gdb_bfd_ref_ptr dwz_bfd (gdb_bfd_open (filename, gnutarget, -1));
+ gdb_bfd_ref_ptr dwz_bfd (gdb_bfd_open (filename, gnutarget));
if (dwz_bfd != NULL)
{
if (!build_id_verify (dwz_bfd.get (), buildid_len, buildid))
if (fd.get () >= 0)
{
/* File successfully retrieved from server. */
- dwz_bfd = gdb_bfd_open (alt_filename.get (), gnutarget, -1);
+ dwz_bfd = gdb_bfd_open (alt_filename.get (), gnutarget);
if (dwz_bfd == nullptr)
warning (_("File \"%s\" from debuginfod cannot be opened as bfd"),
bfd_get_filename will not be exactly NAME but rather NAME with
TARGET_SYSROOT_PREFIX stripped. */
-gdb_bfd_ref_ptr gdb_bfd_open (const char *name, const char *target, int fd);
+gdb_bfd_ref_ptr gdb_bfd_open (const char *name, const char *target,
+ int fd = -1);
/* Mark the CHILD BFD as being a member of PARENT. Also, increment
the reference count of CHILD. Calling this function ensures that
/* Open the archive and check the format. */
gdb_bfd_ref_ptr archive_bfd (gdb_bfd_open (archive_name.c_str (),
- gnutarget, -1));
+ gnutarget));
if (archive_bfd == NULL)
{
warning (_("Could not open OSO archive file \"%s\""),
}
else
{
- gdb_bfd_ref_ptr abfd (gdb_bfd_open (oso->name, gnutarget, -1));
+ gdb_bfd_ref_ptr abfd (gdb_bfd_open (oso->name, gnutarget));
if (abfd == NULL)
warning (_("`%s': can't open to read symbols: %s."), oso->name,
bfd_errmsg (bfd_get_error ()));
return NULL;
/* Create a bfd for the interpreter. */
- gdb_bfd_ref_ptr dyld_bfd (gdb_bfd_open (interp_name, gnutarget, -1));
+ gdb_bfd_ref_ptr dyld_bfd (gdb_bfd_open (interp_name, gnutarget));
if (dyld_bfd != NULL)
{
gdb_bfd_ref_ptr sub
gdb_flush (gdb_stdout);
}
- gdb_bfd_ref_ptr abfd (gdb_bfd_open (name.c_str (), gnutarget, -1));
+ gdb_bfd_ref_ptr abfd (gdb_bfd_open (name.c_str (), gnutarget));
if (abfd == NULL)
{
}
/* Open the file for loading. */
- gdb_bfd_ref_ptr loadfile_bfd (gdb_bfd_open (filename.get (), gnutarget, -1));
+ gdb_bfd_ref_ptr loadfile_bfd (gdb_bfd_open (filename.get (), gnutarget));
if (loadfile_bfd == NULL)
perror_with_name (filename.get ());
obfd_filename = bfd_get_filename (objfile->obfd);
/* Open the new BFD before freeing the old one, so that
the filename remains live. */
- gdb_bfd_ref_ptr temp (gdb_bfd_open (obfd_filename, gnutarget, -1));
+ gdb_bfd_ref_ptr temp (gdb_bfd_open (obfd_filename, gnutarget));
objfile->obfd = temp.release ();
if (objfile->obfd == NULL)
error (_("Can't open %s to read symbols."), obfd_filename);
{
asection *text = NULL;
- gdb_bfd_ref_ptr abfd (gdb_bfd_open (so->so_name, "pei-i386", -1));
+ gdb_bfd_ref_ptr abfd (gdb_bfd_open (so->so_name, "pei-i386"));
if (abfd == NULL)
return so;
if (!text_offset)
{
- gdb_bfd_ref_ptr dll (gdb_bfd_open (so_name, gnutarget, -1));
+ gdb_bfd_ref_ptr dll (gdb_bfd_open (so_name, gnutarget));
/* The following calls are OK even if dll is NULL.
The default value 0x1000 is returned by pe_text_section_offset
in that case. */