This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v12 07/32] Code cleanup: Make solib_find_1 variable const
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 21 Aug 2015 23:21:04 +0200
- Subject: [PATCH v12 07/32] Code cleanup: Make solib_find_1 variable const
- Authentication-results: sourceware.org; auth=none
- References: <20150821212006 dot 6673 dot 35100 dot stgit at host1 dot jankratochvil dot net>
Hi,
it gets used in the next patch.
Jan
2015-08-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* solib.c (solib_find_1): Make sysroot variable const.
---
0 files changed
diff --git a/gdb/solib.c b/gdb/solib.c
index cf78f6a..be31ffd 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -157,7 +157,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
char *temp_pathname = NULL;
const char *fskind = effective_target_file_system_kind ();
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
- char *sysroot = gdb_sysroot;
+ const char *sysroot = gdb_sysroot;
int prefix_len, orig_prefix_len;
/* If the absolute prefix starts with "target:" but the filesystem
@@ -179,8 +179,10 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
sysroot = NULL;
else if (prefix_len != orig_prefix_len)
{
- sysroot = savestring (sysroot, prefix_len);
- make_cleanup (xfree, sysroot);
+ char *s = savestring (sysroot, prefix_len);
+
+ make_cleanup (xfree, s);
+ sysroot = s;
}
/* If we're on a non-DOS-based system, backslashes won't be