Hacker News new | past | comments | ask | show | jobs | submit login
Skipping Boring Functions in Debuggers (maskray.me)
65 points by ingve 4 months ago | hide | past | favorite | 5 comments



You can also make your own functions skippable by default with either the `[[gnu::artificial]]` or (the newer and more generalized) `[[gnu::nodebug]]` in GCC and Clang.


In .NET the https://learn.microsoft.com/en-us/dotnet/api/system.diagnost... DebuggerStepThroughAttribute has a similar purpose (though it's ignored if you disable the relevant feature)


__declspec(non_user_code) for those wondering about MSVC


For lldb, checkout the `sif` command. It lets you step into a specific function by name. If the current line is `doFunStuff(a(), b())`, and I want to step past the a and b functions, then I can step into doFunStuff by running `sif Fun`. You could type in the whole name but it works matches by substring.


You could also ctrl+click the function name and put breakpoint on the first line of the function body and press F9 to continue execution.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: