Use sigsetjmp/siglongjmp in opcodes
[deliverable/binutils-gdb.git] / gdb / aix-thread.c
index 0202a2471eb19461c032872494b1f2e2f5e5ec83..3865cba1c7e87c919947843a856292696636db47 100644 (file)
@@ -49,6 +49,7 @@
 #include "ppc-tdep.h"
 #include <string.h>
 #include "observer.h"
+#include "objfiles.h"
 
 #include <procinfo.h>
 #include <sys/types.h>
@@ -313,7 +314,7 @@ pdc_symbol_addrs (pthdb_user_t user, pthdb_symbol_t *symbols, int count)
                fprintf_unfiltered (gdb_stdlog, " returning PDC_FAILURE\n");
              return PDC_FAILURE;
            }
-         symbols[i].addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
+         symbols[i].addr = BMSYMBOL_VALUE_ADDRESS (ms);
        }
       if (debug_aix_thread)
        fprintf_unfiltered (gdb_stdlog, "  symbols[%d].addr = %s\n",
@@ -912,7 +913,7 @@ pd_enable (void)
   ms = lookup_minimal_symbol (stub_name, NULL, NULL);
   if (ms.minsym == NULL)
     return;
-  pd_brk_addr = MSYMBOL_VALUE_ADDRESS (ms.minsym);
+  pd_brk_addr = BMSYMBOL_VALUE_ADDRESS (ms);
   if (!create_thread_event_breakpoint (target_gdbarch (), pd_brk_addr))
     return;
 
@@ -958,12 +959,9 @@ new_objfile (struct objfile *objfile)
 /* Attach to process specified by ARGS.  */
 
 static void
-aix_thread_attach (struct target_ops *ops, char *args, int from_tty)
+aix_thread_inferior_created (struct target_ops *ops, int from_tty)
 {
-  struct target_ops *beneath = find_target_beneath (ops);
-  
-  beneath->to_attach (beneath, args, from_tty);
-  pd_activate (1);
+  pd_enable ();
 }
 
 /* Detach from the process attached to by aix_thread_attach().  */
@@ -1822,15 +1820,12 @@ init_aix_thread_ops (void)
   aix_thread_ops.to_longname = _("AIX pthread support");
   aix_thread_ops.to_doc = _("AIX pthread support");
 
-  aix_thread_ops.to_attach = aix_thread_attach;
   aix_thread_ops.to_detach = aix_thread_detach;
   aix_thread_ops.to_resume = aix_thread_resume;
   aix_thread_ops.to_wait = aix_thread_wait;
   aix_thread_ops.to_fetch_registers = aix_thread_fetch_registers;
   aix_thread_ops.to_store_registers = aix_thread_store_registers;
   aix_thread_ops.to_xfer_partial = aix_thread_xfer_partial;
-  /* No need for aix_thread_ops.to_create_inferior, because we activate thread
-     debugging when the inferior reaches pd_brk_addr.  */
   aix_thread_ops.to_mourn_inferior = aix_thread_mourn_inferior;
   aix_thread_ops.to_thread_alive = aix_thread_thread_alive;
   aix_thread_ops.to_pid_to_str = aix_thread_pid_to_str;
@@ -1854,6 +1849,10 @@ _initialize_aix_thread (void)
   /* Notice when object files get loaded and unloaded.  */
   observer_attach_new_objfile (new_objfile);
 
+  /* Add ourselves to inferior_created event chain.
+     This is needed to enable the thread target on "attach".  */
+  observer_attach_inferior_created (aix_thread_inferior_created);
+
   add_setshow_boolean_cmd ("aix-thread", class_maintenance, &debug_aix_thread,
                           _("Set debugging of AIX thread module."),
                           _("Show debugging of AIX thread module."),
This page took 0.024678 seconds and 4 git commands to generate.