User forums > Using Code::Blocks
debugger plugin's tip windows does not show content with horizontal scroll bar
ollydbg:
--- Quote from: Pecan on October 29, 2025, 05:42:15 am --- Is there any way you could tell me what "auto" actually is or give me an example as to how to re-create the situation you're showing here?
--- End quote ---
You can simply do this:
1, clone the code repo or download the zip file: asmwarrior/parserlib: A c++ recursive-descent PEG parsing library that supports left recursion..
2, open the cbp project in the root folder: https://github.com/asmwarrior/parserlib/blob/master/test_parser_lib.cbp
3, open the file: cpp_lexer_grammar.h in the C::B editor
4, you can use clangd_client, and use the mouse to hover the "token" variable in the line 172
5, you will see a very big tip window which cover the whole screen, note I only tested on Windows 10 OS.
Thanks.
Pecan:
Here is Gemini-CLI's evaluation of the problem.
--- Quote ---| SearchText 'ShowValueTooltip' within src |
| |
| Found 13 matches |
ShowValueTooltip is called from two key locations. First, sdk/ccmanager.cpp checks if a tooltip can be shown when the user hovers over a
variable. If so, a command is sent to GDB. After GDB returns the variable's value, the GDB command in plugins/debuggergdb/gdb_commands.h calls
ShowValueTooltip a second time to actually display the tooltip. The call chain starts with CodeCompletionManager, goes through the debugger
plugin, gets the value from GDB, then DebuggerManager, and finally DebugInterfaceFactory creates the tooltip window. The key call sites are
sdk/ccmanager.cpp and plugins/debuggergdb/gdb_commands.h.
[pecan prompt ]There is a problem when the debugger shows a single line value that is too long and hits the right side of the display. The bottom scroll bar
overlays the value being displayed. The window created is not tall enough to contain both the value and the bottom scroll bar. I want to know
where the window is created and why it isn't tall enough.
[Gemini response]
The value tooltip window sizing appears faulty, obscuring long text with a scrollbar. I'll investigate src/src/watchesdlg.cpp, focusing on the
ValueTooltip class, especially GridSetMinSize and UpdateSizeAndFit functions, and the usage of wxPopupWindow and wxScrolledWindow. I suspect a
height miscalculation in GridSetMinSize or an incorrect virtual size setting. My first step is to reread src/src/watchesdlg.cpp.
| ReadFile src\src\watchesdlg.cpp |
| |
After re-reading src/src/watchesdlg.cpp and analyzing the ValueTooltip class, I've pinpointed the sizing issue.
ValueTooltip Sizing Analysis
The ValueTooltip window is created in its constructor and sized primarily by the GridSetMinSize function. This function calculates the necessary
height and width for the wxPropertyGrid that displays the value.
The issue lies in how the height and width are determined, especially when a horizontal scrollbar is needed.
Height Calculation: The window's height is determined by the content of the wxPropertyGrid.
Width and Scrollbar: When the text content is too wide for the display, GridSetMinSize correctly calculates that a horizontal scrollbar is
needed and sets a virtualWidth.
The Flaw: The crucial oversight is that after deciding to add a horizontal scrollbar, the function does not increase the calculated height of
the window to accommodate the scrollbar itself.
Conclusion
Where the window is created: The ValueTooltip window is created in its constructor within src/src/watchesdlg.cpp.
Why it isn't tall enough: The sizing logic in the GridSetMinSize function in the same file fails to account for the vertical space taken up by
the horizontal scrollbar when it becomes necessary for long lines of text. The window is sized for the text only, so the scrollbar ends up
drawn on top of the last line of text.
To fix this, the code would need to be modified to add the height of a horizontal scrollbar to the total height of the ValueTooltip whenever one
is displayed.
--- End quote ---
I'll follow up on this.
ollydbg:
Thanks.
Al is so smart to analysis long code. It has a very large memory. I think it is at least better than me.
Pecan:
--- Quote from: ollydbg on October 29, 2025, 12:39:04 pm ---
--- Quote from: Pecan on October 29, 2025, 05:42:15 am --- Is there any way you could tell me what "auto" actually is or give me an example as to how to re-create the situation you're showing here?
--- End quote ---
You can simply do this:
1, clone the code repo or download the zip file: asmwarrior/parserlib: A c++ recursive-descent PEG parsing library that supports left recursion..
2, open the cbp project in the root folder: https://github.com/asmwarrior/parserlib/blob/master/test_parser_lib.cbp
3, open the file: cpp_lexer_grammar.h in the C::B editor
4, you can use clangd_client, and use the mouse to hover the "token" variable in the line 172
5, you will see a very big tip window which cover the whole screen, note I only tested on Windows 10 OS.
Thanks.
--- End quote ---
For me cpp_lexer_grammar.h has no line 172 and I cannot figure out how to get any large response from hovering over a variable in any of the code.
Pecan:
--- Quote from: ollydbg on October 28, 2025, 06:13:07 am ---Not the debug tip window, sometimes, the code completion tip(from the clangd_client plugin) window becomes extremely large, see the blow two screen shot, the tip window cover the whole C::B window, also the tip window extended to another screen. :(
--- End quote ---
""
In settings>editor>CodeCompletion what have you got set for "Maximum allowed code completion matches" ?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version