-
Notifications
You must be signed in to change notification settings - Fork 126
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
Toggle breakpoint at begin scopes #1368
base: master
Are you sure you want to change the base?
Conversation
I recommend using this only when both are satisfied: A similar feature was in another debugger 20 years ago. |
I should note that for some reason bp's at { get moved down to the first command unlike in VS where they stay on {'s. |
We do explicitly ensure there's always an instruction (even just a NOP) at the closing brace of a block - that's so if you have something like {
int a = GetVal();
} then you can step over the variable declaration and actually see its value (since it's still in scope). That's something Visual C++ (not clang) do not do. C# does that, however, and also ensures an instruction on the opening brace. We could do that as well, but I didn't really see the use. What is the use case of adding a breakpoint to the start of every single block? |
When you know a certain large file has something you want to understand better and is being called from elsewhere but you don't know where to put a BP. Using API logger would be a 'sort of' alternative to this but I don't see any API logging/tracing features, are there any? Also I didn't see any documentation on how to use "symbol breakpoints", like, do you put a filename as a symbol breakpoint to break on entry to anywhere in that file? |
Symbol breakpoints let you manually specify a symbol name. IE: For your use case you probably actually want to have a logging breakpoint rather than a normal breakpoint. With "Log String" you can add params in there as well, ie: I don't even know if there's a way to do something like that for C#, is there? |
This idea doesn't come from C# debugger but OllyDbg which had some advantages over VS debugger back in 2002. With OllyDbg you can get a list of all symbols and rapidly add BPs or log/trace on entry to all of them by first clicking "search for all intermodular calls" then selecting the first found one (of interesting destination) and holding F2 pressed, it would add BPs to every call entrypoint on the search list. So my impl. is not identical but achieves same effect. I did a "find in files" for "Log String" and it didn't come up with anything of interest and I don't need the parameters if I have proper BP's (first set BP to everything in a file with a toggle, then run and watch which BP's get hit, then use toggle again to remove them and add manual BP to points of interest you discovered and then watch parameters or whatever). |
Added new command that toggles breakpoint(s) at begin of scopes. Not bound by default.