-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
IM_DEBUG_BREAK #7260
Comments
You can programmatically perform the check to not have to rely on debugger-provided condition or features. e.g. if (GDB__BREAK == 1)
printf(""); // <--- put breakpoint here or call IM_DEBUG_BREAK(); Assuming support for live update of C++ code (edit & continue, live++ etc.) you can add complex conditional breakpoints in a live app anywhere. I frequently use keyboard modifiers as way to activate a breakpoint: |
@noncopyable could #7266 be a fix to the issue you were speaking of? |
hello @Peter0x44. hello @ocornut. |
Closing as answered. Thank you both for your feedback. |
(keeping on the off-topic derailment, I'm still using Visual Studio myself, but those new debuggers have interesting features see, e.g. https://www.youtube.com/watch?v=r9eQth4Q5jg) https://remedybg.itch.io/remedybg https://github.com/EpicGames/raddebugger |
Yeah, gdb is unfortunately a bit more flaky and unreliable than it should be. It's completely serviceable, and I don't mind using it, but much better is possible. Python is also one thing I don't like about gdb. Libstdc++ specifically ships some python scripts that are required to usably print say, an std::string. Certain features of gdb are quite slow, like the breakpoint conditions. The remedybg author specifically wrote in some issue that he didn't want to port to Linux so it will likely never be an option. Rad debugger isn't there yet, but I'm waiting eagerly. |
do not taunt me. if i start ranting (with this terrible english) on the sorry state of this ape world we call programming, i would be banned on github as well :) |
Version/Branch of Dear ImGui:
none
Back-ends:
none
Compiler, OS:
none
Full config/build information:
No response
Details:
i thought i should share this since i had this specific problem and there wasn't anything usefull, then a friend told me about c++26 std::breakpoint and that page had a link to IM_DEBUG_BREAK.
i have a more flexible workaround for this and some impossible cases where you want to enable a breakpoint without halting debugger or adding new code.
/// core.hpp
#ifdef DEBUG
extern int GDB__BREAK;
#endif
/// core.cpp
#ifdef DEBUG
int GDB__BREAK = 0;
#endif
/// in gdb
break file/fn/line... => (breakpoint-id 1)
break file/fn/line... => (breakpoint-id 2)
condition 1 GDB__BREAK==1
condition 2 GDB__BREAK==10
now we can either bind GDB__BREAK to a key or modify it with InputInt, rest should be obvious.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: