diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/coffread.c | 2 | ||||
-rw-r--r-- | gdb/dbxread.c | 8 | ||||
-rw-r--r-- | gdb/gdb_bfd.c | 2 | ||||
-rw-r--r-- | gdb/solib-aix.c | 4 | ||||
-rw-r--r-- | gdb/solib-darwin.c | 2 | ||||
-rw-r--r-- | gdb/solib.c | 2 | ||||
-rw-r--r-- | gdb/symfile-mem.c | 2 | ||||
-rw-r--r-- | gdb/symfile.c | 2 |
9 files changed, 24 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f55d1a8..40bd4d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +2019-09-06 Alan Modra <amodra@gmail.com> + + * coffread.c (coff_symfile_read): Constify filename variable. + * dbxread.c (dbx_symfile_init, coffstab_build_psymtabs), + (elfstab_build_psymtabs, stabsect_build_psymtabs): Likewise. + * gdb_bfd.c (gdb_bfd_close_or_warn): Likewise. + * solib.c (reload_shared_libraries_1): Likewise. + * symfile.c (reread_symbols): Likewise. + * solib-aix.c (solib_aix_bfd_open): Add cast for xfree of filename. + * solib-darwin.c (darwin_bfd_open): Likewise. + * symfile-mem.c (symbol_file_add_from_memory): Likewise. + 2019-09-03 Andrew Burgess <andrew.burgess@embecosm.com> * psymtab.c (print_partial_symbols): Handle missing domain_enum diff --git a/gdb/coffread.c b/gdb/coffread.c index e24ab8d..a704612 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -538,7 +538,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) struct coff_symfile_info *info; bfd *abfd = objfile->obfd; coff_data_type *cdata = coff_data (abfd); - char *filename = bfd_get_filename (abfd); + const char *filename = bfd_get_filename (abfd); int val; unsigned int num_symbols; int symtab_offset; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e339d1f..df3ae58 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -587,7 +587,7 @@ dbx_symfile_init (struct objfile *objfile) { int val; bfd *sym_bfd = objfile->obfd; - char *name = bfd_get_filename (sym_bfd); + const char *name = bfd_get_filename (sym_bfd); asection *text_sect; unsigned char size_temp[DBX_STRINGTAB_SIZE_SIZE]; @@ -2939,7 +2939,7 @@ coffstab_build_psymtabs (struct objfile *objfile, { int val; bfd *sym_bfd = objfile->obfd; - char *name = bfd_get_filename (sym_bfd); + const char *name = bfd_get_filename (sym_bfd); unsigned int stabsize; /* Allocate struct to keep track of stab reading. */ @@ -3026,7 +3026,7 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect, { int val; bfd *sym_bfd = objfile->obfd; - char *name = bfd_get_filename (sym_bfd); + const char *name = bfd_get_filename (sym_bfd); stabsread_new_init (); @@ -3107,7 +3107,7 @@ stabsect_build_psymtabs (struct objfile *objfile, char *stab_name, { int val; bfd *sym_bfd = objfile->obfd; - char *name = bfd_get_filename (sym_bfd); + const char *name = bfd_get_filename (sym_bfd); asection *stabsect; asection *stabstrsect; asection *text_sect; diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c index 0334523..d3b4c74 100644 --- a/gdb/gdb_bfd.c +++ b/gdb/gdb_bfd.c @@ -504,7 +504,7 @@ static int gdb_bfd_close_or_warn (struct bfd *abfd) { int ret; - char *name = bfd_get_filename (abfd); + const char *name = bfd_get_filename (abfd); bfd_map_over_sections (abfd, free_one_bfd_section, NULL); diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c index d13b651..2b54442 100644 --- a/gdb/solib-aix.c +++ b/gdb/solib-aix.c @@ -643,9 +643,9 @@ solib_aix_bfd_open (const char *pathname) along with appended parenthesized member name in order to allow commands listing all shared libraries to display. Otherwise, we would only be displaying the name of the archive member object. */ - xfree (bfd_get_filename (object_bfd.get ())); + xfree ((char *) bfd_get_filename (object_bfd.get ())); object_bfd->filename = xstrprintf ("%s%s", - bfd_get_filename (archive_bfd.get ()), + bfd_get_filename (archive_bfd.get ()), sep); return object_bfd; diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c index 443ebb6..3dd30d2 100644 --- a/gdb/solib-darwin.c +++ b/gdb/solib-darwin.c @@ -670,7 +670,7 @@ darwin_bfd_open (const char *pathname) /* The current filename for fat-binary BFDs is a name generated by BFD, usually a string containing the name of the architecture. Reset its value to the actual filename. */ - xfree (bfd_get_filename (res.get ())); + xfree ((char *) bfd_get_filename (res.get ())); res->filename = xstrdup (pathname); return res; diff --git a/gdb/solib.c b/gdb/solib.c index 29a17ad..86000f6 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1296,7 +1296,7 @@ reload_shared_libraries_1 (int from_tty) for (so = so_list_head; so != NULL; so = so->next) { - char *found_pathname = NULL; + const char *found_pathname = NULL; int was_loaded = so->symbols_loaded; symfile_add_flags add_flags = SYMFILE_DEFER_BP_RESET; diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c index 51a7554..6d1deae 100644 --- a/gdb/symfile-mem.c +++ b/gdb/symfile-mem.c @@ -101,7 +101,7 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, /* Manage the new reference for the duration of this function. */ gdb_bfd_ref_ptr nbfd_holder = gdb_bfd_ref_ptr::new_reference (nbfd); - xfree (bfd_get_filename (nbfd)); + xfree ((char *) bfd_get_filename (nbfd)); if (name == NULL) nbfd->filename = xstrdup ("shared object read from target memory"); else diff --git a/gdb/symfile.c b/gdb/symfile.c index 8843781..3cd5144 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2548,7 +2548,7 @@ reread_symbols (void) /* Clean up any state BFD has sitting around. */ { gdb_bfd_ref_ptr obfd (objfile->obfd); - char *obfd_filename; + const char *obfd_filename; obfd_filename = bfd_get_filename (objfile->obfd); /* Open the new BFD before freeing the old one, so that |