Re: [PATCH 4/6] Fix for even more missed events; eliminate thread-hop code.

Pedro Alves
2014-03-05T15:45:20Z

On 02/25/2014 08:32 PM, Pedro Alves wrote:
> But in order to do that, we need to make bpstat aware of single-step
> breakpoints. So this patch starts convering the single-step
> breakpoints to real breakpoints. It doesn't put them in the regular
> breakpoint chain yet though. More changes would be needed for that.

Unfortunately we're still not ready for this. watch-cond-infcall.exp
revealed that we need to remove single-step breakpoints before running
the infcall for the condition, otherwise nasty things happen, like
GDB referencing already deleted breakpoints following the bpstat
struct. I didn't notice this before as the failure is intermittent,
but valgrind showed it clearly. Also, patch #5's thread_still_needs_step_over
function call from keep_going meant that the end result of the series
would be that we'd no longer move the thread past the single-step
breakpoint, actually, as the single-step breakpoint (for the other
thread) was always removed before keep_going was reached...

int
thread_still_needs_step_over (struct thread_info *tp)
{
if (tp->stepping_over_breakpoint)
{
struct regcache *regcache = get_thread_regcache (tp->ptid);

if (breakpoint_here_p (get_regcache_aspace (regcache),
regcache_read_pc (regcache)))

v2 simplifies the patch further, and no longer needs to convert
single-step breakpoints to real breakpoints. I'll get back to
that separately...

--
Pedro Alves