-
Notifications
You must be signed in to change notification settings - Fork 77
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
Debugging with munit and visual studio code #90
Comments
outsider comment; feel free to ignore |
Yes, I did. What I'm trying to debug is the test themselves. Suppose a test fails, and I want to analyse the code from within munit test framework. I can't. The debugger runs through munit source code but doesn't run the functions in the test. So I can step through munit.c but I can't step through the functions in example.c. In example.c I can only step through this code `int main(int argc, char* argv[MUNIT_ARRAY_PARAM(argc + 1)]) {
I can't step through any of the test functions. such as these. I've created test by following a similar format. /* These are just to silence compiler warnings about the parameters
/* Let's start with the basics. */ return MUNIT_OK; This is what I need to do in order to debug the functions. Right now I'm using a separate driver program just for that which is labour-intensive and error-prone. |
If you don't mind me asking, what does your driver program look like? |
I'm an outsider aswell, but you can disable forking in munit by defining |
Here is what the GDB docs say about the issue: https://sourceware.org/gdb/onlinedocs/gdb/Forks.html So yeah, unless you have specific memory safety concerns, just disable forking like @Hixos mentioned or use the work around mentioned above. BTW, if anyone is confused about how to compile with no forking, just do this in your munit directory:
|
You can also run your driver program with the CLI option
|
Hi is there some setting you can use to debug with munit and visual studio code. Even if I compile with the -g flag, I can only step through the munit code and not the library I'm trying to build. How might one go about that? I now have to write a separate driver program in order to debug my code. It seems counter intuitive.
The text was updated successfully, but these errors were encountered: