public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master:  * remote.c (remote_start_remote): If the solib list is global,
@ 2008-11-03 14:58 sergio
  0 siblings, 0 replies; only message in thread
From: sergio @ 2008-11-03 14:58 UTC (permalink / raw)
  To: archer-commits

The branch, master has been updated
       via  480ca0913232c5c52b37ac7ff50abf5ee7895bd2 (commit)
       via  515afdac7e61a625f6e0ba5226f0715505e481b8 (commit)
       via  89eca930aaace2d480f54c5f3e869ff2624698b1 (commit)
       via  c6b062b5084e742c0025709cb36fd37c5ed289ce (commit)
       via  963e74e9c8a9e7fc1cab46cba4d3d31e76dc28c3 (commit)
       via  e4d9340860eacbc32aaf2ff843e78b476b8f7e56 (commit)
       via  b7be1687bdea4de11a15f24417984b93ebf7e096 (commit)
       via  8715d7c3f720715d0b03372bb2253f4881130f14 (commit)
       via  8207ea2c71c0d5bd82e51f1b341a6fd10256e554 (commit)
       via  ff29e7969a2f50c9744825e27ffa27ec1c698c65 (commit)
       via  d00c4b5901022165d41558db527ec3bd4af93082 (commit)
       via  0313d50ba9c99656a54e489e4a812875ec3eb66c (commit)
       via  0a82c8f116e07825ffe642a39a151f4afb8461b9 (commit)
       via  8c2c39f7fcb89b215195a281dbeb6ded9f15eb21 (commit)
       via  61b6510b32ffa769ae33c54432a74d89b772f713 (commit)
       via  e4b2722f07f04a15789f3aff3f0fc3e8a8eabfc8 (commit)
      from  fd28abdac605dbd3d0a84fc448da779df436a54d (commit)

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

- Log -----------------------------------------------------------------
commit 480ca0913232c5c52b37ac7ff50abf5ee7895bd2
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Mon Nov 3 14:01:25 2008 +0000

    	* remote.c (remote_start_remote): If the solib list is global,
    	fetch libraries and insert breakpoints after connecting.
    	* infcmd.c (post_create_inferior): If the solist is shared between
    	inferiors, no need to refetch it on every new inferior.
    	(detach_command): If the shared library list is shared between
    	inferiors, then don't clear it on every inferior detach.
    	* gdbarch.sh (has_global_solist): New.
    	* i386-dicos-tdep.c (i386_dicos_init_abi): Set
    	gdbarch_has_global_solist.
    	* target.c (target_pre_inferior): If the shared library list is
    	shared between inferiors, then don't clear it here, neither
    	invalidate the memory regions or clear the target description.
    	(target_detach): If the shared library list is shared between
    	inferiors, then don't remove breakpoints from the target here.
    	(target_disconnect): Comment.
    	* solib.c (update_solib_list): Check for null_ptid.
    	* breakpoint.c (insert_breakpoints, update_global_location_list):
    	If the shared library list is shared between inferiors, insert
    	breakpoints even if there's no execution.
    	(breakpoint_init_inferior): If the shared library list is shared
    	between inferiors, don't delete breakpoints or mark them
    	uninserted here.
    
    	* gdbarch.c, gdbarch.h: Regenerate.

commit 515afdac7e61a625f6e0ba5226f0715505e481b8
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Mon Nov 3 00:00:04 2008 +0000

    *** empty log message ***

commit 89eca930aaace2d480f54c5f3e869ff2624698b1
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun Nov 2 23:59:45 2008 +0000

    daily update

commit c6b062b5084e742c0025709cb36fd37c5ed289ce
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sun Nov 2 00:00:04 2008 +0000

    *** empty log message ***

commit 963e74e9c8a9e7fc1cab46cba4d3d31e76dc28c3
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sat Nov 1 23:59:50 2008 +0000

    daily update

commit e4d9340860eacbc32aaf2ff843e78b476b8f7e56
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sat Nov 1 00:00:34 2008 +0000

    *** empty log message ***

commit b7be1687bdea4de11a15f24417984b93ebf7e096
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Oct 31 23:59:55 2008 +0000

    daily update

commit 8715d7c3f720715d0b03372bb2253f4881130f14
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Oct 31 20:21:13 2008 +0000

    Fix ChangeLog dates

