Breakpoint in shared library does not work on mips-irix.
authorJoel Brobecker <brobecker@gnat.com>
Sat, 9 Jan 2010 04:44:02 +0000 (04:44 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Sat, 9 Jan 2010 04:44:02 +0000 (04:44 +0000)
        * procfs.c: #include "observer.h".
        (procfs_inferior_created): New function, moving here the code
        which unsets the syssgi syscall-exit notifications.
        (procfs_create_inferior): Remove the code which unsets the syssgi
        syscall-exit notifications. It is too early to do this here.
        (_initialize_procfs): Attach the procfs_inferior_created observer.

gdb/ChangeLog
gdb/procfs.c

index c633f9b55fea33f7d3e53be4bd151db6ad7f0eaf..8f4b86b7a73251a5b5f959403a0aec3fa717f0f8 100644 (file)
@@ -1,3 +1,13 @@
+2010-01-09  Joel Brobecker  <brobecker@adacore.com>
+
+       Breakpoint in shared library does not work on mips-irix.
+       * procfs.c: #include "observer.h".
+       (procfs_inferior_created): New function, moving here the code
+       which unsets the syssgi syscall-exit notifications.
+       (procfs_create_inferior): Remove the code which unsets the syssgi
+       syscall-exit notifications. It is too early to do this here.
+       (_initialize_procfs): Attach the procfs_inferior_created observer.
+
 2010-01-09  Joel Brobecker  <brobecker@adacore.com>
 
        Wrong return convention for arrays (mips-irix).
index 5791ee7427b33701415c4f0d378cf01a0f0c1911..9278bcb5abc7b9fca1debe54b273bdeb668ad3c1 100644 (file)
@@ -51,6 +51,7 @@
 #include "inflow.h"
 #include "auxv.h"
 #include "procfs.h"
+#include "observer.h"
 
 /*
  * PROCFS.C
@@ -5146,13 +5147,27 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file,
                       NULL, NULL, shell_file);
 
   procfs_init_inferior (ops, pid);
+}
+
+/* An observer for the "inferior_created" event.  */
 
+static void
+procfs_inferior_created (struct target_ops *ops, int from_tty)
+{
 #ifdef SYS_syssgi
   /* Make sure to cancel the syssgi() syscall-exit notifications.  
      They should normally have been removed by now, but they may still
      be activated if the inferior doesn't use shared libraries, or if
      we didn't locate __dbx_link, or if we never stopped in __dbx_link.
-     See procfs_init_inferior() for more details.  */
+     See procfs_init_inferior() for more details.
+
+     Since these notifications are only ever enabled when we spawned
+     the inferior ourselves, there is nothing to do when the inferior
+     was created by attaching to an already running process, or when
+     debugging a core file.  */
+  if (current_inferior ()->attach_flag || !target_can_run (&current_target))
+    return;
+
   proc_trace_syscalls_1 (find_procinfo_or_die (PIDGET (inferior_ptid), 0),
                          SYS_syssgi, PR_SYSEXIT, FLAG_RESET, 0);
 #endif
@@ -6000,6 +6015,8 @@ proc_untrace_sysexit_cmd (char *args, int from_tty)
 void
 _initialize_procfs (void)
 {
+  observer_attach_inferior_created (procfs_inferior_created);
+
   add_info ("proc", info_proc_cmd, _("\
 Show /proc process information about any running process.\n\
 Specify process id, or use the program being debugged by default.\n\
This page took 0.026941 seconds and 4 git commands to generate.