]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Constify solib_find
authorPedro Alves <palves@redhat.com>
Tue, 20 Dec 2016 17:07:19 +0000 (17:07 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 20 Dec 2016 17:07:19 +0000 (17:07 +0000)
gdb/ChangeLog:
2016-12-20  Pedro Alves  <palves@redhat.com>

* nto-tdep.c (nto_find_and_open_solib): Constify 'solib'
parameter.
* nto-tdep.h (nto_find_and_open_solib): Constify 'solib'
parameter.
* solib.c (solib_find_1, exec_file_find, solib_find): Constify
in_pathname' parameter.
* solist.h (struct target_so_ops) <find_and_open_solib>: Constify
'soname' parameter.
(exec_file_find, solib_find): Constify 'in_pathname' parameter.

gdb/ChangeLog
gdb/nto-tdep.c
gdb/nto-tdep.h
gdb/solib.c
gdb/solist.h

index 5f0e6fec2635b7073bb9e024efc759553aaf9caf..2041dd57072b9f5efa29da2a53266ee478b26a66 100644 (file)
@@ -1,3 +1,15 @@
+2016-12-20  Pedro Alves  <palves@redhat.com>
+
+       * nto-tdep.c (nto_find_and_open_solib): Constify 'solib'
+       parameter.
+       * nto-tdep.h (nto_find_and_open_solib): Constify 'solib'
+       parameter.
+       * solib.c (solib_find_1, exec_file_find, solib_find): Constify
+       in_pathname' parameter.
+       * solist.h (struct target_so_ops) <find_and_open_solib>: Constify
+       'soname' parameter.
+       (exec_file_find, solib_find): Constify 'in_pathname' parameter.
+
 2016-12-20  Pedro Alves  <palves@redhat.com>
            Yao Qi  <yao.qi@linaro.org>
 
index 47d8a2bd2774ace491d46cf6a68337bf87601d31..1b18de1ee0133bef9fd92f1e30dbf7995c7b228d 100644 (file)
@@ -87,7 +87,8 @@ nto_map_arch_to_cputype (const char *arch)
 }
 
 int
-nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
+nto_find_and_open_solib (const char *solib, unsigned o_flags,
+                        char **temp_pathname)
 {
   char *buf, *arch_path, *nto_root;
   const char *endian;
index 81ed50cb17d5eab37ce75095d59835574983e4e3..06a1f9ab1b98ff7db0f5b4d59291e77ea1a23215 100644 (file)
@@ -164,7 +164,7 @@ void nto_relocate_section_addresses (struct so_list *,
 
 int nto_map_arch_to_cputype (const char *);
 
-int nto_find_and_open_solib (char *, unsigned, char **);
+int nto_find_and_open_solib (const char *, unsigned, char **);
 
 enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
 
index c4b2cdc40ec7df2bae34ceb7fdd7cce6d32ffd18..82214d01dd5cf12546a0257d5e74570f715d645b 100644 (file)
@@ -152,7 +152,7 @@ show_solib_search_path (struct ui_file *file, int from_tty,
 */
 
 static char *
-solib_find_1 (char *in_pathname, int *fd, int is_solib)
+solib_find_1 (const char *in_pathname, int *fd, int is_solib)
 {
   const struct target_so_ops *ops = solib_ops (target_gdbarch ());
   int found_file = -1;
@@ -383,7 +383,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
    file handle for the main executable.  */
 
 char *
-exec_file_find (char *in_pathname, int *fd)
+exec_file_find (const char *in_pathname, int *fd)
 {
   char *result;
   const char *fskind = effective_target_file_system_kind ();
@@ -434,7 +434,7 @@ exec_file_find (char *in_pathname, int *fd)
    above.  */
 
 char *
-solib_find (char *in_pathname, int *fd)
+solib_find (const char *in_pathname, int *fd)
 {
   const char *solib_symbols_extension
     = gdbarch_solib_symbols_extension (target_gdbarch ());
@@ -443,7 +443,7 @@ solib_find (char *in_pathname, int *fd)
      extension.  */
   if (solib_symbols_extension != NULL)
     {
-      char *p = in_pathname + strlen (in_pathname);
+      const char *p = in_pathname + strlen (in_pathname);
 
       while (p > in_pathname && *p != '.')
        p--;
index f7094832de9a09ce3c39fd36e1a71e688313a726..948ad314ff99ab267391ca116f7647e7cd8472b5 100644 (file)
@@ -127,7 +127,7 @@ struct target_so_ops
        If TEMP_PATHNAME is non-NULL: If the file is successfully opened a
        pointer to a malloc'd and realpath'd copy of SONAME is stored there,
        otherwise NULL is stored there.  */
-    int (*find_and_open_solib) (char *soname,
+    int (*find_and_open_solib) (const char *soname,
         unsigned o_flags, char **temp_pathname);
 
     /* Hook for looking up global symbols in a library-specific way.  */
@@ -172,10 +172,10 @@ void free_so (struct so_list *so);
 struct so_list *master_so_list (void);
 
 /* Find main executable binary file.  */
-extern char *exec_file_find (char *in_pathname, int *fd);
+extern char *exec_file_find (const char *in_pathname, int *fd);
 
 /* Find shared library binary file.  */
-extern char *solib_find (char *in_pathname, int *fd);
+extern char *solib_find (const char *in_pathname, int *fd);
 
 /* Open BFD for shared library file.  */
 extern bfd *solib_bfd_fopen (char *pathname, int fd);