[Github-comments] [geany/geany-plugins] How to debug a multithread application [ Debugger / gdb ] (#1069)

nomadbyte notifications at github.com
Sun Apr 3 06:19:01 UTC 2022


@avafinger: I revisited this issue, and wanted to point out that the original expectation that the stepping from the breakpoint while in the thread-2 context should not be switching to thread-3 context is rather unwarranted.

In your example, both threads share the same task-function, so the breakpoint is also common, it's hit by thread-2, but the step-over continues the execution of the **whole process**. Thus the same breakpoint is then swiftly hit by the thread-3, as it should.

If you'd like to continue stepping in thread-2 context, you'd need to explicitly switch to thread-2 in the Call Stack pane. The subsequent stepping should indeed preserve the selected thread context (unless another thread hits its own breakpoint someplace), This also aligns with how its handled in the interactive GDB session.

Anyway, I did some digging and I believe I've got the intended thread-switching/stepping behavior working (at least with your test code). I'll be pushing the changes soon.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1069#issuecomment-1086785389
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/issues/1069/1086785389 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20220402/c940f57d/attachment-0001.htm>


More information about the Github-comments mailing list