This constifies the bfd_open method of struct target_so_ops.
gdb/ChangeLog
2018-02-14 Tom Tromey <tom@tromey.com>
* solist.h (struct target_so_ops) <bfd_open>: Make pathname
const.
(solib_bfd_open): Make pathname const.
* solib.c (solib_bfd_open): Make pathname const.
* solib-spu.c (spu_bfd_fopen): Make name const.
(spu_bfd_open): Make pathname const.
* solib-darwin.c (darwin_bfd_open): Make pathname const.
* solib-aix.c (solib_aix_bfd_open): Make pathname const.
+2018-02-14 Tom Tromey <tom@tromey.com>
+
+ * solist.h (struct target_so_ops) <bfd_open>: Make pathname
+ const.
+ (solib_bfd_open): Make pathname const.
+ * solib.c (solib_bfd_open): Make pathname const.
+ * solib-spu.c (spu_bfd_fopen): Make name const.
+ (spu_bfd_open): Make pathname const.
+ * solib-darwin.c (darwin_bfd_open): Make pathname const.
+ * solib-aix.c (solib_aix_bfd_open): Make pathname const.
+
2018-02-14 Tom Tromey <tom@tromey.com>
* symfile.c (symfile_bfd_open): Update.
/* Implement the "bfd_open" target_so_ops method. */
static gdb_bfd_ref_ptr
-solib_aix_bfd_open (char *pathname)
+solib_aix_bfd_open (const char *pathname)
{
/* The pathname is actually a synthetic filename with the following
form: "/path/to/sharedlib(member.o)" (double-quotes excluded).
FIXME: This is a little hacky. Perhaps we should provide access
to the solib's lm_info here? */
const int path_len = strlen (pathname);
- char *sep;
+ const char *sep;
int filename_len;
int found_file;
}
static gdb_bfd_ref_ptr
-darwin_bfd_open (char *pathname)
+darwin_bfd_open (const char *pathname)
{
int found_file;
}
static gdb_bfd_ref_ptr
-spu_bfd_fopen (char *name, CORE_ADDR addr)
+spu_bfd_fopen (const char *name, CORE_ADDR addr)
{
CORE_ADDR *open_closure = XNEW (CORE_ADDR);
/* Open shared library BFD. */
static gdb_bfd_ref_ptr
-spu_bfd_open (char *pathname)
+spu_bfd_open (const char *pathname)
{
- char *original_name = strrchr (pathname, '@');
+ const char *original_name = strrchr (pathname, '@');
asection *spu_name;
unsigned long long addr;
int fd;
/* Find shared library PATHNAME and open a BFD for it. */
gdb_bfd_ref_ptr
-solib_bfd_open (char *pathname)
+solib_bfd_open (const char *pathname)
{
int found_file;
const struct bfd_arch_info *b;
int (*in_dynsym_resolve_code) (CORE_ADDR pc);
/* Find and open shared library binary file. */
- gdb_bfd_ref_ptr (*bfd_open) (char *pathname);
+ gdb_bfd_ref_ptr (*bfd_open) (const char *pathname);
/* Optional extra hook for finding and opening a solib.
If TEMP_PATHNAME is non-NULL: If the file is successfully opened a
extern gdb_bfd_ref_ptr solib_bfd_fopen (const char *pathname, int fd);
/* Find solib binary file and open it. */
-extern gdb_bfd_ref_ptr solib_bfd_open (char *in_pathname);
+extern gdb_bfd_ref_ptr solib_bfd_open (const char *in_pathname);
/* FIXME: gdbarch needs to control this variable. */
extern struct target_so_ops *current_target_so_ops;