<p></p>
<p dir="auto"><a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/avafinger/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/avafinger">@avafinger</a>: Thanks for the quick turn around with the testing. I'm glad that your results seem to show that the mentioned issues are gone.</p>
<p dir="auto">If I understand it correctly, your assumption about disregarding the breakpoints in peer threads is not consistent with the GDB All Stop mode.</p>
<p dir="auto">Just to reiterate this, in GDB All Stop mode:</p>
<ul dir="auto">
<li>when hitting a breakpoint, GDB will halt all running threads and switch to the context of the thread that has hit the breakpoint</li>
<li>stepping/continuing from the Stopped state will resume <strong>all</strong> concurrent threads</li>
<li>in the absence of subsequent breakpoints in the running threads, GDB will maintain the currently selected thread context</li>
<li>if a breakpoint is hit by a concurrent thread, GDB will halt all running threads and switch to that thread's context</li>
</ul>
<p dir="auto">Not sure how this works for your practical cases, but this GDB behavior does make sense, especially when threads do not share the task-function. When such threads hit breakpoints in their task-function code, it's reasonable -- and convenient too -- to expect thread context to switch to that thread.</p>
<p dir="auto">As for how to achieve your desired thread context switching (or rather non-switching) behavior -- one simple and common way is by making the breakpoints <strong>conditional</strong> on the intended thread-id (or some surrogate). In your example, the watched variable <em>i</em> could be used in the shared breakpoint condition (e.g. i==0, for making the breakpoint effective only for thread 0). The condition can be added in the Breakpoints pane.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/issues/1069#issuecomment-1088119436">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ3SGM5N6TK4T5OQUQLVDN3Q3ANCNFSM4YQPZN7A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAIOWJZ72LQ27FBQVZRZC7DVDN3Q3A5CNFSM4YQPZN7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIDNWFDA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><geany/geany-plugins/issues/1069/1088119436</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/issues/1069#issuecomment-1088119436",
"url": "https://github.com/geany/geany-plugins/issues/1069#issuecomment-1088119436",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>