From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Larmour To: gdb@sources.redhat.com Subject: Thread switching and stepping bug Date: Tue, 24 Apr 2001 02:06:00 -0000 Message-id: <3AE541F1.C8D1976F@redhat.com> X-SW-Source: 2001-04/msg00174.html It seems GDB (a fairly recent CVS) doesn't do the right thing when a thread view has been switched and then the system stepped. I've got a program with a bunch of threads. The default one is thread 3 and has a function breakme which I set a breakpoint. The other threads run other stuff. If I set a breakpoint on breakme, thread 3 hits it. If I manually step off that breakpoint, switch to e.g. thread 5 then do another step, GDB can't recognise that it hit a sensible breakpoint, and instead reports a SIGTRAP. So the commands I'm doing are: b breakme c [ hits breakpoint in thread 3] step thread 5 step I'm surprised no-one has noticed this before, so is my understanding wrong? I've tried looking in wait_for_inferior() but got lost quickly :-). I think the problem may be that step_resume_breakpoint is changed when GDB notices the thread has changed. But I'm no expert. Jifl -- Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine