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
 Refactoring / find references results broken
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vhuehn
New Member

Germany
6 Posts

Posted - Feb 01 2021 :  06:34:24 AM  Show Profile  Reply with Quote
This problem occurs using VS-2012 and VA-Version 10.9.2393.0

I have faulty results in the 'find all references' output-
For example in the screenshot the highlighted reference demonstrates the strange behaviour.

The va-reference displays the declaration of the (static) function.
CHoraTools::AddPO2AnimationList

So the reference should be preceded by CHoraTools, rather then 'GetConturID4_MAtID'

(GetConturID4_MAtID is another static function cHoraTools-Method, that is declared in Line 4007 of the same cpp-file.

Any Help would be very much appreciated

What could cause this problem?







feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 01 2021 :  11:39:41 AM  Show Profile  Reply with Quote
The result line should start with (10284), since the symbol before the line number is the scope, the "function" that the result is found inside.

If you show VA Outline for this cpp file, are the functions at the top level, or are they shown as children of something? A namespace would be an obvious possible parent node.

If you place the caret on line 10283, the blank line just above this function implementation, what does VA show in its context and definition fields? If VA thinks you are at file scope then it will show the file name and file path, as you are currently seeing in your screen shot. This is another way of checking to see if VA think that there is another layer of scope at work here.

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

vhuehn
New Member

Germany
6 Posts

Posted - Feb 02 2021 :  05:24:59 AM  Show Profile  Reply with Quote
@feline,
thanks for your help!!

As far as I can see, in VA-Outline the functions are at top-level.
your second question (context and definition fields). I'm not sure, what you mean, I hope, my screenshot is showing it all the same.




I have another example for a function where 'find all references' shows this behaviour, it's a function almost at the start of the file, so maybe this helps find the problem.


the function bGetSetRegIntern4Development this time is not a class method of hora_tools but just a function in the cpp-file




Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 02 2021 :  07:45:53 AM  Show Profile  Reply with Quote
That's odd, VA Outline and the Context and Definition fields all look correct and as expected.

If there was something "normal" in the code confusing our parser I would expect this problem to show up in VA Outline as well, so this is a little odd.

Can you please try making a new, default C++ console solution, and then copy just this cpp file "horatools.cpp" and its matching header file into the console solution, and see if you get the same problem there? I am trying to find out if this is a file specific problem, or a solution specific problem. Most of the #include lines won't work any more, in the new solution, so if this is caused by something in the main solution this might stop the problem from happening.

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

vhuehn
New Member

Germany
6 Posts

Posted - Feb 02 2021 :  10:15:10 AM  Show Profile  Reply with Quote
as you recommended, I created a new vs-studio projekt (console application) and added the horatools.cpp and horatools.h

==> and indeed, 'find all references' does then work as expected.

what I noticed also:
in the console-application, VA finds all references...

screenshot:
faulty original project on the left side, working console-app on the right:





Go to Top of Page

vhuehn
New Member

Germany
6 Posts

Posted - Feb 03 2021 :  07:07:18 AM  Show Profile  Reply with Quote
The vs-solution, where VA does not work as expected, is otherwise doing fine, compiling works etc.

So I'm wondering what I can do, to get this VA-feature working again.
'Find all references' is the main reason, why I'm employing VA...

Help would be very much appreciated!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 03 2021 :  08:04:47 AM  Show Profile  Reply with Quote
Thank you for the screen shots. I can assure you, this is a serious problem, and I am going to do everything I can to figure out what is going wrong here with you and get this fixed.

Looking at the difference in the results, when this fails, none of the calls to "readAndSetStandortData" have any form of scope applied. Can you please go to one of these calls, and see what you see? Are all of the calls inside member functions of the "CHoraTools" class? Or are they inside free functions, or members of a different class?

I am looking for any clues as to why VA is having this problem.

Are all of the missing calls surrounded by the two macros BUGDOGCATCHT and BUGDOGTRY, that are seen in your first screen shot?

If so, can you please try commenting these two macros out in one function, then re-run Find References, and see if the reference is then found?

What happens if you run Find References on one of the missing refences to "readAndSetStandortData"? I am half expecting VA to report that Find References is not available because the symbol is unrecognised.

If you right click in Find References Results and look at the context menu, is the setting "Display unknown/guess hits" On or Off? If this is Off, does turning this On make any difference?

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

vhuehn
New Member

Germany
6 Posts

Posted - Feb 03 2021 :  09:28:00 AM  Show Profile  Reply with Quote
@feline: thanks for your help, I appreciate it very much !!

Sorry, I'm not sure, whether I fully understand your first question (my native language is german....)
Hope this answers it all the same:
In this case all the calls missing in the 'find-all-references'-list are in member-functions of the static choratools class.
But I think this is not always the case when the find-all-references does not fully work.

No, the calls are not all surrounded by the BUGDOG-Defines.

When I run Find References on one of the missing references there is no such message, the list of results flickers shortly and then just displays the declaration and the definition as visible in previous screenshot.

When I right click in the Results and look at the cm I do not see the setting you mention
What I see is:



When I think about it, it seems to me, as if I have two problems here, I don't know whether related or not.
1./ scope is not always shown correctly (when not correct, the displayed scope seems to always be the first function in the respective file that contains the defines BUGDOGTRY and BUGDOGCATH) (when I remove these from the function that is displayed as scope, the results change to the next function where the defines are used when I refresh results.
2./ sometimes not all references are found.
At the moment I have the impression that this second problem only occurs with the functions in horatools.cpp . Not sure though.
There is one thing special about this file. This solution contains two projects and horatools.cpp is used in both of them

(I have an older Version of this solution in VS 2008 with VA, there neither of these problems occur, but the code is not the same anymore of course)








Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 03 2021 :  11:35:18 AM  Show Profile  Reply with Quote
The context menu entry "Display unknown/guess hits" is only shown if there are some unknown / guess entries to be shown. Since the function name is in the file, I would have expected VA to find it, and offer it as a guess entry.

Let's try sorting out the problem with the macros first, and see if fixing this has any effect on Find References. Can you please locate the directory where the SLN for your solution is stored.

Create a new text file called "va_stdafx.h" in the same directory as your SLN file. Edit this file and add the lines:

#define BUGDOGTRY
#define BUGDOGCATCHT

making sure that the file ends with a blank line.

When rebuilding its symbol database VA searches for this file, and if found, it parses it before parsing anything else. This file is used to give our parser helpful hints, and to work around odd problems that we encounter. The file should not be added to your solution, so it doesn't matter if the content of the file conflict with code inside your solution.

Having created and edited the file, in the IDE press the button:

VA Options -> Performance -> Rebuild symbol databases

and restart your IDE.

What effect, if any, does this have on the scope shown in Find References Results?

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

vhuehn
New Member

Germany
6 Posts

Posted - Feb 03 2021 :  12:43:30 PM  Show Profile  Reply with Quote
That helps!

Not only is the scope in Find References Results correct now (as far as I checked)
In addition the Results seem to be complete...

So you made me happy with VA again, thank you very much!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17186 Posts

Posted - Feb 04 2021 :  07:15:55 AM  Show Profile  Reply with Quote
Thank you for the update. Apparently these macros were causing quite a bit of confusion.

Since the "va_stdafx.h" is not part of the solution, and the IDE won't be aware of it, it is safe to add to source control, along with your solution, to make sure that you don't loose this helper file.

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