public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  jankratochvil/gdbserverbuildid2: buildidwarn
@ 2015-07-31 20:27 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2015-07-31 20:27 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid2 has been updated
  discards  8274a0f57cae1b111180eda9cf17fa404147f6b7 (commit)
  discards  47064c63501b06767a66a733c0a09dd618e3cb87 (commit)
  discards  0c3319418b1c6a86d0d287b7c3f264b52465d2a8 (commit)
  discards  7502e0f27a4c4cc2de93772cec605433f72da870 (commit)
  discards  6f6dc7ffcfa08facd55e55e9889156b36085d9d3 (commit)
  discards  ca2b6169c11f974af7944bee906612b21372c9b4 (commit)
  discards  ca6232d06bc4517a99919e29e91f515bef5fb162 (commit)
  discards  be6b238478be554663c3fe3324488841ff13c4e7 (commit)
  discards  600a5e1c4f32c2c6b31cb856553c36a365a5580a (commit)
  discards  8cce31c49ad425dd1b23f5ff3b18e6ba928c5492 (commit)
  discards  deea42476fd8f7f148f5a0f76d157b03fb751246 (commit)
       via  52e94ef20f0a2821b4218b5412aa3448ec612a3a (commit)
       via  2d7f93fff19c806dd0567c58f06ee8c95014ac91 (commit)
       via  a17cefb1a3689e04e1cf06f075f1e38bcbb98cae (commit)
       via  ff2f924406cc046c67a53c401f903c2fe399dbfb (commit)
       via  4b23b94c23cef3b156928540ff935dc880814907 (commit)
       via  d6f35619ecaf9c7b3e2f0ed9f430a8832ff4a866 (commit)
       via  ac9889e2f97ca0b02c8864e6bf0fec61564d009f (commit)
       via  ba9310665b459c0d53cb25f12ebbc0b751b7546a (commit)
       via  4eb86256c28b998687a8743c06ad7d111cf1f936 (commit)
       via  e3a6fc81d5e6caff5d58562d178628e8a575d684 (commit)
       via  28202d6392adab7179a849c7b569c24427f09476 (commit)
      from  8274a0f57cae1b111180eda9cf17fa404147f6b7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 52e94ef20f0a2821b4218b5412aa3448ec612a3a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:49:10 2015 +0200

    buildidwarn

commit 2d7f93fff19c806dd0567c58f06ee8c95014ac91
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:50 2015 +0200

    locatetest

commit a17cefb1a3689e04e1cf06f075f1e38bcbb98cae
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:14 2015 +0200

    mainbuildid

commit ff2f924406cc046c67a53c401f903c2fe399dbfb
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:31:46 2015 +0200

    hexallocate

commit 4b23b94c23cef3b156928540ff935dc880814907
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:13:31 2015 +0200

    buildid

commit d6f35619ecaf9c7b3e2f0ed9f430a8832ff4a866
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:12:52 2015 +0200

    buildidproto

commit ac9889e2f97ca0b02c8864e6bf0fec61564d009f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 21:38:45 2015 +0200

    buildidtobfd

commit ba9310665b459c0d53cb25f12ebbc0b751b7546a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 19:52:47 2015 +0200

    buildidforcemove

commit 4eb86256c28b998687a8743c06ad7d111cf1f936
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 23:07:10 2015 +0200

    buildidfreefix

commit e3a6fc81d5e6caff5d58562d178628e8a575d684
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Jul 25 23:11:36 2015 +0200

    openp

commit 28202d6392adab7179a849c7b569c24427f09476
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 22:49:17 2015 +0200

    filelib

-----------------------------------------------------------------------

Summary of changes:
 gdb/build-id.c |    6 +++---
 gdb/solib.c    |    8 ++++----
 gdb/source.c   |   23 +++++++++++++++--------
 gdb/source.h   |    2 +-
 4 files changed, 23 insertions(+), 16 deletions(-)

First 500 lines of diff:
diff --git a/gdb/build-id.c b/gdb/build-id.c
index 95ddcc6..037d710 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -91,13 +91,13 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
   if (validate_build_id)
     {
       warning (_("Symbol file \"%s\" could not be validated (%s) and "
-		 "will be ignored; or use 'set build-id-force'."),
+		 "will be ignored; or use 'set validate-build-id off'."),
 	       bfd_get_filename (abfd), message);
       do_cleanups (back_to);
       return 0;
     }
   warning (_("Symbol file \"%s\" could not be validated (%s) "
-	     "but it is being loaded due to 'set build-id-force'."),
+	     "but it is being loaded due to 'set validate-build-id off'."),
 	   bfd_get_filename (abfd), message);
   do_cleanups (back_to);
   return 1;