commit 8207ea2c71c0d5bd82e51f1b341a6fd10256e554
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Fri Oct 31 20:02:04 2008 +0000

    	* inferior.h (inferior_ignoring_leading_exec_events): Delete
    	declaration.

commit ff29e7969a2f50c9744825e27ffa27ec1c698c65
Author: Pedro Alves <pedro@codesourcery.com>
Date:   Fri Oct 31 19:41:36 2008 +0000

    	* inferior.h (write_inferior_status_register): Delete.
    	* infrun.c (write_inferior_status_register): Delete.

commit d00c4b5901022165d41558db527ec3bd4af93082
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Fri Oct 31 00:00:03 2008 +0000

    *** empty log message ***

commit 0313d50ba9c99656a54e489e4a812875ec3eb66c
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Oct 31 00:00:01 2008 +0000

    daily update

commit 0a82c8f116e07825ffe642a39a151f4afb8461b9
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 30 21:44:14 2008 +0000

    gdb
    	* value.c (coerce_array): Use check_typedef.
    gdb/testsuite
    	* gdb.base/pointers.exp: Add test.
    	* gdb.base/pointers.c (k, S): New typedefs.
    	(instance): New global.

commit 8c2c39f7fcb89b215195a281dbeb6ded9f15eb21
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 30 20:35:29 2008 +0000

    	* cli/cli-logging.c (handle_redirections): Make a cleanup.
    	* reggroups.c (maintenance_print_reggroups): Make a cleanup.
    	* regcache.c (regcache_print): Make a cleanup.
    	* maint.c (maintenance_print_architecture): Make a cleanup.
    	* dummy-frame.c (maintenance_print_dummy_frames): Make a cleanup.

commit 61b6510b32ffa769ae33c54432a74d89b772f713
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 30 20:33:50 2008 +0000

    	* utils.c (make_cleanup_close): Use make_cleanup_dtor.
    	(do_close_cleanup): Don't free 'fd'.

commit e4b2722f07f04a15789f3aff3f0fc3e8a8eabfc8
Author: Tom Tromey <tromey@redhat.com>
Date:   Thu Oct 30 18:42:27 2008 +0000

    	* source.c (symtab_to_fullname): Test 'r >= 0'.
    	(psymtab_to_fullname): Likewise.
    	(get_filename_and_charpos): Make a cleanup.
    	(forward_search_command): Likewise.
    	(reverse_search_command): Likewise.
    	* exec.c (exec_file_attach): Close scratch_chan on failure.
    	* nto-procfs.c (procfs_open): Make a cleanup.
    	(procfs_pidlist): Likewise.
    	(do_closedir_cleanup): New function.

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

Summary of changes:
 bfd/version.h                       |    2 +-
 gdb/ChangeLog                       |   66 +++++++++++++++++++++++++++++++++++
 gdb/breakpoint.c                    |   17 +++++++--
 gdb/cli/cli-logging.c               |    6 +++
 gdb/dummy-frame.c                   |    4 ++-
 gdb/exec.c                          |    7 +++-
 gdb/gdbarch.c                       |   23 ++++++++++++
 gdb/gdbarch.h                       |    6 +++
 gdb/gdbarch.sh                      |    4 ++
 gdb/i386-dicos-tdep.c               |    4 ++
 gdb/infcmd.c                        |   13 ++++++-
 gdb/inferior.h                      |   12 ------
 gdb/infrun.c                        |   10 -----
 gdb/maint.c                         |    4 ++-
 gdb/nto-procfs.c                    |   36 +++++++++++-------
 gdb/regcache.c                      |    4 ++-
 gdb/reggroups.c                     |    4 ++-
 gdb/remote.c                        |   11 ++++++
 gdb/solib.c                         |    2 +-
 gdb/source.c                        |   40 ++++++++++-----------
 gdb/target.c                        |   29 +++++++++++----
 gdb/testsuite/ChangeLog             |    6 +++
 gdb/testsuite/gdb.base/pointers.c   |    9 +++++
 gdb/testsuite/gdb.base/pointers.exp |    4 ++
 gdb/utils.c                         |    3 +-
 gdb/value.c                         |   19 +++++++---
 gdb/version.in                      |    2 +-
 27 files changed, 260 insertions(+), 87 deletions(-)

First 500 lines of diff:
diff --git a/bfd/version.h b/bfd/version.h
index b754e7d..7a44985 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20081030
+#define BFD_VERSION_DATE 20081103
 #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/ChangeLog b/gdb/ChangeLog
