I am debugging an application to fix a segmentation error, which I suspect is caused by a race condition.
I would like to add some instructions for printing to the code, but I know that adding calls to is printfnot recommended, as this can change the behavior of threads and in some cases hide the error.
If you look at other options, I saw that with gdb you can use breakpoints to print, and then automatically continue execution:
break foo
commands
silent
printf "Called foo: x is %d\n",x
cont
end
Is this better than putting printfin my code?
I know that gdb also has Tracepoints , but they only work with gdbserver, and this is an additional level of complexity that I would prefer to avoid at the moment.
Additional Information: The application is written in C and runs on Linux.
Muffo source
share