• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂992f1ddc3be1f5195f18beaa801ac50f284b10c5 (tree)
時間2016-12-21 02:07:19
作者Pedro Alves <palves@redh...>
CommiterPedro Alves

Log Message

gdb: Constify solib_find

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.

Change Summary

差異

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,16 @@
11 2016-12-20 Pedro Alves <palves@redhat.com>
2+
3+ * nto-tdep.c (nto_find_and_open_solib): Constify 'solib'
4+ parameter.
5+ * nto-tdep.h (nto_find_and_open_solib): Constify 'solib'
6+ parameter.
7+ * solib.c (solib_find_1, exec_file_find, solib_find): Constify
8+ in_pathname' parameter.
9+ * solist.h (struct target_so_ops) <find_and_open_solib>: Constify
10+ 'soname' parameter.
11+ (exec_file_find, solib_find): Constify 'in_pathname' parameter.
12+
13+2016-12-20 Pedro Alves <palves@redhat.com>
214 Yao Qi <yao.qi@linaro.org>
315
416 PR gdb/20977
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -87,7 +87,8 @@ nto_map_arch_to_cputype (const char *arch)
8787 }
8888
8989 int
90-nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
90+nto_find_and_open_solib (const char *solib, unsigned o_flags,
91+ char **temp_pathname)
9192 {
9293 char *buf, *arch_path, *nto_root;
9394 const char *endian;
--- a/gdb/nto-tdep.h
+++ b/gdb/nto-tdep.h
@@ -164,7 +164,7 @@ void nto_relocate_section_addresses (struct so_list *,
164164
165165 int nto_map_arch_to_cputype (const char *);
166166
167-int nto_find_and_open_solib (char *, unsigned, char **);
167+int nto_find_and_open_solib (const char *, unsigned, char **);
168168
169169 enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
170170
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -152,7 +152,7 @@ show_solib_search_path (struct ui_file *file, int from_tty,
152152 */
153153
154154 static char *
155-solib_find_1 (char *in_pathname, int *fd, int is_solib)
155+solib_find_1 (const char *in_pathname, int *fd, int is_solib)
156156 {
157157 const struct target_so_ops *ops = solib_ops (target_gdbarch ());
158158 int found_file = -1;
@@ -383,7 +383,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
383383 file handle for the main executable. */
384384
385385 char *
386-exec_file_find (char *in_pathname, int *fd)
386+exec_file_find (const char *in_pathname, int *fd)
387387 {
388388 char *result;
389389 const char *fskind = effective_target_file_system_kind ();
@@ -434,7 +434,7 @@ exec_file_find (char *in_pathname, int *fd)
434434 above. */
435435
436436 char *
437-solib_find (char *in_pathname, int *fd)
437+solib_find (const char *in_pathname, int *fd)
438438 {
439439 const char *solib_symbols_extension
440440 = gdbarch_solib_symbols_extension (target_gdbarch ());
@@ -443,7 +443,7 @@ solib_find (char *in_pathname, int *fd)
443443 extension. */
444444 if (solib_symbols_extension != NULL)
445445 {
446- char *p = in_pathname + strlen (in_pathname);
446+ const char *p = in_pathname + strlen (in_pathname);
447447
448448 while (p > in_pathname && *p != '.')
449449 p--;
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -127,7 +127,7 @@ struct target_so_ops
127127 If TEMP_PATHNAME is non-NULL: If the file is successfully opened a
128128 pointer to a malloc'd and realpath'd copy of SONAME is stored there,
129129 otherwise NULL is stored there. */
130- int (*find_and_open_solib) (char *soname,
130+ int (*find_and_open_solib) (const char *soname,
131131 unsigned o_flags, char **temp_pathname);
132132
133133 /* Hook for looking up global symbols in a library-specific way. */
@@ -172,10 +172,10 @@ void free_so (struct so_list *so);
172172 struct so_list *master_so_list (void);
173173
174174 /* Find main executable binary file. */
175-extern char *exec_file_find (char *in_pathname, int *fd);
175+extern char *exec_file_find (const char *in_pathname, int *fd);
176176
177177 /* Find shared library binary file. */
178-extern char *solib_find (char *in_pathname, int *fd);
178+extern char *solib_find (const char *in_pathname, int *fd);
179179
180180 /* Open BFD for shared library file. */
181181 extern bfd *solib_bfd_fopen (char *pathname, int fd);