index 0ee7904..afec7c5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,69 @@
+2008-11-03  Pedro Alves  <pedro@codesourcery.com>
+
+	* remote.c (remote_start_remote): If the solib list is global,
+	fetch libraries and insert breakpoints after connecting.
+	* infcmd.c (post_create_inferior): If the solist is shared between
+	inferiors, no need to refetch it on every new inferior.
+	(detach_command): If the shared library list is shared between
+	inferiors, then don't clear it on every inferior detach.
+	* gdbarch.sh (has_global_solist): New.
+	* i386-dicos-tdep.c (i386_dicos_init_abi): Set
+	gdbarch_has_global_solist.
+	* target.c (target_pre_inferior): If the shared library list is
+	shared between inferiors, then don't clear it here, neither
+	invalidate the memory regions or clear the target description.
+	(target_detach): If the shared library list is shared between
+	inferiors, then don't remove breakpoints from the target here.
+	(target_disconnect): Comment.
+	* solib.c (update_solib_list): Check for null_ptid.
+	* breakpoint.c (insert_breakpoints, update_global_location_list):
+	If the shared library list is shared between inferiors, insert
+	breakpoints even if there's no execution.
+	(breakpoint_init_inferior): If the shared library list is shared
+	between inferiors, don't delete breakpoints or mark them
+	uninserted here.
+
+	* gdbarch.c, gdbarch.h: Regenerate.
+
+2008-10-31  Pedro Alves  <pedro@codesourcery.com>
+
+	* inferior.h (inferior_ignoring_leading_exec_events): Delete
+	declaration.
+
+2008-10-31  Pedro Alves  <pedro@codesourcery.com>
+
+	* inferior.h (write_inferior_status_register): Delete.
+	* infrun.c (write_inferior_status_register): Delete.
+
+2008-10-30  Tom Tromey  <tromey@redhat.com>
+
+	* value.c (coerce_array): Use check_typedef.
+
+2008-10-30  Tom Tromey  <tromey@redhat.com>
+
+	* cli/cli-logging.c (handle_redirections): Make a cleanup.
+	* reggroups.c (maintenance_print_reggroups): Make a cleanup.
+	* regcache.c (regcache_print): Make a cleanup.
+	* maint.c (maintenance_print_architecture): Make a cleanup.
+	* dummy-frame.c (maintenance_print_dummy_frames): Make a cleanup.
+
+2008-10-30  Tom Tromey  <tromey@redhat.com>
+
+	* utils.c (make_cleanup_close): Use make_cleanup_dtor.
+	(do_close_cleanup): Don't free 'fd'.
+
+2008-10-30  Tom Tromey  <tromey@redhat.com>
+
+	* source.c (symtab_to_fullname): Test 'r >= 0'.
+	(psymtab_to_fullname): Likewise.
+	(get_filename_and_charpos): Make a cleanup.
+	(forward_search_command): Likewise.
+	(reverse_search_command): Likewise.
+	* exec.c (exec_file_attach): Close scratch_chan on failure.
+	* nto-procfs.c (procfs_open): Make a cleanup.
+	(procfs_pidlist): Likewise.
+	(do_closedir_cleanup): New function.
+
 2008-10-30  Andreas Schwab  <schwab@suse.de>
 
 	* infcmd.c (construct_inferior_arguments): Handle newlines
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 0076ff8..912d7ea 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1263,7 +1263,10 @@ insert_breakpoints (void)
 
   update_global_location_list (1);
 
-  if (!breakpoints_always_inserted_mode () && target_has_execution)
+  if (!breakpoints_always_inserted_mode ()
+      && (target_has_execution
+ 	  || (gdbarch_has_global_solist (target_gdbarch)
+	      && target_supports_multi_process ())))
     /* update_global_location_list does not insert breakpoints
        when always_inserted_mode is not enabled.  Explicitly
        insert them now.  */
@@ -1707,6 +1710,11 @@ breakpoint_init_inferior (enum inf_context context)
   struct bp_location *bpt;
   int ix;
 
+  /* If breakpoint locations are shared across processes, then there's
+     nothing to do.  */
+  if (gdbarch_has_global_solist (target_gdbarch))
+    return;
+
   ALL_BP_LOCATIONS (bpt)
     if (bpt->owner->enable_state != bp_permanent)
       bpt->inserted = 0;
@@ -7259,9 +7267,10 @@ update_global_location_list (int should_insert)
       check_duplicates (b);
     }
 
