-
-
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
Demo window crash when clicking "Show Item Picker" #7146
Comments
If you hover the question mark, it says: This is not actually a crash, the help text just says that because it is indistinguishable from one if you are not debugging. That is basically the intended function. You activate the picker, then click the item you want to inspect, then ImGui halts program execution when the application commits that item the next time. Within the debugger, you can then step through the instructions, inspect local variables and so on. Without a debugger attached... well, maybe that tool could be deactivated if no debugger is attached, but I don't know how to detect that in a platform agnostic way. |
Closing as answered. Thank you Daniel.
This is how imgui_test_engine does it: bool ImOsIsDebuggerPresent()
{
#ifdef _WIN32
return ::IsDebuggerPresent() != 0;
#elif defined(__linux__)
int debugger_pid = 0;
char buf[2048]; // TracerPid is located near the start of the file. If end of the buffer gets cut off thats fine.
FILE* fp = fopen("/proc/self/status", "rb"); // Can not use ImFileLoadToMemory because size detection of /proc/self/status would fail.
if (fp == NULL)
return false;
fread(buf, 1, IM_ARRAYSIZE(buf), fp);
fclose(fp);
buf[IM_ARRAYSIZE(buf) - 1] = 0;
if (char* tracer_pid = strstr(buf, "TracerPid:"))
{
tracer_pid += 10; // Skip label
while (isspace(*tracer_pid))
tracer_pid++;
debugger_pid = atoi(tracer_pid);
}
return debugger_pid != 0;
#else
// FIXME
return false;
#endif
} One problem we have is that this is one of the most useful Dear ImGui debug tools, and yet it is largely under-discovered by people. If it required an opt-in I suppose we should add such application-fed signal, and wire it to "Demo->Tools->Item Picker" with the item greyed with a message of how to enable + message stating it can always be accessed from Metrics. |
Version: 1.89.7-1.90
Branch: everything I tried
I tried Demo, all backend. Compiled 1.90 with different options. I got this bug everywhere.
Operating System: Windows
When I launch the demo window.
When going to Tools - Metrics/Debugger - Tools
I click "Show Item Picker" and if I click again.
This will crash the application. The crash also occurs if: After checking the "Show Item Picker" checkbox. I'll put a tick in the checkbox somewhere else.
It crashes in absolutely everything I tried from 1.87.9 (demo) to 1.90
The text was updated successfully, but these errors were encountered: