Author |
Topic |
|
tplan
Junior Member
10 Posts |
Posted - Sep 27 2007 : 03:44:16 AM
|
Doing a find references for symbol y in the code below will result in two hits, the declaration and the reference in the if-clause. However, the third occation (when used as an argument) is not reported!
void test2(int y) {}
void test()
{
int *y; // Found
if (y) // Found
test2(*y); // Not found!
}
I'm using version 1561 with VS 2003, having "Get content from default Intellisense" turned off.
|
|
steinsomers
Ketchup Master
Belgium
65 Posts |
Posted - Sep 27 2007 : 09:12:59 AM
|
It does find all three on version 1559 on VS 2005 SP1 with "Get content from default Intellisense" turned on. Still I hardly ever use "Find References" because it overlooks a lot of instances in my experience. |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 27 2007 : 10:06:17 AM
|
tplan VA is finding all 3 references for me as well.
steinsomers Find References is supposed to be very reliable. What sort of code are you seeing problems with? Would you be able to post a code sample that shows the sorts of problems you are seeing? |
zen is the art of being at one with the two'ness |
|
|
holedigger
Whole Tomato Software
145 Posts |
Posted - Sep 27 2007 : 10:13:27 AM
|
I'm only seeing two references using the code above (VS2005/vista/1609).
If I remove the * from test2(*y), then it finds all three.
|
Whole Tomato Software |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 27 2007 : 10:26:17 AM
|
feline: That's odd, since I can reproduce this every time:
1. Create a new project (empty, win32 console project) 2. Add a new cpp-file 3. Copy and paste the code in my original post 4. Position the cursor between y and ; in the declaration of y and press "find references".
=> "Found 2 references in 1 file to: y"
What's really (really!) strange however is that if I rename the variable (manually) from y to x and do a new search, all three occurances are found. Changing back to y and only two are found again!..
I don't know if this have anything to do with the bug, but the definition combo (right next to the Go button) display different things depending on the name of the variable. When I position the cursor on the third line ("test2(*y<cursor>);" and the variable is called y, the combo displays "__cdecl operator *(const long double&, const complex<long double>&)", but if i rename the variable to x, the combo shows "int *x".
|
Edited by - tplan on Sep 27 2007 10:27:07 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 27 2007 : 12:24:24 PM
|
*puzzled* I have this working correctly on one machine running VA 1609, and failing on a second machine running VA 1609.
I need to run some tests, to try and find out what is going on here. |
zen is the art of being at one with the two'ness |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 27 2007 : 1:15:17 PM
|
holedigger and tplan, can both of you please go to:
VA Options -> About -> Copy Info
and paste the details (from the clipboard) into this thread. I have the same VS2005 project (copied via a network share) on two different machines. Both are using VS2005 and VA 1609. One shows this problem, and one shows no problem.
I have the test in two different files in the same project, it works or fails in both files, so project and context do not seem to be the trigger. I am currently suspecting it is somehow related to stable include directories. Hence my interest in what you two have set, so I can compare it with my two sets. So far Boost, or possibly Qt are looking like candidates for causing this odd behaviour, neither of which makes much sense.
tplan I am seeing differences to your experience, specifically it fails for me with this renamed code:
static void testCallingWithStar(int nFoo) {}
static void callFunctionWithStarInFrontOfVariable()
{
int *localY; // Found
if (localY) // Found
testCallingWithStar(*localY); // Not found!
}
Can you try this please, and see what happens on your system? |
zen is the art of being at one with the two'ness |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 27 2007 : 2:12:51 PM
|
feline: The code you posted fails for me as well. But if you rename localY to x, the search will work!
VA_X.dll file version 10.3.1561.0 built 2007.09.13
VAOpsWin.dll version 1.3.2.7
VATE.dll version 1.0.6.1
DevEnv.exe version 7.10.6030.0
msenv.dll version 7.10.6030.0
Font: Courier New 13(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
4 processors
Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Platform SDK\\Include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\wtl75\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include\\prerelease;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include;
C:\\boost\\boost_1_33_1;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\loki\\MSVC\\1300;
Library Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\crt\\src;
Other Includes:
|
Edited by - tplan on Sep 27 2007 2:14:28 PM |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 27 2007 : 4:21:28 PM
|
tplan can you press the button:
VA Options -> Performance -> Rebuild symbol databases
and then restart your IDE place?
I cannot make this test fail on the machine where it works, and having done this the test now works correctly on the machine where it used to fail. |
zen is the art of being at one with the two'ness |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 28 2007 : 01:50:35 AM
|
Ok, now I've rebuilt the symbol database. After restarting the IDE, I loaded the little test project (containing nothing but the code in my post). This time, VA did find all three references!
However, if I close the test project and open up my real solution (containing a lot of boost includes), and then open the test project again, the search will fail. So, it seems like there is some header that messes up VA:s symbol database (making it belive that the * is a __cdecl operator *(const long double&, const complex<long double>&) rather than a dereferenced pointer). |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 28 2007 : 1:33:13 PM
|
With the caret on this problem variable, and this information showing in the definition field can you press alt-g please, and see where this takes you?
Hopefully this will tell us which boost header is causing the problem. Having "fixed" it here I am not sure how to get back to seeing the problem. |
zen is the art of being at one with the two'ness |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 29 2007 : 05:50:47 AM
|
Alt-G gives a rather long list containing:
viewoled.cpp:130 crt\\src\\instances.cpp:329 crt\\src\\instances.cpp:330 ... (7 more occations in instances.cpp) include\\xcomplex:669 include\\xcomplex:667 ... (10 more in xcomplex)
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 29 2007 : 12:17:49 PM
|
So much for that plan.
Do you have any boost includes in the file where you are seeing this problem in your main solution? If so would you be able to post those include lines? This might be to "easy" but it is worth a try.
I am currently trying to find which boost headers have this operator in them, but progress is slow. A simple text search is not returning any matches, so I need to play around with some regular expression searching instead. |
zen is the art of being at one with the two'ness |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 29 2007 : 5:43:01 PM
|
My main solution contains a lot of projects and now I've found which one of these causing the bug to occur (adding this project to the test solution will cause the search to fail). I tried adding all unique includes from the project causing the bug to the test cpp-file, but the search still succeeds. However, as soon as I add the project to the test solution, the search start to fail. When I add the project, VA parses some additional files, but their names flashes so fast in the status bar that I can not see them. Is there any way to get some list of parsed files? |
|
|
tplan
Junior Member
10 Posts |
Posted - Sep 30 2007 : 06:01:14 AM
|
Ok, now I found which include causing the trouble. When I add this line to my test project, the bug starts to occur:
#include <complex>
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Oct 01 2007 : 4:29:34 PM
|
Thank you for your detective work! Simply adding the header file is enough to make this fail for me as well:
case=9155
No wonder I was not making much progress with boost, this is nothing to do with boost. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|