ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Is there a way to debug unbalanced ImGUI calls? Expecting IM_ASSERT_USER_ERROR but instead get silence

Open FireFox2000000 opened this issue 2 years ago • 3 comments

Hello, I'm currently investigating ways to debug and/or prevent user errors for my project. Currently any api balancing errors are just silently ignored, I'm wondering if there's tools from the C# side of things to debug these kinds of user errors? Currently I'm using the library in a Unity project and so if there is automatic error handling it currently appears to be unable to be caught by Unity's debugger. Well, that is unless I make such a bad api call that Unity outright crashes instead. I see on the main repo that there's supposed to be a IM_ASSERT_USER_ERROR check on the C++ side however I'm not sure if that is or even can be forwarded back to the C# side. Would appreciate any tips or advice regarding this matter!

FireFox2000000 avatar Nov 30 '23 10:11 FireFox2000000

Compiling in debug mode is necessary for imgui asserts.

sonoro1234 avatar Nov 30 '23 11:11 sonoro1234

I once had to do the debugging, it was a painful experience. That is expected since there are 3 libs in 3 different languages that we are debugging.

I wrote my debugging experience in the readme ( url below ), please try it out and feel free to create PR to improve the debugging experience.

https://github.com/ImGuiNET/ImGui.NET#debugging-native-code

Other than that, I have also used render doc, pretty awesome tool and works flawlessly out of box.

zaafar avatar Nov 30 '23 18:11 zaafar

Compiling in debug mode is necessary for imgui asserts.

No need to debug at all, program will assert when compiled in debug mode.

sonoro1234 avatar Nov 30 '23 18:11 sonoro1234