04-10-2014 03:44 AM - edited 04-10-2014 03:54 AM
Hi,
I just installed CVI 2013SP1 and opened a project I have been working on lately.
I had last saved in version 8.5.1.
The project got opened/built/executed fine.
But when I put some breakpoints and debug the code the highlighted execution trace looks strange.
See different local screenshots attached.
Some editor preferences that may be related: tab length = 2 / bracket style = allman / last 2 of the 3 checkboxes are active in the Tabs region of Editor Preferences dialog.
If I open a sample project from built-in examples (Intgraph for instance) I observe the same behaviour.
Closing/re-opening the CVI IDE or "clean"ing and "rebuild"ing does not make any difference.
Is this a known issue already?
Solved! Go to Solution.
04-10-2014 05:43 AM - edited 04-10-2014 05:44 AM
I tried a few more example projects (Clock, Counter and Tank).
The highlight looks normal when the execution is single-stepped through their code.
I cannot figure out the difference between those projects to result in such a behaviour.
04-10-2014 06:38 AM
I still do not know why it is happening, but I think I formulized the behavior.
If the line to be executed is indented by N tab lengths, then the execution highlight outline is shorter by N characters from the left.
04-10-2014 10:26 AM - edited 04-10-2014 10:37 AM
Hello Eren,
There isn't a know issue yet about this but I have a workaround for you.
The culprit is 'Expand tabs to spaces when saving files' option in Editor Preferences
The workaround is to close the file and open it again.
If you use 'Expand tabs to spaces when saving files' option you might want to have also 'Expand TAB key to spaces' checked. In this case you don't have to reload the file each time you type tabs.
Constantin
04-11-2014 09:58 AM
Hello Eren,
I've read more carrefully your post and I saw you wrote that last 2 of the 3 checkboxes are active in the Tabs region.
Indeed, in this case the highlight is always bouguous, even if you reload the file.
You don't see the wrong behaviour on the examples because the files are indented with tabs and you don't save the files to replace the tabs with spaces. If you make a small modification to a file and debug again you will see this behaviour because the file is saved with spaces.
The debugger uses the saved file which contains sapces while the editor considers there are tabs in there and hence the wrong highlight.
Unfortunatelly there isn't a workaround for this case, the only solution is to un-check 'Convert leading spaces to tabs when loading files'
I apologise for the inconvenience.
Constantin
04-11-2014 11:59 AM
Hi Constantin,
Thank you for spending more time on that..!
I am almost sure 8.5.1 does not behave such problematicly.
I have been using it for years with those settings and did not observe such a thing.
I installed 2013sp1 next to 8.5.1 and it probably copied the applicable settings from there, because the settings was so when I opened the Editor Pref dialog, and I am sure again "last 2 options ticked" is not the default setting.
What do you think, does it deserve to be fixed? 😉
04-15-2014 06:22 AM
Hello Eren,
Of course, this neeeds to be fixed because it is a bug. We have bug number for this.
It was introduced in 2013. In earlier versions there was a similar problem but very unlikely to happen.
In the default settings the 3 ckeckboxes under Tabs section are not checked and tab length is 4.
Constantin
10-04-2019 04:24 AM
Hello Constantin,
I could not find that bug number in release notes of the newer versions.
Maybe you have access to a global list. Can you check whether 2019 has this problem or not?
10-04-2019 04:33 AM
Well, I think 2019 fixes the bug, but the bug number is different than what you reported:
470220: Enabling both the Expand tabs to spaces when saving files and Convert leading spaces to tabs when loading files Editor Preferences options causes the current line statement to be highlighted incorrectly when debugging.