-
Notifications
You must be signed in to change notification settings - Fork 183
How to improve debugging UX? Resuscitate --single
?
#206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The reason why I agree that I initially disliked making remote debugging mandatory, but the advantages of an isolated address space at all times greatly outweighs an extra step during debugging. Also, gdb allows running background process as children from its prompt (something like On a side note, CLion should be able to remote debug though -- perhaps making a debugging target that runs the tests and remote debug into them would be possible? |
One more thing: I haven't tested it since --single was there, but I think that multi-inferior debugging might still be working. Maybe it'll integrate better with CLion? To set up multi-inferior capabilities in gdb, you'd have to run the following commands: $ gdb -q ./samples/simple.c.bin
Reading symbols from ./samples/simple.c.bin...done.
(gdb) set follow-fork-mode child
(gdb) set detach-on-fork off
(gdb) set non-stop on
(gdb) set target-async on
(gdb) set schedule-multiple on
(gdb) handle SIGSTOP SIGCONT nostop noprint pass |
I just tried the multi-inferior setup, and it worked surprisingly well! I've cooked up a small gdb script to help make the initial setup less painful: set follow-fork-mode child
set detach-on-fork off
set non-stop on
set target-async on
set schedule-multiple on
set print inferior-events off
set print thread-events off
handle SIGSTOP SIGCONT nostop noprint pass
define hookpost-start
set criterion_options.crash = 1
end
define hook-run
set breakpoint pending on
tbreak main
commands
silent
set criterion_options.crash = 1
continue
end
end Save this as Then, from the gdb prompt, just call The above script isn't perfect (notably I'd like to get rid of the repeated "Reading symbols from..." messages, and print a summary of which tests are ready for debugging after a |
Cool, thanks, will try! |
Ideally, I would like to be able to run the main executable in gdb/lldb directly to debug a test, instead of having to open gdb/lldb in another terminal, run
target remote :1234
etc. The way it's set up now adds a bit of friction. It's unfortunate because the rest of the framework is super nice and awesome!The way debugging is set up also does not jive well with IDEs that expect to attach to the main executable (I'm using CLion for example).
Reading through the Github issues, I learned that there used to be a
--single
option that got removed after a refactoring. I'm assuming that--single
ran the test inside the runner's process, correct?What's the rationale behind removing
--single
? I realize you'd loose the sandboxing of tests, but when debugging a test, perhaps that's an OK price to pay for removing the friction (esp. because you're only running a single test).Is there anything fundamentally impeding
--single
from being implemented again?The text was updated successfully, but these errors were encountered: