mirror of
https://github.com/ocornut/imgui.git
synced 2025-02-26 06:48:26 +01:00
Debug Break Buttons
parent
22ac56ae33
commit
a05269eed3
@ -4,18 +4,25 @@
|
||||
- [Debug Configuration Flags](#debug-configuration-flags)
|
||||
- [Metrics/Debugger window](#metricsdebugger-window)
|
||||
- [Debug Log](#debug-log)
|
||||
- [Debug Break Buttons](#debug-break-buttons)
|
||||
- [ID Stack Tool](#id-stack-tool)
|
||||
- [Item Picker](#item-picker)
|
||||
- [UTF-8 Encoding Viewer](utf-8-encoding-viewer)
|
||||
|
||||
----
|
||||
|
||||
### Debug Configuration Flags
|
||||
## Debug Configuration Flags
|
||||
|
||||

|
||||

|
||||
|
||||
Runtime flags available in `ImGuiIO` (and exposed in Demo->Configuration):
|
||||
```cpp
|
||||
// Option to enable various debug tools showing buttons that will call the IM_DEBUG_BREAK() macro.
|
||||
// - The Item Picker tool will be available regardless of this being enabled, in order to maximize its discoverability.
|
||||
// - Requires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.
|
||||
// e.g. io.ConfigDebugIsDebuggerPresent = ::IsDebuggerPresent() on Win32, or refer to ImOsIsDebuggerPresent() imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version).
|
||||
bool ConfigDebugIsDebuggerPresent; // = false // Enable various tools calling IM_DEBUG_BREAK().
|
||||
|
||||
// Tools to test correct Begin/End and BeginChild/EndChild behaviors.
|
||||
// Presently Begin()/End() and BeginChild()/EndChild() needs to ALWAYS be called in tandem, regardless of return value of BeginXXX()
|
||||
// This is inconsistent with other BeginXXX functions and create confusion for many users.
|
||||
@ -25,14 +32,13 @@ bool ConfigDebugBeginReturnValueLoop; // Some calls to Begin()/BeginChild() will
|
||||
|
||||
// Option to deactivate io.AddFocusEvent(false) handling. May facilitate interactions with a debugger when focus loss leads to clearing inputs data.
|
||||
// Backends may have other side-effects on focus loss, so this will reduce side-effects but not necessary remove all of them.
|
||||
// Consider using e.g. Win32's IsDebuggerPresent() as an additional filter (or see ImOsIsDebuggerPresent() in imgui_test_engine/imgui_te_utils.cpp for a Unix compatible version).
|
||||
bool ConfigDebugIgnoreFocusLoss; // Ignore io.AddFocusEvent(false), consequently not calling io.ClearInputKeys() in input processing.
|
||||
|
||||
// Options to audit .ini data
|
||||
bool ConfigDebugIniSettings; // Save .ini data with extra comments (particularly helpful for Docking, but makes saving slower)
|
||||
```
|
||||
|
||||
### Metrics/Debugger window
|
||||
## Metrics/Debugger window
|
||||
|
||||
Access the Metrics/Debugger window via `Demo->Tools->Metrics/Debugger` or by calling `ShowMetricsWindow()` from your code.
|
||||
|
||||
@ -45,7 +51,7 @@ Many internal state and tools are exposed in the Metrics window. They will help
|
||||

|
||||
_Some of the debug tools_
|
||||
|
||||
### Debug Log
|
||||
## Debug Log
|
||||
|
||||
Access the Debug Log window via `Demo->Tools->Debug Log` or `Metrics->Tools->Debug Log` or by calling `ShowDebugLogWindow()`. Also see [#5855](https://github.com/ocornut/imgui/issues/5855).
|
||||
|
||||
@ -64,7 +70,27 @@ Inside the log, if you hover an ImGuiID identifier (formatted as `0xXXXXXXXX`) i
|
||||
|
||||

|
||||
|
||||
### ID Stack Tool
|
||||
If `io.ConfigDebugIsDebuggerPresent` is enabled, an additional tooltip will appear after some time:
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
## Debug Break Buttons
|
||||
|
||||
When `io.ConfigDebugIsDebuggerPresent` is enabled, various `**DebugBreak**` buttons will appears in debug tools. Clicking them will attempt to break you in debugger in the desired location:
|
||||
- Request a debug break in a Begin() call.
|
||||
- Request a debug break in a ItemAdd() call via debug log and hovering 0xXXXXXX identifiers.
|
||||
- Request a debug break in a BeginTable() call.
|
||||
- Request a debug break in a SetShortcutRouting()/Shortcut() call. [Internal]
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
In the Debug Log you can also hover a 0xXXXXXXXX identifier and press the `Pause/Break` keyboard key to attempt to break in the ItemAdd() function for this item.
|
||||
|
||||
## ID Stack Tool
|
||||
|
||||
https://github.com/ocornut/imgui/issues/4631
|
||||
|
||||
@ -74,7 +100,7 @@ ImGui::ShowIdStackToolWindow();
|
||||
|
||||

|
||||
|
||||
### Item Picker
|
||||
## Item Picker
|
||||
|
||||
https://github.com/ocornut/imgui/issues/2673
|
||||
|
||||
@ -83,7 +109,7 @@ You can find it in _Metrics>Tools>Item Picker_ or expose it in your own UI by ca
|
||||
|
||||

|
||||
|
||||
### UTF-8 Encoding Viewer
|
||||
## UTF-8 Encoding Viewer
|
||||
|
||||
See https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#about-utf-8-encoding
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user