Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Is there a plugin to create a command to run a test under gdb or any other debugger other then doing it manually?

Open hpe-ykoehler opened this issue 1 year ago • 3 comments

It would be nice to have a way to run ceedling with a test that is known to fail into a debugger, removing the need to manually enable the debug flags, find the binary path, then find the toolchain-specific gdb program and connect all this together, etc.

Even better would be to enable ceedling to get gdb stack strace whenever a test crash, or set a breakpoint to the assert location and re-run the test in gdb.

hpe-ykoehler avatar Mar 14 '23 18:03 hpe-ykoehler

Feel free to try the pre-release gem for 0.32 in the releases section of github. You'll find it does stack tracing on failures for you, if you enable them by setting :use_backtrace_gdb_reporter to true

mvandervoord avatar Mar 14 '23 19:03 mvandervoord

Thanks, I will have a look at that, sounds quite interesting.

hpe-ykoehler avatar Mar 15 '23 02:03 hpe-ykoehler

Hi @hpe-ykoehler ,

If you would like to add it another debugger, you might find some problems. I created a fix for adding support for instance to setup Valgrind. The changes are waiting for CR in PR:

https://github.com/ThrowTheSwitch/Ceedling/pull/749

Feel free to ping me if something will not work for you.

lukzeg avatar Mar 20 '23 23:03 lukzeg

The latest pre-release of Ceedling includes robust support for dissecting and reporting crashed tests. :project:use_backtrace recognizes :none, :simple, and :gdb. Ceedling defaults to :simple. If :gdb is selected (and gdb is installed), Ceedling extracts the most important lines from the backtrace report and presents them in a nicely packaged console report when using report_tests_pretty_stdout plugin. See the Release Notes and Ceedling Packet for details.

The full backtrace can be viewed with debug verbosity. Valgrind support is still in the backlog to be incorporated as a plugin.

mkarlesky avatar Jun 13 '24 14:06 mkarlesky