public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-autoload: Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal
Date: Tue, 20 Mar 2012 19:38:00 -0000	[thread overview]
Message-ID: <20120320193848.31164.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-autoload has been updated
       via  736b9ee51145c64688d9f3dac2543c1e8272f08f (commit)
       via  bdc60070df4dc698571f249e0bea13fcad7d0fac (commit)
       via  d23d429e38d977518885a81e4376b3622726602c (commit)
       via  a3bca522660c1b7870afc9282df4396e7c022a4c (commit)
       via  f4fa3824f25e10021eed07c6f3bab2dfcc7ee449 (commit)
       via  aa5b65291f77dbb179f3a245340205102ea9cb64 (commit)
       via  482eed1f7f5d4768483a4250be97f6ee78aebddc (commit)
       via  8244d71bb869d8c138457361a04c81b07c3d60b2 (commit)
       via  1ff532be9341f8d4575dbbe662204e41e5446f12 (commit)
       via  c72d611900240fad4eb6a107bbe4a0b4270d4064 (commit)
       via  c6755f61cbcde555281e03c5257d23e1025fed0b (commit)
       via  2289e5bb9d71aed51196c8b239dc9c754a87ee47 (commit)
       via  515bd38396f6ec31a66bba44006ea1e7a2b61534 (commit)
       via  83f513258367be4c9e7278d0a1d6995549a13a3c (commit)
       via  de533a0da5e3381bffa209c9fa51253c5c4ee7fa (commit)
       via  a25d96b4631ba05f40a32a8ff07b349abdc8a3ec (commit)
       via  0d4166c955ad30c03dac9ab530b887aab8b3f6e0 (commit)
       via  4451fa0b228cbefdd60a3d4784c4c84960537187 (commit)
       via  554d44969be25884d0bd2ecdec24a94b40982f72 (commit)
       via  5e8d32fe5e1fc7c2e6d64371285e3d405bf3c7a9 (commit)
       via  331aff935651306ad020b31817106ea6e4ab9f6a (commit)
       via  fea8d94135a1a239af9fa3171ec339886f43edbd (commit)
       via  f9b226071c6212219e88c3eb2617ffdda3a8750d (commit)
       via  7039331b2cd618a3517eb656508d95a33aefc9be (commit)
       via  809b3e1b3548747d1f2e533df647889fa131e0cf (commit)
       via  90b8e4d560f853cd91f97d778df4ff367c2c3e3a (commit)
       via  e9c2841c2ea47fc7dda04d7e107e095bcd1698e2 (commit)
       via  a653dea6799b8e39d42cb7e133541a69e30cb238 (commit)
       via  9faa4a2a8ed056f9d999a7f0559e8e581e5a0bbc (commit)
      from  0a287816462ac6b27bb8a6d0d7a5ae5d6455932c (commit)

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

- Log -----------------------------------------------------------------
commit 736b9ee51145c64688d9f3dac2543c1e8272f08f
Merge: a3bca52 bdc6007
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:36:10 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal

commit bdc60070df4dc698571f249e0bea13fcad7d0fac
Merge: f4fa382 d23d429
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:35:42 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath' into secmove-misc2-warn-safepath-debug
    
    Conflicts:
    	gdb/auto-load.c

commit d23d429e38d977518885a81e4376b3622726602c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:35:01 2012 +0100

    .

commit a3bca522660c1b7870afc9282df4396e7c022a4c
Merge: 8244d71 f4fa382
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:33:11 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal

commit f4fa3824f25e10021eed07c6f3bab2dfcc7ee449
Merge: 1ff532b aa5b652
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:33:11 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath' into secmove-misc2-warn-safepath-debug

commit aa5b65291f77dbb179f3a245340205102ea9cb64
Merge: c72d611 482eed1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:33:11 2012 +0100

    Merge branch 'secmove-misc2-warn' into secmove-misc2-warn-safepath

commit 482eed1f7f5d4768483a4250be97f6ee78aebddc
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:33:08 2012 +0100

    .

commit 8244d71bb869d8c138457361a04c81b07c3d60b2
Merge: 515bd38 1ff532b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:32:23 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal

commit 1ff532be9341f8d4575dbbe662204e41e5446f12
Merge: 83f5132 c72d611
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:32:19 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath' into secmove-misc2-warn-safepath-debug
    
    Conflicts:
    	gdb/auto-load.c
    	gdb/main.c

commit c72d611900240fad4eb6a107bbe4a0b4270d4064
Merge: de533a0 c6755f6
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:29:25 2012 +0100

    Merge branch 'secmove-misc2-warn' into secmove-misc2-warn-safepath
    
    Conflicts:
    	gdb/auto-load.c
    	gdb/main.c

commit c6755f61cbcde555281e03c5257d23e1025fed0b
Merge: a25d96b 2289e5b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 20:15:49 2012 +0100

    Merge branch 'secmove-misc2' into secmove-misc2-warn
    
    Conflicts:
    	gdb/auto-load.c
    	gdb/auto-load.h
    	gdb/main.c

commit 2289e5bb9d71aed51196c8b239dc9c754a87ee47
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:56:23 2012 +0100

    .

commit 515bd38396f6ec31a66bba44006ea1e7a2b61534
Merge: fea8d94 83f5132
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:32:27 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal

commit 83f513258367be4c9e7278d0a1d6995549a13a3c
Merge: f9b2260 de533a0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:32:26 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath' into secmove-misc2-warn-safepath-debug

commit de533a0da5e3381bffa209c9fa51253c5c4ee7fa
Merge: 4451fa0 a25d96b
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:32:26 2012 +0100

    Merge branch 'secmove-misc2-warn' into secmove-misc2-warn-safepath

commit a25d96b4631ba05f40a32a8ff07b349abdc8a3ec
Merge: 554d449 0d4166c
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:32:26 2012 +0100

    Merge branch 'secmove-misc2' into secmove-misc2-warn

commit 0d4166c955ad30c03dac9ab530b887aab8b3f6e0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 19:28:30 2012 +0100

    .

commit 4451fa0b228cbefdd60a3d4784c4c84960537187
Merge: 7039331 554d449
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 17:45:08 2012 +0100

    Merge branch 'secmove-misc2-warn' into secmove-misc2-warn-safepath

commit 554d44969be25884d0bd2ecdec24a94b40982f72
Merge: 809b3e1 5e8d32f
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 17:45:08 2012 +0100

    Merge branch 'secmove-misc2' into secmove-misc2-warn

commit 5e8d32fe5e1fc7c2e6d64371285e3d405bf3c7a9
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 17:45:00 2012 +0100

    .

commit 331aff935651306ad020b31817106ea6e4ab9f6a
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 12:04:44 2012 +0100

    .

commit fea8d94135a1a239af9fa3171ec339886f43edbd
Merge: 0a28781 f9b2260
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:22 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath-debug' into secmove-misc2-warn-safepath-debug-warnlocal

commit f9b226071c6212219e88c3eb2617ffdda3a8750d
Merge: 9a53ca2 7039331
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:22 2012 +0100

    Merge branch 'secmove-misc2-warn-safepath' into secmove-misc2-warn-safepath-debug

commit 7039331b2cd618a3517eb656508d95a33aefc9be
Merge: 2cfb45d 809b3e1
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:21 2012 +0100

    Merge branch 'secmove-misc2-warn' into secmove-misc2-warn-safepath

commit 809b3e1b3548747d1f2e533df647889fa131e0cf
Merge: 321c08a 90b8e4d
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:21 2012 +0100

    Merge branch 'secmove-misc2' into secmove-misc2-warn

commit 90b8e4d560f853cd91f97d778df4ff367c2c3e3a
Merge: 42660c6 e9c2841
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:21 2012 +0100

    Merge branch 'secmove' into secmove-misc2

commit e9c2841c2ea47fc7dda04d7e107e095bcd1698e2
Merge: 61db129 a653dea
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Mar 20 08:37:21 2012 +0100

    Merge remote-tracking branch 'gdb/master' into secmove

commit a653dea6799b8e39d42cb7e133541a69e30cb238
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Tue Mar 20 00:00:03 2012 +0000

    *** empty log message ***

commit 9faa4a2a8ed056f9d999a7f0559e8e581e5a0bbc
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Mon Mar 19 23:00:05 2012 +0000

    daily update

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

Summary of changes:
 bfd/version.h         |    2 +-
 gdb/auto-load.c       |   36 ++++++++++--
 gdb/auto-load.h       |    2 +
 gdb/linux-thread-db.c |  155 +++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/main.c            |  100 ++++++++++++++++++--------------
 gdb/version.in        |    2 +-
 6 files changed, 246 insertions(+), 51 deletions(-)

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index 241c6fe..756abca 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20120319
+#define BFD_VERSION_DATE 20120320
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
 #define REPORT_BUGS_TO @report_bugs_to@
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 0348b44..c1e04c5 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -111,6 +111,12 @@ static const char *const auto_load_local_gdbinit_enum[] =
 /* Auto-load .gdbinit file from the current directory?  */
 const char *auto_load_local_gdbinit = auto_load_local_gdbinit_warn_and_yes;
 
+/* Absolute pathname to the current directory .gdbinit, if it exists.  */
+char *auto_load_local_gdbinit_pathname = NULL;
+
+/* Boolean value if AUTO_LOAD_LOCAL_GDBINIT_PATHNAME has been loaded.  */
+int auto_load_local_gdbinit_loaded = 0;
+
 /* "show" command for the auto_load_local_gdbinit configuration variable.  */
 
 static void
@@ -769,6 +775,21 @@ info_auto_load_gdb_scripts (char *pattern, int from_tty)
   auto_load_info_scripts (pattern, from_tty, &script_language_gdb);
 }
 
+/* Implement 'info auto-load local-gdbinit'.  */
+
+static void
+info_auto_load_local_gdbinit (char *args, int from_tty)
+{
+  if (auto_load_local_gdbinit_pathname == NULL)
+    printf_filtered (_("Local .gdbinit file was not found.\n"));
+  else if (auto_load_local_gdbinit_loaded)
+    printf_filtered (_("Local .gdbinit file \"%s\" has been loaded.\n"),
+		     auto_load_local_gdbinit_pathname);
+  else
+    printf_filtered (_("Local .gdbinit file \"%s\" has not been loaded.\n"),
+		     auto_load_local_gdbinit_pathname);
+}
+
 /* Return non-zero if SCRIPT_NOT_FOUND_WARNING_PRINTED of PSPACE_INFO was unset
    before calling this function.  Always set SCRIPT_NOT_FOUND_WARNING_PRINTED
    of PSPACE_INFO.  */
@@ -906,6 +927,11 @@ This options has security implications for untrusted inferiors."),
 			   auto_load_set_cmdlist_get (),
 			   auto_load_show_cmdlist_get ());
 
+  add_cmd ("gdb-scripts", class_info, info_auto_load_gdb_scripts,
+	   _("Print the list of automatically loaded sequences of commands.\n\
+Usage: info auto-load gdb-scripts [REGEXP]"),
+	   auto_load_info_cmdlist_get ());
+
   add_setshow_enum_cmd ("local-gdbinit", class_support,
 			auto_load_local_gdbinit_enum,
 			&auto_load_local_gdbinit, _("\
@@ -919,6 +945,11 @@ This options has security implications for untrusted inferiors."),
 			auto_load_set_cmdlist_get (),
 			auto_load_show_cmdlist_get ());
 
+  add_cmd ("local-gdbinit", class_info, info_auto_load_local_gdbinit,
+	   _("Print whether current directory .gdbinit file has been loaded.\n\
+Usage: info auto-load local-gdbinit"),
+	   auto_load_info_cmdlist_get ());
+
   auto_load_safe_path = xstrdup (DEFAULT_AUTO_LOAD_SAFE_PATH);
   auto_load_safe_path_vec_update ();
   add_setshow_optional_filename_cmd ("safe-path", class_support,
@@ -944,9 +975,4 @@ When non-zero, debugging output for files of 'set auto-load ...'\n\
 is displayed."),
 			    NULL, show_debug_auto_load,
 			    &setdebuglist, &showdebuglist);
-
-  add_cmd ("gdb-scripts", class_info, info_auto_load_gdb_scripts,
-	   _("Print the list of automatically loaded sequences of commands.\n\
-Usage: info auto-load gdb-scripts [REGEXP]"),
-	   auto_load_info_cmdlist_get ());
 }
diff --git a/gdb/auto-load.h b/gdb/auto-load.h
index 1ec9a1d..fe8b146 100644
--- a/gdb/auto-load.h
+++ b/gdb/auto-load.h
@@ -37,6 +37,8 @@ extern const char auto_load_local_gdbinit_no[];
 extern const char auto_load_local_gdbinit_warn_and_yes[];
 extern const char auto_load_local_gdbinit_warn_and_no[];
 extern const char *auto_load_local_gdbinit;
+extern char *auto_load_local_gdbinit_pathname;
+extern int auto_load_local_gdbinit_loaded;
 
 extern struct auto_load_pspace_info *
   get_auto_load_pspace_data_for_loading (struct program_space *pspace);
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index d0ae6b0..8902b67 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -44,6 +44,7 @@
 #include "auto-load.h"
 
 #include <signal.h>
+#include <ctype.h>
 
 #ifdef HAVE_GNU_LIBC_VERSION_H
 #include <gnu/libc-version.h>
@@ -136,6 +137,10 @@ struct thread_db_info
   /* Handle from dlopen for libthread_db.so.  */
   void *handle;
 
+  /* Absolute pathname from gdb_realpath to disk file used for dlopen-ing
+     HANDLE.  It may be NULL for system library.  */
+  char *filename;
+
   /* Structure that identifies the child process for the
      <proc_service.h> interface.  */
   struct ps_prochandle proc_handle;
@@ -265,6 +270,8 @@ delete_thread_db_info (int pid)
   if (info->handle != NULL)
     dlclose (info->handle);
 
+  xfree (info->filename);
+
   if (info_prev)
     info_prev->next = info->next;
   else
@@ -824,6 +831,10 @@ try_thread_db_load (const char *library)
 
   info = add_thread_db_info (handle);
 
+  /* Do not save system library name, that one is always trusted.  */
+  if (strchr (library, '/') != NULL)
+    info->filename = gdb_realpath (library);
+
   if (try_thread_db_load_1 (info))
     return 1;
 
@@ -1836,6 +1847,145 @@ thread_db_resume (struct target_ops *ops,
   beneath->to_resume (beneath, ptid, step, signo);
 }
 
+/* qsort helper function for info_auto_load_libthread_db, sort the
+   thread_db_info pointers primarily by their FILENAME and secondarily by their
+   PID, both in ascending order.  */
+
+static int
+info_auto_load_libthread_db_compare (const void *ap, const void *bp)
+{
+  struct thread_db_info *a = *(struct thread_db_info **) ap;
+  struct thread_db_info *b = *(struct thread_db_info **) bp;
+  int retval;
+
+  retval = strcmp (a->filename, b->filename);
+  if (retval)
+    return retval;
+
+  return (a->pid > b->pid) - (a->pid - b->pid);
+}
+
+/* Implement 'info auto-load libthread-db'.  */
+
+static void
+info_auto_load_libthread_db (char *args, int from_tty)
+{
+  struct ui_out *uiout = current_uiout;
+  const char *cs = args ? args : "";
+  struct thread_db_info *info, **array;
+  unsigned info_count, unique_filenames;
+  size_t max_filename_len, max_pids_len, pids_len;
+  struct cleanup *back_to;
+  char *pids;
+  int i;
+
+  while (isspace (*cs))
+    cs++;
+  if (*cs)
+    error (_("'info auto-load libthread-db' does not accept any parameters"));
+
+  info_count = 0;
+  for (info = thread_db_list; info; info = info->next)
+    if (info->filename != NULL)
+      info_count++;
+
+  array = xmalloc (sizeof (*array) * info_count);
+  back_to = make_cleanup (xfree, array);
+
+  info_count = 0;
+  for (info = thread_db_list; info; info = info->next)
+    if (info->filename != NULL)
+      array[info_count++] = info;
+
+  /* Sort ARRAY by filenames and PIDs.  */
+
+  qsort (array, info_count, sizeof (*array),
+	 info_auto_load_libthread_db_compare);
+
+  /* Calculate the number of unique filenames (rows) and the maximum string
+     length of PIDs list for the unique filenames (columns).  */
+
+  unique_filenames = 0;
+  max_filename_len = 0;
+  max_pids_len = 0;
+  pids_len = 0;
+  for (i = 0; i < info_count; i++)
+    {
+      int pid = array[i]->pid;
+      size_t this_pid_len;
+
+      for (this_pid_len = 0; pid != 0; pid /= 10)
+	this_pid_len++;
+
+      if (i == 0 || strcmp (array[i - 1]->filename, array[i]->filename) != 0)
+	{
+	  unique_filenames++;
+	  max_filename_len = max (max_filename_len,
+				  strlen (array[i]->filename));
+
+	  if (i > 0)
+	    {
+	      pids_len -= strlen (", ");
+	      max_pids_len = max (max_pids_len, pids_len);
+	    }
+	  pids_len = 0;
+	}
+      pids_len += this_pid_len + strlen (", ");
+    }
+  if (i)
+    {
+      pids_len -= strlen (", ");
+      max_pids_len = max (max_pids_len, pids_len);
+    }
+
+  make_cleanup_ui_out_table_begin_end (uiout, 2, unique_filenames,
+				       "LinuxThreadDbTable");
+
+  ui_out_table_header (uiout, max_filename_len, ui_left, "filename",
+		       "Filename");
+  ui_out_table_header (uiout, pids_len, ui_left, "PIDs", "Pids");
+  ui_out_table_body (uiout);
+
+  pids = xmalloc (max_pids_len + 1);
+  make_cleanup (xfree, pids);
+
+  /* Note I is incremented inside the cycle, not at its end.  */
+  for (i = 0; i < info_count;)
+    {
+      struct cleanup *chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
+      char *pids_end;
+
+      info = array[i];
+      ui_out_field_string (uiout, "filename", info->filename);
+      pids_end = pids;
+
+      while (i < info_count && strcmp (info->filename, array[i]->filename) == 0)
+	{
+	  if (pids_end != pids)
+	    {
+	      *pids_end++ = ',';
+	      *pids_end++ = ' ';
+	    }
+	  pids_end += xsnprintf (pids_end, &pids[max_pids_len + 1] - pids_end,
+				 "%u", array[i]->pid);
+	  gdb_assert (pids_end < &pids[max_pids_len + 1]);
+
+	  i++;
+	}
+      *pids_end = '\0';
+
+      ui_out_field_string (uiout, "pids", pids);
+
+      ui_out_text (uiout, "\n");
+      do_cleanups (chain);
+    }
+
+  do_cleanups (back_to);
+
+  if (info_count == 0)
+    ui_out_message (uiout, 0, _("No auto-loaded libthread-db.\n"));
+}
+
 static void
 init_thread_db_ops (void)
 {
@@ -1909,6 +2059,11 @@ This options has security implications for untrusted inferiors."),
 			   auto_load_set_cmdlist_get (),
 			   auto_load_show_cmdlist_get ());
 
+  add_cmd ("libthread-db", class_info, info_auto_load_libthread_db,
+	   _("Print the list of loaded inferior specific libthread_db.\n\
+Usage: info auto-load libthread-db"),
+	   auto_load_info_cmdlist_get ());
+
   /* Add ourselves to objfile event chain.  */
   observer_attach_new_objfile (thread_db_new_objfile);
 
diff --git a/gdb/main.c b/gdb/main.c
index 72ccbae..521aca4 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -947,59 +947,71 @@ captured_main (void *data)
 
   /* Read the .gdbinit file in the current directory, *if* it isn't
      the same as the $HOME/.gdbinit file (it should exist, also).  */
-  if (local_gdbinit && !inhibit_gdbinit
-      && auto_load_local_gdbinit != auto_load_local_gdbinit_no)
+  if (local_gdbinit)
     {
-      /* Verify whether user has already specified `-x ./.gdbinit'.  */
-      for (i = 0; VEC_iterate (cmdarg_s, cmdarg_vec, i, cmdarg_p); i++)
-	if (cmdarg_p->type == CMDARG_FILE)
-	  {
-	    struct cleanup *old_cleanups;
-	    char *file;
-	    int fd;
+      auto_load_local_gdbinit_pathname = gdb_realpath (local_gdbinit);
+
+      if (!inhibit_gdbinit
+	  && auto_load_local_gdbinit != auto_load_local_gdbinit_no)
+	{
+	  /* Verify whether user has already specified `-x ./.gdbinit'.  */
+	  for (i = 0; VEC_iterate (cmdarg_s, cmdarg_vec, i, cmdarg_p); i++)
+	    if (cmdarg_p->type == CMDARG_FILE)
+	      {
+		struct cleanup *old_cleanups;
+		char *file;
+		int fd;
 
-	    file = tilde_expand (cmdarg_p->string);
-	    old_cleanups = make_cleanup (xfree, file);
+		file = tilde_expand (cmdarg_p->string);
+		old_cleanups = make_cleanup (xfree, file);
 
-	    fd = openp (source_path, OPF_TRY_CWD_FIRST, file, O_RDONLY, NULL);
+		fd = openp (source_path, OPF_TRY_CWD_FIRST, file, O_RDONLY,
+			    NULL);
 
-	    do_cleanups (old_cleanups);
+		do_cleanups (old_cleanups);
 
-	    if (fd != -1)
-	      {
-		struct stat statbuf;
+		if (fd != -1)
+		  {
+		    struct stat statbuf;
 
-		if (fstat (fd, &statbuf) == 0
-		    && memcmp (&statbuf, &local_gdbinit_stat,
-			       sizeof (statbuf)) == 0)
-		  local_gdbinit = NULL;
+		    if (fstat (fd, &statbuf) == 0
+			&& memcmp (&statbuf, &local_gdbinit_stat,
+				   sizeof (statbuf)) == 0)
+		      local_gdbinit = NULL;
 
-		close (fd);
-		if (local_gdbinit == NULL)
-		  break;
+		    close (fd);
+		    if (local_gdbinit == NULL)
+		      break;
+		  }
 	      }
-	  }
 
-      if (local_gdbinit)
-	{
-	  const char adv[] = N_("Use script associated with inferior "
-	                        "executable file instead.  "
-			        "See also 'set auto-load local-gdbinit'.  "
-			        "You may also use 'gdb -x .gdbinit ...'.");
-	  if (auto_load_local_gdbinit == auto_load_local_gdbinit_warn_and_yes)
-	    warning (_("Reading file .gdbinit in current directory but it has "
-		       "been deprecated and the reading will be removed.  %s"),
-		     _(adv));
-	  if (auto_load_local_gdbinit == auto_load_local_gdbinit_warn_and_no)
-	    warning (_("Ignoring file .gdbinit in current directory as it has "
-		       "been deprecated.  %s"),
-		     _(adv));
-	  else if (file_is_auto_load_safe (local_gdbinit,
-	                                   _("auto-load: Loading .gdbinit "
-					     "file \"%s\".\n"),
-					   local_gdbinit))
-	    catch_command_errors (source_script, local_gdbinit, 0,
-				  RETURN_MASK_ALL);
+	  if (local_gdbinit)
+	    {
+	      const char adv[] = N_("Use script associated with inferior "
+				    "executable file instead.  "
+				    "See also 'set auto-load local-gdbinit'.  "
+				    "You may also use 'gdb -x .gdbinit ...'.");
+	      if (auto_load_local_gdbinit
+		  == auto_load_local_gdbinit_warn_and_yes)
+		warning (_("Reading file .gdbinit in current directory but it "
+			   "has been deprecated and the reading will be "
+			   "removed.  %s"),
+			 _(adv));
+	      if (auto_load_local_gdbinit
+		  == auto_load_local_gdbinit_warn_and_no)
+		warning (_("Ignoring file .gdbinit in current directory as it "
+			   "has been deprecated.  %s"),
+			 _(adv));
+	      else if (file_is_auto_load_safe (local_gdbinit,
+					       _("auto-load: Loading .gdbinit "
+						 "file \"%s\".\n"),
+					       local_gdbinit))
+		{
+		  auto_load_local_gdbinit_loaded = 1;
+		  catch_command_errors (source_script, local_gdbinit, 0,
+					RETURN_MASK_ALL);
+		}
+	    }
 	}
     }
 
diff --git a/gdb/version.in b/gdb/version.in
index cad4a9f..426799f 100644
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
-7.4.50.20120319-cvs
+7.4.50.20120320-cvs


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


             reply	other threads:[~2012-03-20 19:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 19:38 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-29  8:50 jkratoch
2012-03-29  6:21 jkratoch
2012-03-29  6:17 jkratoch
2012-03-29  6:07 jkratoch
2012-03-29  5:45 jkratoch
2012-03-28 20:31 jkratoch
2012-03-25 19:10 jkratoch
2012-03-25 19:02 jkratoch
2012-03-25 16:56 jkratoch
2012-03-24 17:25 jkratoch
2012-03-24  9:09 jkratoch
2012-03-20 19:39 jkratoch
2012-03-20  0:17 jkratoch
2012-03-19 20:15 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120320193848.31164.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).