Remove gdb_sysroot NULL checks
authorGary Benson <gbenson@redhat.com>
Wed, 24 Jun 2015 15:06:49 +0000 (16:06 +0100)
committerGary Benson <gbenson@redhat.com>
Thu, 25 Jun 2015 08:31:07 +0000 (09:31 +0100)
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.

gdb/ChangeLog
gdb/exec.c
gdb/infrun.c
gdb/remote.c
gdb/solib.c

index a52624b4538099fa14fbaeacd2f99a97fbb1e130..4ff683dcac5c3652f3b51cf803e92733f2d50870 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-25  Gary Benson  <gbenson@redhat.com>
+
+       * 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.
+
 2015-06-24  Keith Seitz  <keiths@redhat.com>
 
        * build-id.c (build_id_to_debug_bfd): Add cleanup to free
index 8a4ab6f083221850ecd182b06c9480c308feb749..3dfc437a9b313d29bf7c41ec883343db9f8830ff 100644 (file)
@@ -154,8 +154,7 @@ exec_file_locate_attach (int pid, int from_tty)
 
   /* If gdb_sysroot is not empty and the discovered filename
      is absolute then prefix the filename with gdb_sysroot.  */
-  if (gdb_sysroot != NULL && *gdb_sysroot != '\0'
-      && IS_ABSOLUTE_PATH (exec_file))
+  if (*gdb_sysroot != '\0' && IS_ABSOLUTE_PATH (exec_file))
     full_exec_path = exec_file_find (exec_file, NULL);
 
   if (full_exec_path == NULL)
index 233d0f8ca5ef5a13ca0d05c80206918ee72927ba..792f8474a5f3ea1ffa3b798e916f68e4e45b9879 100644 (file)
@@ -1133,7 +1133,7 @@ follow_exec (ptid_t ptid, char *execd_pathname)
 
   breakpoint_init_inferior (inf_execd);
 
-  if (gdb_sysroot != NULL && *gdb_sysroot != '\0')
+  if (*gdb_sysroot != '\0')
     {
       char *name = exec_file_find (execd_pathname, NULL);
 
index f15d75efc1e9d4881eed38e391760f98309fea80..68dd99df8fc6336448e8b57f4a7b2919014ffc7b 100644 (file)
@@ -10538,8 +10538,7 @@ remote_filesystem_is_local (struct target_ops *self)
      this case we treat the remote filesystem as local if the
      sysroot is exactly TARGET_SYSROOT_PREFIX and if the stub
      does not support vFile:open.  */
-  if (gdb_sysroot != NULL
-      && strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) == 0)
+  if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) == 0)
     {
       enum packet_support ps = packet_support (PACKET_vFile_open);
 
index 0010c2fe45c6daf012b721e9515c61f81d270423..ed1bc253ecb80236e62a96b8c5bcf775d8ce630c 100644 (file)
@@ -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);
 
This page took 0.03975 seconds and 4 git commands to generate.