> If the "next" is for thread 1, > > > That's when we get an event from a different thread (thread 3): > > > > infrun: target_wait (-1.0.0, status) = > > infrun: 28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)], > > infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP > > infrun: TARGET_WAITKIND_STOPPED > > infrun: stop_pc = 0x80782d0 > > infrun: context switch > > infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378) > > > > ... which we find to be at the address where we set a breakpoint > > on "the unwinder debug hook" (namely "_Unwind_DebugHook"). That's > > why GDB reports for this event that this is... > > > > infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME > > Why are we getting this? longjmp/exception/step-resume breakpoints > are thread-specific. > > I'd guess that the bug is in bpstat_what: > > struct bpstat_what > bpstat_what (bpstat bs_head) > { > ... > case bp_longjmp: > case bp_longjmp_call_dummy: > case bp_exception: > this_action = BPSTAT_WHAT_SET_LONGJMP_RESUME; > retval.is_longjmp = bptype != bp_exception; > break; > ... > > This bit is not considering "if (bs->stop)" like e.g., > the bp_step_resume case. > > I've seen something like this trigger before, and have a patch > somewhere to rewrite bpstat_what differently which fixes that. > I never managed to write a testcase for it so never submitted > it. But, could you try the simpler approach? Try making that: > > if (bs->stop) > { > this_action = BPSTAT_WHAT_SET_LONGJMP_RESUME; > retval.is_longjmp = bptype != bp_exception; > } > else > this_action = BPSTAT_WHAT_SINGLE; > break; Ah ha, I missed the fact that the exception breakpoint is thread- specific. Your fix seems to be working very well; thanks for suggestion, Pedro! Attached is a patch with a slightly altered analysis as the revision log. Our SuSE 10 machine is very slow, so I tested it on a more modern machine with a slightly different distro. I'm wondering if we shouldn't be doing the same for: case bp_longjmp_resume: case bp_exception_resume: this_action = BPSTAT_WHAT_CLEAR_LONGJMP_RESUME; retval.is_longjmp = bptype == bp_longjmp_resume; break; gdb/ChangeLog: Pedro Alves * breakpoint.c (bpstat_what) : Correctly handle the case where BS->STOP is not set. Thanks! -- Joel