aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-06-24 16:06:49 +0100
committerGary Benson <gbenson@redhat.com>2015-06-25 09:31:07 +0100
commita3be80c3c54e9e2c0d8e9a1ff77c931cd8ebeb60 (patch)
tree21d6dbc895dd38aebad7bcfdd748dc0284817e15 /gdb/solib.c
parent53f7371c77f50aea587cf06bf4cc79273ee1382e (diff)
downloadfsf-binutils-gdb-a3be80c3c54e9e2c0d8e9a1ff77c931cd8ebeb60.zip
fsf-binutils-gdb-a3be80c3c54e9e2c0d8e9a1ff77c931cd8ebeb60.tar.gz
fsf-binutils-gdb-a3be80c3c54e9e2c0d8e9a1ff77c931cd8ebeb60.tar.bz2
Remove gdb_sysroot NULL checks
Since fed040c6a50399617d8265cbddc7fd21b3f134ef gdb_sysroot is never NULL. This commit removes all gdb_sysroot NULL checks. gdb/ChangeLog: * exec.c (exec_file_locate_attach): Remove gdb_sysroot NULL check. * infrun.c (follow_exec): Likewise. * remote.c (remote_filesystem_is_local): Likewise. * solib.c (solib_find_1): Likewise.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 0010c2f..ed1bc25 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -159,23 +159,18 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib)
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
char *sysroot = gdb_sysroot;
- if (sysroot != NULL)
- {
- /* If the absolute prefix starts with "target:" but the
- filesystem accessed by the target_fileio_* methods
- is the local filesystem then we strip the "target:"
- prefix now and work with the local filesystem. This
- ensures that the same search algorithm is used for
- all local files regardless of whether a "target:"
- prefix was used. */
- if (is_target_filename (sysroot) && target_filesystem_is_local ())
- sysroot += strlen (TARGET_SYSROOT_PREFIX);
-
- if (*sysroot == '\0')
- sysroot = NULL;
- }
-
- if (sysroot != NULL)
+ /* If the absolute prefix starts with "target:" but the filesystem
+ accessed by the target_fileio_* methods is the local filesystem
+ then we strip the "target:" prefix now and work with the local
+ filesystem. This ensures that the same search algorithm is used
+ for all local files regardless of whether a "target:" prefix was
+ used. */
+ if (is_target_filename (sysroot) && target_filesystem_is_local ())
+ sysroot += strlen (TARGET_SYSROOT_PREFIX);
+
+ if (*sysroot == '\0')
+ sysroot = NULL;
+ else
{
int prefix_len = strlen (sysroot);