Author Topic: Display Value Under Cursor - window too small for int variables with short names  (Read 1091 times)

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
I am experiencing a problem with Display Value Under Cursor in the debugger.
Best explained with a screen capture, I think. It shows the whole program at one point in time.

In Frame 1, the variable under the cursor is x which is declared as "int x {1};"
The value window appears to be mostly a working horizontal scroll bar.

In Frame 2, The value of a variable m declared as a double is correctly displayed.

In Frame 3, when I increased the length of the int variable's name to 4 characters ("x123")  the value is readable and the scroll bar disappears.

In Frame 4, in the case of a loop control variable "i" a description of the variable "int main ::i" appears for a few milliseconds and then changes to what is shown.

Further experiment showed that if I assigned a value of 1234567890 to x, the value window would display "x 12345678 int"
It seems that the value window is not displaying short names with small values at all, and truncating larger values when the variable name is short.

I appreciate that adding variables to the watch window is the work-round for this.

Using version 20.03-r11983   Build: Mar 14 2020, 18:11:34 - wx3.1.3 - gcc 8.1.0 (Windows, unicode) - 64 bit
« Last Edit: April 14, 2020, 06:26:19 pm by oldieNewbie »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
OS and CodeBlocks versions please? What is the DPI of you monitor? Do you change global font sizes?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
Using version 20.03-r11983   Build: Mar 14 2020, 18:11:34 - wx3.1.3 - gcc 8.1.0 (Windows, unicode) - 64 bit
Windows 10 Home version 1909 OS build 18363.720
Display resolution 1920 x 1080
I have not changed global font size but did change the value tooltip font to Calibri Regular 10 in the Debugger Common Settings
I have just looked for a default font setting but cannot find one.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
Close CodeBlocks.
In AppData there should be a CodeBlocks folder and there a default.conf file.
Open it and find something like
Code: [Select]
<TOOLTIP_FONT>
<str>
<![CDATA[Comic Sans MS 8]]>
</str>
</TOOLTIP_FONT>

Delete this, start Code::Blocks and report if it fixes the problem.
Also remember the setting and post it here.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
I have done everything you suggested but it has not fixed the problem, in fact it has made it slightly worse, as the value 1234567890 is now displayed as 1234567, a digit shorter than before.
The text is visibly smaller in the value window that does display text (the reason I changed to Calibri 10).

I located
C:\Users\David\AppData\Roaming\CodeBlocks\default.conf
and made a copy before I deleted
Code: [Select]
<TOOLTIP_FONT>
<str>
<![CDATA[1;9.75;-13;0;0;0;400;0;0;0;0;3;2;1;34;Calibri]]>
</str>
</TOOLTIP_FONT>

Should I restore this code, or would uninstall and reinstall CodeBlocks be likely to fix the problem?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
... would uninstall and reinstall CodeBlocks be likely to fix the problem?
Nope.

Can you tell me which is the default font you use? Just open the font dialog and press cancel.
Also you've posted an image of the watches window which look seems to fine. Can you post the broken tooltip with the default font?

Could someone else try to reproduce the problem on Windows?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
CodeBlocks->General Settings->Editor Settings->Font->Choose = Courier New, Regular, 10
Reset Zoom of all editors to default, if leaving dialog = not checked

Tooltip Values of m and y are as shown in previous Watches.jpg

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
The font for this thing is set in Settings -> Debugger -> Common.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
Segoe UI, Regular, 7

Now that I've seen the name, I remember that's what it was before I chose Calibri 10.


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
Could someone else try to reproduce the problem on Windows?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
I have reproduced the problem exactly on a different computer, my HP laptop running Windows 10 Home Version 1809 Build 17763.109

I have tried to reproduce the problem using Code::Blocks 17.12 but the debugger seems to be missing from the SourceForge download of codeblocks-17.12mingw-setup.exe

That was the short Version of what I did.
Here follows the long version.

Laptop - Windows 10 Home Version 1809 Build 17763.109
Fresh installation of Code::Blocks 20.03 from FossHUB.
1) Changed nothing from installed defaults except checking the "Evaluate Expression Under Cursor" box.
2) Default Debugger Font noted as Segoe UI Regular 7.
3) Created a new Console Project, overwrote default "Hello World" program in main.cpp with text copy and pasted from Notepad++
4) Compiled and Ran program successfully.
5) Ran debugger to cursor as before.
Results were exactly the same.

I uninstalled Code::Blocks 20.03 with Revo Uninstaller Pro 4.3.0

I downloaded  Code::Blocks 17.12 from SourceForge and installed it.
Code::Blocks 17.12 rev 11256 gcc 5.1.0 32 bit
1) Changed nothing from installed defaults except checking the "Evaluate Expression Under Cursor" box.
2) Default Debugger Font noted as Tahoma Regular 7.
3) Created a new Console Project, overwrote default "Hello World" program in main.cpp with text copy and pasted from Notepad++
4) Compiled and Ran program successfully.
5) Debugging failed: No debugger Found.
6) Looked for gdb.exe using "Search Everything" - not present.

Noted that downloaded codeblocks-20.03mingw-setup.exe is 148,848 KB and codeblocks-17.12mingw-setup.exe is only 88,221 KB.
Am guessing that the debugger is missing from codeblocks-17.12mingw-setup.exe

If someone can tell me where to download it and where to put gdb.exe I will try running the debugger to see if anything changes. I need to do that in the next couple of days as Microsoft is about to force an update to Windows 10 version 1909 on my laptop.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
I don't intend to install windows 10 any time soon, so if you can't reproduce the problem on some kind of default version of windows 7 64bit, I'm not of much help. :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oldieNewbie

  • Single posting newcomer
  • *
  • Posts: 8
Thank you for your interest and help so far, oBFusCATed. I appreciate the time you've taken.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2817
I can reproduce this on windows... But i have absolute no idea about this part of the code....

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12789
    • Travis build status
The fun happens in watchesdlg.cpp:SetMinSize...
Can you check if the values look reasonable?
I guess something is skipped and the calculated size is smaller than the min possible for some of the columns and so this is the result.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Samuel

  • Guest
I had the same problem and managed to solve it as follows:

Settings > Debugger > Value Tolltip Font (Choose)

My source was less than the minimum available. That may be your problem.

I hope I can have helped you.