+2010-04-03 Pedro Alves <pedro@codesourcery.com>
+
+ * inferiors.c (add_thread): Set last_status kind to
+ TARGET_WAITKIND_IGNORE.
+ * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
+ fetch. Use ptid_of. Avoid unnecessary get_lwp_thread calls.
+ (linux_wait_1): Move `thread' local definition to block that uses
+ it. Don't NULL initialize `event_child'.
+ (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
+ Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
+ * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
+
2010-04-01 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
cancel_breakpoint (struct lwp_info *lwp)
{
struct thread_info *saved_inferior;
- struct regcache *regcache;
/* There's nothing to do if we don't support breakpoints. */
if (!supports_breakpoints ())
return 0;
- regcache = get_thread_regcache (get_lwp_thread (lwp), 1);
-
/* breakpoint_at reads from current inferior. */
saved_inferior = current_inferior;
current_inferior = get_lwp_thread (lwp);
if (debug_threads)
fprintf (stderr,
"CB: Push back breakpoint for %s\n",
- target_pid_to_str (lwp->head.id));
+ target_pid_to_str (ptid_of (lwp)));
/* Back up the PC if necessary. */
if (the_low_target.decr_pc_after_break)
{
struct regcache *regcache
- = get_thread_regcache (get_lwp_thread (lwp), 1);
+ = get_thread_regcache (current_inferior, 1);
(*the_low_target.set_pc) (regcache, lwp->stop_pc);
}
fprintf (stderr,
"CB: No breakpoint found at %s for [%s]\n",
paddress (lwp->stop_pc),
- target_pid_to_str (lwp->head.id));
+ target_pid_to_str (ptid_of (lwp)));
}
current_inferior = saved_inferior;
struct target_waitstatus *ourstatus, int target_options)
{
int w;
- struct thread_info *thread = NULL;
- struct lwp_info *event_child = NULL;
+ struct lwp_info *event_child;
int options;
int pid;
int step_over_finished;
&& !ptid_equal (cont_thread, null_ptid)
&& !ptid_equal (cont_thread, minus_one_ptid))
{
+ struct thread_info *thread;
+
thread = (struct thread_info *) find_inferior_id (&all_threads,
cont_thread);
/* For stop requests, we're done. */
lwp->resume = NULL;
- get_lwp_thread (lwp)->last_status.kind = TARGET_WAITKIND_IGNORE;
+ thread->last_status.kind = TARGET_WAITKIND_IGNORE;
return 0;
}
step = (lwp->resume->kind == resume_step);
linux_resume_one_lwp (lwp, step, lwp->resume->sig, NULL);
- get_lwp_thread (lwp)->last_status.kind = TARGET_WAITKIND_IGNORE;
}
else
{
}
}
+ thread->last_status.kind = TARGET_WAITKIND_IGNORE;
lwp->resume = NULL;
return 0;
}