Re: gdb - stepping in multithread application

David Young <[email protected]> Tue, 25 Mar 2025 10:38:08 -0500
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On Mon, Mar 10, 2025 at 10:57:09AM +0100, Peter Skvarka wrote:
> Hello,
> I have multithread application.
> After main thread creates secondary thread and then main thread stops on
> breakpoint then when I try to step in main thread then some steps jumps also
> to secondary thread and then back to main thread etc.
> Only solution I know is to use gdb command "break until" on next line and
> put such breakpoint only into thread which I want step through.

I see this on my NetBSD 10.0 boxes (evbarm, GENERIC64 kernel).  If I run
a multithreaded program in gdb, `next` commands do not stop my program
on the next statement of the current program but at some statement in a
second thread.  It was not always so.

David

-- 
David Young
[email protected]    Urbana, IL    (217) 721-9981