gdbserver:prepare_access_memory: pick another thread
[deliverable/binutils-gdb.git] / gdb / gdbserver / lynx-low.c
index 3b8366953ecdc4be75e237721f2bc3b6265163a7..36ab0a3b2d8ef96054a62228db178a0ae01404dc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -218,8 +218,8 @@ lynx_add_process (int pid, int attached)
 
   proc = add_process (pid, attached);
   proc->tdesc = lynx_tdesc;
-  proc->private = xcalloc (1, sizeof (*proc->private));
-  proc->private->last_wait_event_ptid = null_ptid;
+  proc->priv = XCNEW (struct process_info_private);
+  proc->priv->last_wait_event_ptid = null_ptid;
 
   return proc;
 }
@@ -334,7 +334,7 @@ lynx_resume (struct thread_resume *resume_info, size_t n)
      unexpected signals (Eg SIG61) when we resume the inferior
      using a different thread.  */
   if (ptid_equal (ptid, minus_one_ptid))
-    ptid = current_process()->private->last_wait_event_ptid;
+    ptid = current_process()->priv->last_wait_event_ptid;
 
   /* The ptid might still be minus_one_ptid; this can happen between
      the moment we create the inferior or attach to a process, and
@@ -343,7 +343,7 @@ lynx_resume (struct thread_resume *resume_info, size_t n)
   if (ptid_equal (ptid, minus_one_ptid))
     ptid = thread_to_gdb_id (current_thread);
 
-  regcache_invalidate ();
+  regcache_invalidate_pid (ptid_get_pid (ptid));
 
   errno = 0;
   lynx_ptrace (request, ptid, 1, signal, 0);
@@ -422,7 +422,7 @@ retry:
 
   ret = lynx_waitpid (pid, &wstat);
   new_ptid = lynx_ptid_build (ret, ((union wait *) &wstat)->w_tid);
-  find_process_pid (ret)->private->last_wait_event_ptid = new_ptid;
+  find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
 
   /* If this is a new thread, then add it now.  The reason why we do
      this here instead of when handling new-thread events is because
@@ -552,8 +552,8 @@ static void
 lynx_mourn (struct process_info *proc)
 {
   /* Free our private data.  */
-  free (proc->private);
-  proc->private = NULL;
+  free (proc->priv);
+  proc->priv = NULL;
 
   clear_inferiors ();
 }
@@ -713,7 +713,7 @@ lynx_write_memory (CORE_ADDR memaddr, const unsigned char *myaddr, int len)
 static void
 lynx_request_interrupt (void)
 {
-  ptid_t inferior_ptid = thread_to_gdb_id (current_thread);
+  ptid_t inferior_ptid = thread_to_gdb_id (get_first_thread ());
 
   kill (lynx_ptid_get_pid (inferior_ptid), SIGINT);
 }
@@ -722,6 +722,7 @@ lynx_request_interrupt (void)
 
 static struct target_ops lynx_target_ops = {
   lynx_create_inferior,
+  NULL,  /* arch_setup */
   lynx_attach,
   lynx_kill,
   lynx_detach,
@@ -742,6 +743,11 @@ static struct target_ops lynx_target_ops = {
   NULL,  /* supports_z_point_type */
   NULL,  /* insert_point */
   NULL,  /* remove_point */
+  NULL,  /* stopped_by_sw_breakpoint */
+  NULL,  /* supports_stopped_by_sw_breakpoint */
+  NULL,  /* stopped_by_hw_breakpoint */
+  NULL,  /* supports_stopped_by_hw_breakpoint */
+  target_can_do_hardware_single_step,
   NULL,  /* stopped_by_watchpoint */
   NULL,  /* stopped_data_address */
   NULL,  /* read_offsets */
@@ -754,6 +760,10 @@ static struct target_ops lynx_target_ops = {
   NULL,  /* async */
   NULL,  /* start_non_stop */
   NULL,  /* supports_multi_process */
+  NULL,  /* supports_fork_events */
+  NULL,  /* supports_vfork_events */
+  NULL,  /* supports_exec_events */
+  NULL,  /* handle_new_gdb_connection */
   NULL,  /* handle_monitor_command */
 };
 
This page took 0.02555 seconds and 4 git commands to generate.