@@ -157,7 +157,7 @@ build_id_to_file (size_t build_id_len, const bfd_byte *build_id,
       file_location_free (&result);
     }
 
-  file_location_init (&result);
+  file_location_enoent (&result);
   return result;
 }
 
diff --git a/gdb/solib.c b/gdb/solib.c
index d9c5718..3128558 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -267,7 +267,7 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
      and retrying in the sysroot:
        c:/foo/bar.dll ==> /sysroot/c/foo/bar.dll.  */
 
-  if (strcmp (sysroot, "") != 0
+  if (sysroot != NULL
       && HAS_TARGET_DRIVE_SPEC (fskind, in_pathname))
     {
       int need_dir_separator = !IS_DIR_SEPARATOR (in_pathname[2]);
@@ -374,7 +374,7 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
     }
 
   /* If not found, next search the inferior's $PATH environment variable.  */
-  if (strcmp (sysroot, "") == 0)
+  if (sysroot == NULL)
     {
       file = openp_file (get_in_environ (current_inferior ()->environment, "PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
       if (file_location_is_valid (&file))
@@ -384,7 +384,7 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
 
   /* If not found, and we're looking for a solib, next search the
      inferior's $LD_LIBRARY_PATH environment variable.  */
-  if (is_solib && strcmp (sysroot, "") == 0)
+  if (is_solib && sysroot == NULL)
     {
       file = openp_file (get_in_environ (current_inferior ()->environment, "LD_LIBRARY_PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
       if (file_location_is_valid (&file))
@@ -392,7 +392,7 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
       file_location_free (&file);
     }
 
-  file_location_init (&file);
+  file_location_enoent (&file);
   return file;
 }
 
diff --git a/gdb/source.c b/gdb/source.c
index 6fdf571..bc327b0 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -738,10 +738,11 @@ dirnames_to_char_ptr_vec_target_exc (const char *string)
 }
 
 void
-file_location_init (struct file_location *file)
+file_location_enoent (struct file_location *file)
 {
   memset (file, 0, sizeof (*file));
   file->fd = -1;
+  file->file_errno = ENOENT;
 }
 
 void
@@ -771,7 +772,13 @@ file_location_cleanup (void *file_voidp)
 int
 file_location_is_valid (const struct file_location *file)
 {
-  return file->abfd != NULL || file->filename != NULL;
+  if (file->abfd != NULL)
+    {
+      gdb_assert (!file->file_errno);
+      gdb_assert (!file->bfderr);
+      return 1;
+    }
+  return !file->file_errno && !file->bfderr;
 }
 
 struct file_location
@@ -782,7 +789,8 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
   int fd_dup = -1;
   struct cleanup *back_to, *fd_dup_cleanup;
 
-  file_location_init (&file);
+  memset (&file, 0, sizeof (file));
+  file.fd = -1;
   back_to = make_cleanup (file_location_cleanup, &file);
   file.filename = xstrdup (filename);
 
@@ -887,7 +895,7 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
   if (!build_id_verify (file.abfd, build_idsz, build_id))
     {
       do_cleanups (back_to);
-      file_location_init (&file);
+      file_location_enoent (&file);
       return file;
     }
 
@@ -1012,8 +1020,7 @@ openp_file (const char *path, enum openp_flags opts, const char *string, size_t
      when the debugger is started with an empty argument.  */
   if (string[0] == '\0')
     {
-      errno = ENOENT;
-      file_location_init (&file);
+      file_location_enoent (&file);
       return file;
     }
 
@@ -1038,7 +1045,7 @@ openp_file (const char *path, enum openp_flags opts, const char *string, size_t
 	for (i = 0; string[i]; i++)
 	  if (IS_DIR_SEPARATOR (string[i]))
 	    {
-	      file_location_init (&file);
+	      file_location_enoent (&file);
 	      return file;
 	    }
     }
@@ -1137,7 +1144,7 @@ openp_file (const char *path, enum openp_flags opts, const char *string, size_t
 
   do_cleanups (back_to);
 
-  file_location_init (&file);
+  file_location_enoent (&file);
   return file;
 }
 
diff --git a/gdb/source.h b/gdb/source.h
index 14bb25d..7571cef 100644
--- a/gdb/source.h
+++ b/gdb/source.h
@@ -110,7 +110,7 @@ struct file_location
   bfd_error_type bfderr;
 };
 
-extern void file_location_init (struct file_location *file);
+extern void file_location_enoent (struct file_location *file);
 
 extern void file_location_free (struct file_location *file);
 


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  jankratochvil/gdbserverbuildid2: buildidwarn
@ 2015-07-31 19:17 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2015-07-31 19:17 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid2 has been updated
  discards  d91ac3ceb0adddb1ba5aaab06699fd2af3b45ca8 (commit)
  discards  168149db3b7cde9b94d5f22766fad29fd042cfd6 (commit)
  discards  4e408474626b408a8704039e634043a2678f86fa (commit)
  discards  6bcded095e565a9ab4e3a3e63b13303e7f14782a (commit)
  discards  fe1b7ec8c97bf675e57165603468335cd14c4e4c (commit)
  discards  f637f94da2f0e92a68c04ef40688409bfa1d0246 (commit)
  discards  8251d735d186180ceb82b1bb98c65158a4e7c749 (commit)
  discards  bc787422c4a3e3b05d6b17cc804176822550559f (commit)
  discards  fffe8a3466e5b18eefc70a35e881a26510cac2d5 (commit)
  discards  12d35640805beb504883f5e811a773c2a458fb68 (commit)
  discards  9cb0c0a45bbf0797a69b9e4ea1b1c4059a7af9ec (commit)
       via  8274a0f57cae1b111180eda9cf17fa404147f6b7 (commit)
       via  47064c63501b06767a66a733c0a09dd618e3cb87 (commit)
       via  0c3319418b1c6a86d0d287b7c3f264b52465d2a8 (commit)
       via  7502e0f27a4c4cc2de93772cec605433f72da870 (commit)
       via  6f6dc7ffcfa08facd55e55e9889156b36085d9d3 (commit)
       via  ca2b6169c11f974af7944bee906612b21372c9b4 (commit)
       via  ca6232d06bc4517a99919e29e91f515bef5fb162 (commit)
       via  be6b238478be554663c3fe3324488841ff13c4e7 (commit)
       via  600a5e1c4f32c2c6b31cb856553c36a365a5580a (commit)
       via  8cce31c49ad425dd1b23f5ff3b18e6ba928c5492 (commit)
       via  deea42476fd8f7f148f5a0f76d157b03fb751246 (commit)
      from  d91ac3ceb0adddb1ba5aaab06699fd2af3b45ca8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 8274a0f57cae1b111180eda9cf17fa404147f6b7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:49:10 2015 +0200

    buildidwarn

commit 47064c63501b06767a66a733c0a09dd618e3cb87
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:50 2015 +0200

    locatetest

commit 0c3319418b1c6a86d0d287b7c3f264b52465d2a8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:14 2015 +0200

    mainbuildid

commit 7502e0f27a4c4cc2de93772cec605433f72da870
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:31:46 2015 +0200

    hexallocate

commit 6f6dc7ffcfa08facd55e55e9889156b36085d9d3
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:13:31 2015 +0200

    buildid

commit ca2b6169c11f974af7944bee906612b21372c9b4
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:12:52 2015 +0200

    buildidproto

commit ca6232d06bc4517a99919e29e91f515bef5fb162
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 21:38:45 2015 +0200

    buildidtobfd

commit be6b238478be554663c3fe3324488841ff13c4e7
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 19:52:47 2015 +0200

    buildidforcemove

commit 600a5e1c4f32c2c6b31cb856553c36a365a5580a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 23:07:10 2015 +0200

    buildidfreefix

commit 8cce31c49ad425dd1b23f5ff3b18e6ba928c5492
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Sat Jul 25 23:11:36 2015 +0200

    openp

commit deea42476fd8f7f148f5a0f76d157b03fb751246
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 22:49:17 2015 +0200

    filelib

-----------------------------------------------------------------------

Summary of changes:
 gdb/defs.h     |    2 +
 gdb/nto-tdep.c |   10 ++--
 gdb/solib.c    |  112 +++++++++++++++++-----------------
 gdb/source.c   |  185 +++++++++++++++++++++++++++++--------------------------
 gdb/source.h   |   10 ++-
 gdb/symfile.c  |   30 +++------
 6 files changed, 178 insertions(+), 171 deletions(-)

First 500 lines of diff:
diff --git a/gdb/defs.h b/gdb/defs.h
index 59db425..2e91d83 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -327,6 +327,8 @@ extern int openp (const char *, enum openp_flags, const char *, char **);
 
 extern bfd *openp_bfd (const char *path, enum openp_flags opts, const char *string);
 
+extern struct file_location openp_file (const char *path, enum openp_flags opts, const char *string, size_t build_idsz, const gdb_byte *build_id);
+
 extern int source_full_path_of (const char *, char **);
 
 extern void mod_path (char *, char **);
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index d5644e4..5bb0e7f 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -90,7 +90,7 @@ nto_find_and_open_solib (char *solib, size_t build_idsz, const gdb_byte *build_i
   const char *base;
   const char *arch;
   int arch_len, len;
-  struct file_location result;
+  struct file_location file;
 #define PATH_FMT \
   "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
 
@@ -129,10 +129,10 @@ nto_find_and_open_solib (char *solib, size_t build_idsz, const gdb_byte *build_i
 	     arch_path);
 
   base = lbasename (solib);
-  result = openp_result (buf, OPF_TRY_CWD_FIRST | OPF_IS_BFD, base, build_idsz, build_id);
-  if (file_location_is_valid (&result) || base == solib)
-    return result;
-  file_location_free (&result);
+  file = openp_file (buf, OPF_TRY_CWD_FIRST | OPF_IS_BFD, base, build_idsz, build_id);
+  if (file_location_is_valid (&file) || base == solib)
+    return file;
+  file_location_free (&file);
 
   xsnprintf (arch_path, arch_len, "/%s", solib);
   return file_location_from_filename (arch_path, 1 /* is_bfd */, build_idsz, build_id);
diff --git a/gdb/solib.c b/gdb/solib.c
index 361382d..d9c5718 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -162,7 +162,7 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
   struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
   char *sysroot;
   int prefix_len, orig_prefix_len;
-  struct file_location result;
+  struct file_location file;
 
   /* If the absolute prefix starts with "target:" but the filesystem
      accessed by the target_fileio_* methods is the local filesystem
@@ -252,13 +252,13 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
     }
 
   /* Now see if we can open it.  */
-  result = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
-  if (file_location_is_valid (&result))
+  file = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
+  if (file_location_is_valid (&file))
     {
       do_cleanups (old_chain);
-      return result;
+      return file;
     }
-  file_location_free (&result);
+  file_location_free (&file);
 
   xfree (temp_pathname);
 
@@ -280,13 +280,13 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
 			      in_pathname + 2, (char *) NULL);
       xfree (drive);
 
-      result = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
-      if (file_location_is_valid (&result))
+      file = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
+      if (file_location_is_valid (&file))
 	{
 	  do_cleanups (old_chain);
-	  return result;
+	  return file;
 	}
-      file_location_free (&result);
+      file_location_free (&file);
 
       xfree (temp_pathname);
 
@@ -300,13 +300,13 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
 			      need_dir_separator ? SLASH_STRING : "",
 			      in_pathname + 2, (char *) NULL);
 
-      result = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
-      if (file_location_is_valid (&result))
+      file = file_location_from_filename (temp_pathname, is_bfd, build_idsz, build_id);
+      if (file_location_is_valid (&file))
 	{
 	  do_cleanups (old_chain);
-	  return result;
+	  return file;
 	}
-      file_location_free (&result);
+      file_location_free (&file);
 
       xfree (temp_pathname);
     }
@@ -317,13 +317,13 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
 
   if (build_idsz != 0)
     {
-      result = build_id_to_file (build_idsz, build_id, "", is_bfd);
-      if (file_location_is_valid (&result))
+      file = build_id_to_file (build_idsz, build_id, "", is_bfd);
+      if (file_location_is_valid (&file))
 	{
 	  do_cleanups (old_chain);
-	  return result;
+	  return file;
 	}
-      file_location_free (&result);
+      file_location_free (&file);
     }
 
   /* If the search in gdb_sysroot failed, and the path name is
@@ -345,10 +345,10 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
      solib_search_path (if any).  */
   if (is_solib && solib_search_path != NULL)
     {
-      result = openp_result (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
-      if (file_location_is_valid (&result))
-	return result;
-      file_location_free (&result);
+      file = openp_file (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
+      if (file_location_is_valid (&file))
+	return file;
+      file_location_free (&file);
     }
 
   /* If not found, and we're looking for a solib, next search the
@@ -357,43 +357,43 @@ solib_find_3 (char *in_pathname, int is_bfd, int is_solib, const char *sysroot_o
      from the opened path.  */
   if (is_solib && solib_search_path != NULL)
     {
-      result = openp_result (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), target_lbasename (fskind, in_pathname), build_idsz, build_id);
-      if (file_location_is_valid (&result))
-	return result;
-      file_location_free (&result);
+      file = openp_file (solib_search_path, OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), target_lbasename (fskind, in_pathname), build_idsz, build_id);
+      if (file_location_is_valid (&file))
+	return file;
+      file_location_free (&file);
     }
 
   /* If not found, and we're looking for a solib, try to use target
      supplied solib search method.  */
   if (is_solib && ops->find_and_open_solib)
     {
-      result = ops->find_and_open_solib (in_pathname, build_idsz, build_id);
-      if (file_location_is_valid (&result))
-	return result;
-      file_location_free (&result);
+      file = ops->find_and_open_solib (in_pathname, build_idsz, build_id);
+      if (file_location_is_valid (&file))
+	return file;
+      file_location_free (&file);
     }
 
   /* If not found, next search the inferior's $PATH environment variable.  */
   if (strcmp (sysroot, "") == 0)
     {
-      result = openp_result (get_in_environ (current_inferior ()->environment, "PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
-      if (file_location_is_valid (&result))
-	return result;
-      file_location_free (&result);
+      file = openp_file (get_in_environ (current_inferior ()->environment, "PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
+      if (file_location_is_valid (&file))
+	return file;
+      file_location_free (&file);
     }
 
   /* If not found, and we're looking for a solib, next search the
      inferior's $LD_LIBRARY_PATH environment variable.  */
   if (is_solib && strcmp (sysroot, "") == 0)
     {
-      result = openp_result (get_in_environ (current_inferior ()->environment, "LD_LIBRARY_PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
-      if (file_location_is_valid (&result))
-	return result;
-      file_location_free (&result);
+      file = openp_file (get_in_environ (current_inferior ()->environment, "LD_LIBRARY_PATH"), OPF_TRY_CWD_FIRST | (is_bfd ? OPF_IS_BFD : 0), in_pathname, build_idsz, build_id);
+      if (file_location_is_valid (&file))
+	return file;
+      file_location_free (&file);
     }
 
-  file_location_init (&result);
-  return result;
+  file_location_init (&file);
+  return file;
 }
 
 static struct file_location
@@ -401,7 +401,7 @@ solib_find_2 (char *in_pathname, int is_bfd, int is_solib, size_t build_idsz, co
 {
   VEC (char_ptr) *sysroot_vec;
   struct cleanup *back_to;
-  struct file_location result;
+  struct file_location file;
   char *sysroot;
   int ix;
 
@@ -410,27 +410,27 @@ solib_find_2 (char *in_pathname, int is_bfd, int is_solib, size_t build_idsz, co
 
   for (ix = 0; VEC_iterate (char_ptr, sysroot_vec, ix, sysroot); ++ix)
     {
-      result = solib_find_3 (in_pathname, is_bfd, is_solib, sysroot, build_idsz, build_id);
-      if (file_location_is_valid (&result))
+      file = solib_find_3 (in_pathname, is_bfd, is_solib, sysroot, build_idsz, build_id);
+      if (file_location_is_valid (&file))
 	{
 	  do_cleanups (back_to);
-	  return result;
+	  return file;
 	}
-      file_location_free (&result);
+      file_location_free (&file);
     }
 
   do_cleanups (back_to);
-  return result;
+  return file;
 }
 
 static char *
 solib_find_1 (char *in_pathname, size_t build_idsz, const gdb_byte *build_id,
 	      int *fd, int is_solib)
 {
-  struct file_location result = solib_find_2 (in_pathname, 0 /* is_bfd */, is_solib, build_idsz, build_id);
+  struct file_location file = solib_find_2 (in_pathname, 0 /* is_bfd */, is_solib, build_idsz, build_id);
   char *retval;
 
-  if (!file_location_is_valid (&result))
+  if (!file_location_is_valid (&file))
     {
       retval = NULL;
       if (fd != NULL)
@@ -438,15 +438,15 @@ solib_find_1 (char *in_pathname, size_t build_idsz, const gdb_byte *build_id,
     }
   else
     {
-      retval = xstrdup (result.filename);
+      retval = xstrdup (file.filename);
       if (fd != NULL)
 	{
-	  gdb_assert (result.fd != -1);
-	  *fd = result.fd;
-	  result.fd = -1;
+	  gdb_assert (file.fd != -1);
+	  *fd = file.fd;
+	  file.fd = -1;
 	}
     }
-  file_location_free (&result);
+  file_location_free (&file);
   return retval;
 }
 
@@ -461,9 +461,9 @@ solib_find_1 (char *in_pathname, size_t build_idsz, const gdb_byte *build_id,
 char *
 exec_file_find (char *in_pathname, int *fd)
 {
-  char *result = solib_find_1 (in_pathname, 0 /* build_idsz */, NULL, fd, 0 /* is_solib */);
+  char *file = solib_find_1 (in_pathname, 0 /* build_idsz */, NULL /* build_id */, fd, 0 /* is_solib */);
 
-  if (result == NULL)
+  if (file == NULL)
     {
       const char *fskind = effective_target_file_system_kind ();
 
@@ -475,11 +475,11 @@ exec_file_find (char *in_pathname, int *fd)
 	  strcpy (new_pathname, in_pathname);
 	  strcat (new_pathname, ".exe");
 
-	  result = solib_find_1 (new_pathname, 0 /* build_idsz */, NULL, fd, 0 /* is_solib */);
+	  file = solib_find_1 (new_pathname, 0 /* build_idsz */, NULL, fd, 0 /* is_solib */);
 	}
     }
 
-  return result;
+  return file;
 }
 
 /* Return the full pathname of a shared library file, or NULL if not
diff --git a/gdb/source.c b/gdb/source.c
index 3894bd6..6fdf571 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -738,53 +738,53 @@ dirnames_to_char_ptr_vec_target_exc (const char *string)
 }
 
 void
-file_location_init (struct file_location *result)
+file_location_init (struct file_location *file)
 {
-  memset (result, 0, sizeof (*result));
-  result->fd = -1;
+  memset (file, 0, sizeof (*file));
+  file->fd = -1;
 }
 
 void
-file_location_free (struct file_location *result)
+file_location_free (struct file_location *file)
 {
-  if (result->fd != -1)
+  if (file->fd != -1)
     {
-      if (is_target_filename (result->filename))
+      if (is_target_filename (file->filename))
 	{
 	  int target_errno;
 
-	  target_fileio_close (result->fd, &target_errno);
+	  target_fileio_close (file->fd, &target_errno);
 	}
       else
-	close (result->fd);
+	close (file->fd);
     }
-  gdb_bfd_unref (result->abfd);
-  xfree (result->filename);
+  gdb_bfd_unref (file->abfd);
+  xfree (file->filename);
 }
 
 static void
-file_location_cleanup (void *result_voidp)
+file_location_cleanup (void *file_voidp)
 {
-  file_location_free (result_voidp);
+  file_location_free (file_voidp);
 }
 
 int
-file_location_is_valid (const struct file_location *result)
+file_location_is_valid (const struct file_location *file)
 {
-  return result->abfd != NULL || result->filename != NULL;
+  return file->abfd != NULL || file->filename != NULL;
 }
 
 struct file_location
 file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz, const gdb_byte *build_id)
 {
-  struct file_location result;
+  struct file_location file;
   int load_via_target = 0;
   int fd_dup = -1;
   struct cleanup *back_to, *fd_dup_cleanup;
 
-  file_location_init (&result);
-  back_to = make_cleanup (file_location_cleanup, &result);
-  result.filename = xstrdup (filename);
+  file_location_init (&file);
+  back_to = make_cleanup (file_location_cleanup, &file);
+  file.filename = xstrdup (filename);
 
   if (is_target_filename (filename))
     {
@@ -806,52 +806,52 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
     {
       int target_errno;
 
-      result.fd = target_fileio_open (current_inferior (),
+      file.fd = target_fileio_open (current_inferior (),
 				      filename, FILEIO_O_RDONLY, 0,
 				      &target_errno);
-      if (result.fd == -1)
+      if (file.fd == -1)
 	{
-	  result.file_errno = fileio_errno_to_host (target_errno);
+	  file.file_errno = fileio_errno_to_host (target_errno);
 	  discard_cleanups (back_to);
-	  return result;
+	  return file;
 	}
     }
   else
     {
       /* WRITE_FILES is ignored if !IS_BFD.  */
 
-      result.fd = gdb_open_cloexec (filename, O_RDONLY | O_BINARY, 0);
-      if (result.fd == -1)
+      file.fd = gdb_open_cloexec (filename, O_RDONLY | O_BINARY, 0);
+      if (file.fd == -1)
 	{
-	  result.file_errno = errno;
+	  file.file_errno = errno;
 	  discard_cleanups (back_to);
-	  return result;
+	  return file;
 	}
     }
 
   if (build_idsz == 0 && !is_bfd)
     {
       discard_cleanups (back_to);
-      return result;
+      return file;
     }
 
   fd_dup_cleanup = make_cleanup (null_cleanup, NULL);
   if (!is_bfd)
     {
-      fd_dup = dup (result.fd);
+      fd_dup = dup (file.fd);
       if (fd_dup == -1)
 	{
-	  result.file_errno = errno;
-	  close (result.fd);
-	  result.fd = -1;
+	  file.file_errno = errno;
+	  close (file.fd);
+	  file.fd = -1;
 	  discard_cleanups (back_to);
-	  return result;
+	  return file;
 	}
       make_cleanup_close (fd_dup);
     }
 
   if (write_files && !load_via_target)
-    result.abfd = gdb_bfd_fopen (filename, gnutarget, FOPEN_RUB, result.fd);
+    file.abfd = gdb_bfd_fopen (filename, gnutarget, FOPEN_RUB, file.fd);
   else
     {
       char *canonical;
@@ -864,16 +864,16 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
       else
 	canonical = gdb_realpath (filename);
       canonical_cleanup = make_cleanup (xfree, canonical);
-      result.abfd = gdb_bfd_open (canonical, gnutarget, result.fd);
+      file.abfd = gdb_bfd_open (canonical, gnutarget, file.fd);
       do_cleanups (canonical_cleanup);
     }
-  result.fd = -1;
-  if (result.abfd == NULL)
+  file.fd = -1;
+  if (file.abfd == NULL)
     {
-      result.bfderr = bfd_get_error ();
+      file.bfderr = bfd_get_error ();
       do_cleanups (fd_dup_cleanup);
       discard_cleanups (back_to);
-      return result;
+      return file;
     }
 
   if (build_idsz == 0)
@@ -881,72 +881,83 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
       gdb_assert (is_bfd);
       gdb_assert (fd_dup == -1);
       discard_cleanups (back_to);
-      return result;
+      return file;
     }
 
-  if (!build_id_verify (result.abfd, build_idsz, build_id))
+  if (!build_id_verify (file.abfd, build_idsz, build_id))
     {
       do_cleanups (back_to);
-      file_location_init (&result);
-      return result;
+      file_location_init (&file);
+      return file;
     }
 
   gdb_assert (!is_bfd == (fd_dup != -1));
   if (!is_bfd)
     {
-      gdb_bfd_unref (result.abfd);
-      result.abfd = NULL;
-      gdb_assert (result.fd == -1);
-      result.fd = fd_dup;
-      gdb_assert (result.fd != -1);
+      gdb_bfd_unref (file.abfd);
+      file.abfd = NULL;
+      gdb_assert (file.fd == -1);
+      file.fd = fd_dup;
+      gdb_assert (file.fd != -1);
     }
 
   discard_cleanups (back_to);
-  return result;
+  return file;
+}
+
+bfd *
+file_location_to_bfd (struct file_location file)


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [SCM]  jankratochvil/gdbserverbuildid2: buildidwarn
@ 2015-07-30 21:15 jkratoch
  0 siblings, 0 replies; 3+ messages in thread
From: jkratoch @ 2015-07-30 21:15 UTC (permalink / raw)
  To: archer-commits

The branch, jankratochvil/gdbserverbuildid2 has been updated
  discards  45d37a2219f903f60c90320bd2413c21c3fe869d (commit)
  discards  1f03224f89445002273becf43bc2fe64936f4671 (commit)
  discards  9798e192499c9161e7061fce9cde90dd89b3da18 (commit)
  discards  32254f93ab5c6271456b689dcd16fdad0cc2129d (commit)
  discards  cf02f297ca1c72089dc6cbcd6557d0a68757127d (commit)
  discards  9673d0d64e72e2dbc7455d3700bf3793c8bf104c (commit)
  discards  0d4cc1d76b5a4c7f472a998a71f50f87f8371955 (commit)
  discards  62757e6e09df9aaa5a6b5c5681e71ce1ebd67a91 (commit)
       via  d91ac3ceb0adddb1ba5aaab06699fd2af3b45ca8 (commit)
       via  168149db3b7cde9b94d5f22766fad29fd042cfd6 (commit)
       via  4e408474626b408a8704039e634043a2678f86fa (commit)
       via  6bcded095e565a9ab4e3a3e63b13303e7f14782a (commit)
       via  fe1b7ec8c97bf675e57165603468335cd14c4e4c (commit)
       via  f637f94da2f0e92a68c04ef40688409bfa1d0246 (commit)
       via  8251d735d186180ceb82b1bb98c65158a4e7c749 (commit)
       via  bc787422c4a3e3b05d6b17cc804176822550559f (commit)
       via  fffe8a3466e5b18eefc70a35e881a26510cac2d5 (commit)
      from  45d37a2219f903f60c90320bd2413c21c3fe869d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit d91ac3ceb0adddb1ba5aaab06699fd2af3b45ca8
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:49:10 2015 +0200

    buildidwarn

commit 168149db3b7cde9b94d5f22766fad29fd042cfd6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:50 2015 +0200

    locatetest

commit 4e408474626b408a8704039e634043a2678f86fa
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:48:14 2015 +0200

    mainbuildid

commit 6bcded095e565a9ab4e3a3e63b13303e7f14782a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 20:31:46 2015 +0200

    hexallocate

commit fe1b7ec8c97bf675e57165603468335cd14c4e4c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:13:31 2015 +0200

    buildid

commit f637f94da2f0e92a68c04ef40688409bfa1d0246
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Jul 28 22:12:52 2015 +0200

    buildidproto

commit 8251d735d186180ceb82b1bb98c65158a4e7c749
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 21:38:45 2015 +0200

    buildidtobfd

commit bc787422c4a3e3b05d6b17cc804176822550559f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Jul 29 19:52:47 2015 +0200

    buildidforcemove

commit fffe8a3466e5b18eefc70a35e881a26510cac2d5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Jul 30 23:07:10 2015 +0200

    buildidfreefix

-----------------------------------------------------------------------

Summary of changes:
 gdb/build-id.c |    6 ++++--
 gdb/source.c   |    4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

First 500 lines of diff:
diff --git a/gdb/build-id.c b/gdb/build-id.c
index f3948bf..95ddcc6 100644
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
@@ -66,6 +66,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
 {
   const struct bfd_build_id *found = build_id_bfd_get (abfd);
   char *message, *check_hex = alloca (check_len * 2 + 1);
+  struct cleanup *back_to;
 
   bin2hex (check, check_hex, check_len);
 
@@ -85,19 +86,20 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
     }
   else
     return 1;
+  back_to = make_cleanup (xfree, message);
 
   if (validate_build_id)
     {
       warning (_("Symbol file \"%s\" could not be validated (%s) and "
 		 "will be ignored; or use 'set build-id-force'."),
 	       bfd_get_filename (abfd), message);
-      xfree (message);
+      do_cleanups (back_to);
       return 0;
     }
   warning (_("Symbol file \"%s\" could not be validated (%s) "
 	     "but it is being loaded due to 'set build-id-force'."),
 	   bfd_get_filename (abfd), message);
-  xfree (message);
+  do_cleanups (back_to);
   return 1;
 }
 
diff --git a/gdb/source.c b/gdb/source.c
index 297c2f3..3894bd6 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -829,7 +829,7 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
 	}
     }
 
-  if ((build_idsz == 0 || !validate_build_id) && !is_bfd)
+  if (build_idsz == 0 && !is_bfd)
     {
       discard_cleanups (back_to);
       return result;
@@ -876,7 +876,7 @@ file_location_from_filename (const char *filename, int is_bfd, size_t build_idsz
       return result;
     }
 
-  if (build_idsz == 0 || !validate_build_id)
+  if (build_idsz == 0)
     {
       gdb_assert (is_bfd);
       gdb_assert (fd_dup == -1);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-31 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-31 20:27 [SCM] jankratochvil/gdbserverbuildid2: buildidwarn jkratoch
  -- strict thread matches above, loose matches on Subject: below --
2015-07-31 19:17 jkratoch
2015-07-30 21:15 jkratoch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).