LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

strange execution highlight - 2013sp1

Solved!
Go to solution

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?

S. Eren BALCI
IMESTEK
0 Kudos
Message 1 of 9
(4,911 Views)

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.

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 9
(4,902 Views)

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.

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 9
(4,891 Views)

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

0 Kudos
Message 4 of 9
(4,882 Views)
Solution
Accepted by topic author ebalci

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

Message 5 of 9
(4,858 Views)

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? 😉

S. Eren BALCI
IMESTEK
0 Kudos
Message 6 of 9
(4,850 Views)

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

0 Kudos
Message 7 of 9
(4,813 Views)

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?

S. Eren BALCI
IMESTEK
0 Kudos
Message 8 of 9
(2,407 Views)

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.

 

S. Eren BALCI
IMESTEK
0 Kudos
Message 9 of 9
(2,402 Views)