-  if (breakpoints_always_inserted_mode ()
-      && should_insert
-      && target_has_execution)
+  if (breakpoints_always_inserted_mode () && should_insert
+      && (target_has_execution
+	  || (gdbarch_has_global_solist (target_gdbarch)
+	      && target_supports_multi_process ())))
     insert_breakpoint_locations ();
 }
 
diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c
index 86f1bc0..1e941b1 100644
--- a/gdb/cli/cli-logging.c
+++ b/gdb/cli/cli-logging.c
@@ -85,6 +85,7 @@ pop_output_files (void)
 static void
 handle_redirections (int from_tty)
 {
+  struct cleanup *cleanups;
   struct ui_file *output;
 
   if (saved_filename != NULL)
@@ -97,6 +98,7 @@ handle_redirections (int from_tty)
   output = gdb_fopen (logging_filename, logging_overwrite ? "w" : "a");
   if (output == NULL)
     perror_with_name (_("set logging"));
+  cleanups = make_cleanup_ui_file_delete (output);
 
   /* Redirects everything to gdb_stdout while this is running.  */
   if (!logging_redirect)
@@ -104,6 +106,8 @@ handle_redirections (int from_tty)
       output = tee_file_new (gdb_stdout, 0, output, 1);
       if (output == NULL)
 	perror_with_name (_("set logging"));
+      discard_cleanups (cleanups);
+      cleanups = make_cleanup_ui_file_delete (output);
       if (from_tty)
 	fprintf_unfiltered (gdb_stdout, "Copying output to %s.\n",
 			    logging_filename);
@@ -112,6 +116,8 @@ handle_redirections (int from_tty)
     fprintf_unfiltered (gdb_stdout, "Redirecting output to %s.\n",
 			logging_filename);
 
+  discard_cleanups (cleanups);
+
   saved_filename = xstrdup (logging_filename);
   saved_output.out = gdb_stdout;
   saved_output.err = gdb_stderr;
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index a27de2e..9cc3da7 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -265,11 +265,13 @@ maintenance_print_dummy_frames (char *args, int from_tty)
     fprint_dummy_frames (gdb_stdout);
   else
     {
+      struct cleanup *cleanups;
       struct ui_file *file = gdb_fopen (args, "w");
       if (file == NULL)
 	perror_with_name (_("maintenance print dummy-frames"));
+      cleanups = make_cleanup_ui_file_delete (file);
       fprint_dummy_frames (file);    
-      ui_file_delete (file);
+      do_cleanups (cleanups);
     }
 }
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 3b9ecfa..92450e6 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -217,8 +217,11 @@ exec_file_attach (char *filename, int from_tty)
 			    scratch_chan);
 
       if (!exec_bfd)
-	error (_("\"%s\": could not open as an executable file: %s"),
-	       scratch_pathname, bfd_errmsg (bfd_get_error ()));
+	{
+	  close (scratch_chan);
+	  error (_("\"%s\": could not open as an executable file: %s"),
+		 scratch_pathname, bfd_errmsg (bfd_get_error ()));
+	}
 
       /* At this point, scratch_pathname and exec_bfd->name both point to the
          same malloc'd string.  However exec_close() will attempt to free it
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index aa9a455..dd6ad7f 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -240,6 +240,7 @@ struct gdbarch
   gdbarch_target_signal_from_host_ftype *target_signal_from_host;
   gdbarch_target_signal_to_host_ftype *target_signal_to_host;
   gdbarch_record_special_symbol_ftype *record_special_symbol;
+  int has_global_solist;
 };
 
 
@@ -371,6 +372,7 @@ struct gdbarch startup_gdbarch =
   default_target_signal_from_host,  /* target_signal_from_host */
   default_target_signal_to_host,  /* target_signal_to_host */
   0,  /* record_special_symbol */
+  0,  /* has_global_solist */
   /* startup_gdbarch() */
 };
 
@@ -623,6 +625,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of target_signal_from_host, invalid_p == 0 */
   /* Skip verify of target_signal_to_host, invalid_p == 0 */
   /* Skip verify of record_special_symbol, has predicate */
+  /* Skip verify of has_global_solist, invalid_p == 0 */
   buf = ui_file_xstrdup (log, &dummy);
   make_cleanup (xfree, buf);
   if (strlen (buf) > 0)
@@ -832,6 +835,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                       "gdbarch_dump: get_longjmp_target = <0x%lx>\n",
                       (long) gdbarch->get_longjmp_target);
   fprintf_unfiltered (file,
+                      "gdbarch_dump: has_global_solist = %s\n",
+                      plongest (gdbarch->has_global_solist));
+  fprintf_unfiltered (file,
                       "gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
                       plongest (gdbarch->have_nonsteppable_watchpoint));
   fprintf_unfiltered (file,
@@ -3237,6 +3243,23 @@ set_gdbarch_record_special_symbol (struct gdbarch *gdbarch,
   gdbarch->record_special_symbol = record_special_symbol;
 }
 
+int
+gdbarch_has_global_solist (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of has_global_solist, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_solist called\n");
+  return gdbarch->has_global_solist;
+}
+
+void
+set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
+                               int has_global_solist)
+{
+  gdbarch->has_global_solist = has_global_solist;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index bc8298d..909db8c 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -811,6 +811,12 @@ typedef void (gdbarch_record_special_symbol_ftype) (struct gdbarch *gdbarch, str
 extern void gdbarch_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile, asymbol *sym);
 extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_record_special_symbol_ftype *record_special_symbol);
 
+/* True if the list of shared libraries is one and only for all
+   processes, as opposed to a list of shared libraries per inferior. */
+
+extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
+extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 0c513a5..28983d3 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -707,6 +707,10 @@ m:int:target_signal_to_host:enum target_signal ts:ts::default_target_signal_to_h
 
 # Record architecture-specific information from the symbol table.
 M:void:record_special_symbol:struct objfile *objfile, asymbol *sym:objfile, sym
+
+# True if the list of shared libraries is one and only for all
+# processes, as opposed to a list of shared libraries per inferior.
+v:int:has_global_solist:::0:0::0
 EOF
 }
 
diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
index 99c3d6f..665377c 100644
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -49,6 +49,10 @@ i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   set_solib_ops (gdbarch, &solib_target_so_ops);
 
+  /* Every process, although has its own address space, sees the same
+     list of shared libraries.  */
+  set_gdbarch_has_global_solist (gdbarch, 1);
+
   /* There's no (standard definition of) entry point or a guaranteed
      text location we could find with a symbol where to place the call
      dummy, so we put it on the stack.  */
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 607d2b3..63d8cca 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -398,7 +398,9 @@ post_create_inferior (struct target_ops *target, int from_tty)
      don't need to.  */
   target_find_description ();
 
-  if (exec_bfd)
+  /* If the solist is global across processes, there's no need to
+     refetch it here.  */
+  if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch))
     {
       /* Sometimes the platform-specific hook loads initial shared
 	 libraries, and sometimes it doesn't.  Try to do so first, so
@@ -410,7 +412,10 @@ post_create_inferior (struct target_ops *target, int from_tty)
 #else
       solib_add (NULL, from_tty, target, auto_solib_add);
 #endif
+    }
 
+  if (exec_bfd)
+    {
       /* Create the hooks to handle shared library load and unload
 	 events.  */
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
@@ -2341,7 +2346,11 @@ detach_command (char *args, int from_tty)
 {
   dont_repeat ();		/* Not for the faint of heart.  */
   target_detach (args, from_tty);
-  no_shared_libraries (NULL, from_tty);
+
+  /* If the solist is global across inferiors, don't clear it when we
+     detach from a single inferior.  */
+  if (!gdbarch_has_global_solist (target_gdbarch))
+    no_shared_libraries (NULL, from_tty);
 
   /* If the current target interface claims there's still execution,
      then don't mess with threads of other processes.  */
diff --git a/gdb/inferior.h b/gdb/inferior.h
index c707c36..cc5bf9f 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -58,10 +58,6 @@ extern struct cleanup *make_cleanup_restore_inferior_status (struct inferior_sta
 
 extern void discard_inferior_status (struct inferior_status *);
 
-extern void write_inferior_status_register (struct inferior_status
-					    *inf_status, int regno,
-					    LONGEST val);
-
 /* The -1 ptid, often used to indicate either an error condition
    or a "don't care" condition, i.e, "run all threads."  */
 extern ptid_t minus_one_ptid;
@@ -120,14 +116,6 @@ extern ptid_t inferior_ptid;
    redisplay the prompt until the execution is actually over. */
 extern int sync_execution;
 
-/* Some targets (stupidly) report more than one exec event per actual
-   call to an event() system call.  If only the last such exec event
-   need actually be noticed and responded to by the debugger (i.e.,
-   be reported to the user), then this is the number of "leading"
-   exec events which should be ignored.
- */
-extern int inferior_ignoring_leading_exec_events;
-
 /* Inferior environment. */
 
 extern struct gdb_environ *inferior_environ;
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 46b5e40..30d914d 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4724,16 +4724,6 @@ struct inferior_status
   int proceed_to_finish;
 };
 
-void
-write_inferior_status_register (struct inferior_status *inf_status, int regno,
-				LONGEST val)
-{
-  int size = register_size (current_gdbarch, regno);
-  void *buf = alloca (size);
-  store_signed_integer (buf, size, val);
-  regcache_raw_write (inf_status->registers, regno, buf);
-}
-
 /* Save all of the information associated with the inferior<==>gdb
    connection.  INF_STATUS is a pointer to a "struct inferior_status"
    (defined in inferior.h).  */
diff --git a/gdb/maint.c b/gdb/maint.c
index e64d4fe..365e374 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -414,11 +414,13 @@ maintenance_print_architecture (char *args, int from_tty)
     gdbarch_dump (current_gdbarch, gdb_stdout);
   else
     {
+      struct cleanup *cleanups;
       struct ui_file *file = gdb_fopen (args, "w");
       if (file == NULL)
 	perror_with_name (_("maintenance print architecture"));
+      cleanups = make_cleanup_ui_file_delete (file);
       gdbarch_dump (current_gdbarch, file);    
-      ui_file_delete (file);
+      do_cleanups (cleanups);
     }
 }
 
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 7450edc..f69aaf2 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -125,6 +125,7 @@ procfs_open (char *arg, int from_tty)
   char buffer[50];
   int fd, total_size;
   procfs_sysinfo *sysinfo;
+  struct cleanup *cleanups;
 
   nto_is_nto_target = procfs_is_nto_target;
 
@@ -169,13 +170,13 @@ procfs_open (char *arg, int from_tty)
 		       safe_strerror (errno));
       error (_("Invalid procfs arg"));
     }
+  cleanups = make_cleanup_close (fd);
 
   sysinfo = (void *) buffer;
   if (devctl (fd, DCMD_PROC_SYSINFO, sysinfo, sizeof buffer, 0) != EOK)
     {
       printf_filtered ("Error getting size: %d (%s)\n", errno,
 		       safe_strerror (errno));
-      close (fd);
       error (_("Devctl failed."));
     }
   else
@@ -186,7 +187,6 @@ procfs_open (char *arg, int from_tty)
 	{
 	  printf_filtered ("Memory error: %d (%s)\n", errno,
 			   safe_strerror (errno));
-	  close (fd);
 	  error (_("alloca failed."));
 	}
       else
@@ -195,7 +195,6 @@ procfs_open (char *arg, int from_tty)
 	    {
 	      printf_filtered ("Error getting sysinfo: %d (%s)\n", errno,
 			       safe_strerror (errno));
-	      close (fd);
 	      error (_("Devctl failed."));
 	    }
 	  else
@@ -203,14 +202,11 @@ procfs_open (char *arg, int from_tty)
 	      if (sysinfo->type !=
 		  nto_map_arch_to_cputype (gdbarch_bfd_arch_info
 					   (current_gdbarch)->arch_name))
-		{
-		  close (fd);
-		  error (_("Invalid target CPU."));
-		}
+		error (_("Invalid target CPU."));
 	    }
 	}
     }
-  close (fd);
+  do_cleanups (cleanups);
   printf_filtered ("Debugging using %s\n", nto_procfs_path);
 }
 
@@ -259,12 +255,17 @@ procfs_find_new_threads (void)
   return;
 }
 
+static void
+do_closedir_cleanup (void *dir)
+{
+  closedir (dir);
+}
+
 void
 procfs_pidlist (char *args, int from_tty)
 {
   DIR *dp = NULL;
   struct dirent *dirp = NULL;
-  int fd = -1;
   char buf[512];
   procfs_info *pidinfo = NULL;
   procfs_debuginfo *info = NULL;
@@ -272,6 +273,7 @@ procfs_pidlist (char *args, int from_tty)
   pid_t num_threads = 0;


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-03 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-03 14:58 [SCM] master: * remote.c (remote_start_remote): If the solib list is global, sergio

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).