Continuing in breakpoint commands hangs gdb if dashboard is enabled
See original GitHub issueContinuing in breakpoint commands hangs gdb if dashboard is enabled. You can verify this by doing the following in gdb on a sample program:
b main
commands
cont
end
run
The error that gets raised is gdb.error: Selected thread is running.
and then gdb will be unresponsive.
Maybe this is a duplicate of old issue #27
Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
1176227 – gdb "run" command hangs - Red Hat Bugzilla
Description of problem: The gdb "run" command hangs if it's invoked before the user has issued any resume-execution commands ("step", "continue", "stepi", ...
Read more >Pleasant debugging with GDB and DDD - begriffs.com
Set a breakpoint on the return 0 line. Select GDB console from the View menu (or press Alt-1). Run start in the GDB...
Read more >Hacked GDB Dashboard Puts It All On Display - Hackaday
Normally, the dashboard shows when the program stops. For example, on each breakpoint. However, gdb has a hook system that allows you to...
Read more >Continuing and Stepping (Debugging with GDB)
Continue running as in step , but do so count times. If a breakpoint is reached, or a signal not related to stepping...
Read more >Debug it - Discovery - Embedded Rust documentation
Also, as mentioned above if you were to execute the step command GDB gets stuck because it is executing a branch instruction to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@algrebe OK it works, thanks!
So apparently scheduling a continuation command avoids the hanging. I also noticed that rendering the dashboard in a
gdb.post_event
handler also works but it messes with the prompt.It’s still suboptimal as the dashboard shouldn’t be rendered in such conditions (hardly noticeable if the scrollback is discarded, default) but at least it doesn’t force the users to kill their debugging session. Anyway since this is something that requires user intervention anyway, I prefer to document this in the wiki for now and suggest to define a custom command to be used when continuing within a breakpoint’s command list:
The usage is the following:
See the corresponding wiki page.
@cyrus-and Thank you for your response. Yes, it does happen too late. So I took another approach this time - rather than having
cont
in the command, I ask the dashboard to issue thecont
. This seems to work well. It probably isn’t a fix to handling cont from commands but it’s a good workaround for those who use the dashboard.