Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Implementation in multiple cpp files -> VA broken
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

stifu
New Member

9 Posts

Posted - Sep 10 2020 :  05:19:01 AM  Show Profile  Reply with Quote
Some people at work like to spread an implementation accross multiple cpp files (likely to get a little structure into their mess of a code :-D ). This practice seems to break a lot of features of VA. Most notably, "Find all references" very frequently says "symbol is unrecognized". Text-highlighting is also affected.


Here is my version info:
VA_X.dll file version 10.9.2341.2 built 2019.08.05
DevEnv.exe version 8.0.50727.42 Professional
msenv.dll version 8.0.50727.42
Font: Consolas 13 (pixels)
Comctl32.dll version 6.10.18362.1016
Windows 8 6.2 Build 9200
8 processors (x86-64, WOW64)
Language info: 1252, 0x407

Edited by - stifu on Sep 10 2020 05:27:14 AM

stifu
New Member

9 Posts

Posted - Sep 10 2020 :  05:44:28 AM  Show Profile  Reply with Quote
I just realized the Visual Studios built-in "Find all references" yields the correct result. What is most surprising about this is that I even have VA configured to use the intellisense database, so they should be working the same way.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Sep 10 2020 :  06:29:10 AM  Show Profile  Reply with Quote
Splitting the implementation across cpp files should not cause any problems like this, but obviously something is going wrong here.

First just to double check, when you see this problem, does the code actually compile inside the IDE? Or are you using an external compiler? I am just checking that the code is "normal", so we should expect VA to handle this and to just work correctly.

What sort of symbols are you seeing "symbol is unrecognised" with? The class name? Member function names? Member variables? Is this in one of the split cpp files, the central header file, both?

Are all of the cpp files in the same project? I am just trying to think of anything that might explain why VA is having a problem.

VA's Find References is doing a code aware search, so we try to work out the type of local variables, so we can tell if a member function being called is the member function you want, or a different function from a different file. This is rather different from a simple "search all files for this string" which is probably what you are doing with the IDE's Find.

zen is the art of being at one with the two'ness
Go to Top of Page

stifu
New Member

9 Posts

Posted - Sep 10 2020 :  09:44:50 AM  Show Profile  Reply with Quote
Thanks for the quick answer.

* We have solutions for VS2005 and VS2017. Both compile fine and exhibit the same behavior.
* typedefs, class names, member functions and member variables are affected by this misbehavior.
* It only happens in any of the split cpp files or its associated header. For classes of this project with just one cpp file, it works just fine.
* All cpp files are in the same project.
* If I look at the header file, almost all members are printed in bold letters, as if they were local variables.
* I am specifically not using a simple text based find, but the "Find all References" feature of the IDE. Both VS2005 and VS2017 show the expected result when executing the command, but when I execute it from Visual Assist, I get the "symbol unrecognized" message.

Further info:
* I have deep macro parsing enabled
* A moment ago, it suddenly worked again in VS2005. Then I restarted VS and it didn't work anymore.

I will try to create a minimal sample to demonstrate the issue.

Edited by - stifu on Sep 10 2020 09:54:50 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Sep 10 2020 :  12:10:42 PM  Show Profile  Reply with Quote
If you would be able to send me one of the header files and the matching, split cpp files, for testing purposes, I can try to make sense of what is happening for you. I appreciate this is often not possible, but it's worth mentioning in case it is an option. If you want to do this please send me the files via email:

support@wholetomato.com

including this thread ID or URL in the description, so we can match it up.

It sounds almost like VA is not parsing / understanding the header file correctly, and the other problems follow on from this. If you look at VA Outline or the Alt-M list, are you getting reasonable results for the header file?

I am wondering if heavy use of macros is somehow confusing our parser.

zen is the art of being at one with the two'ness
Go to Top of Page

stifu
New Member

9 Posts

Posted - Sep 11 2020 :  03:26:45 AM  Show Profile  Reply with Quote
So I have done a few more tests and finally found the culprit: LimitMacro = "NoDepthLimit".

I had setup "NoDepthLimit" and deep macro parsing because I wanted to get VA to show proper results when using BOOST_TEST, which had been described in this thread: https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=8594
Now that I have reset LimitMacro to "No", everything works fine again.

I have also tried merging all cpps into one giant 10,000 lines file and disabled deep macro parsing, but these changes did not show any effect. Only LimitMacro did.

FYI, VA Outline and the alt-M list produced reasonable results for the header, even with the malicious LimitMacro setting.

If you want to further debug why NoDepthLimit leads to this issue, I can assist you with that, but I am afraid I won't be able to send you any code.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Sep 11 2020 :  07:40:00 AM  Show Profile  Reply with Quote
Interesting, thank you for the update. With the NoDepthLimit turned off, are you still seeing problems with the BOOST_TEST macros? If so, can you provide a simple example of the sort of problems you are seeing, and I will see if we can find a different, and more reliable solution for these macros.

zen is the art of being at one with the two'ness
Go to Top of Page

stifu
New Member

9 Posts

Posted - Sep 16 2020 :  4:20:10 PM  Show Profile  Reply with Quote
"Enhance Macros" helps a little with BOOST_TEST macros, even without "NoDepthLimit". It's not perfect, but it works well enough. If I should eventually be fed up with it, I will try to setup macro defines in the VA stdafx.h, so I won't need any more support for now, thanks.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16947 Posts

Posted - Sep 17 2020 :  06:31:44 AM  Show Profile  Reply with Quote
Thank you for the update. Obviously if you want or need any help with this then please just ask. I personally haven't used the BOOST_TEST macros, so I don't have a good test case on hand, but if you have a couple of examples, I can try and find a good work around for you.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000