Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Issue with variable rename

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
enwogion Posted - Sep 17 2009 : 04:03:04 AM
I'm trying to rename a public variable in a base class. The Rename dialogue happily finds about half the references to the variable accessed through the derived class i.e. they have a gray box and the file name next to the tick box.
However, the other half have ? BRC(...) next to the tick box (which is unticked). This also happens for references in the cpp file for the base class.

I was wondering if anyone knew what the ? BRC meant?

Thanks,
Rob
22   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 26 2009 : 09:48:45 AM
So, using this test solution, and this as a start point, can you reproduce the problem you are seeing in this test solution?

If so, exactly what are you doing?
enwogion Posted - Oct 23 2009 : 06:20:15 AM
Apologies for replying so late to this.

I have repeated your test, and I get the same result.

Thanks,
Rob
feline Posted - Oct 09 2009 : 4:13:57 PM
I am still feeling confused. Using the original version of the solution you sent me I have run the following test. Into the file "TestWT.cpp" I have copy / pasted the lines

//#define EH_Start	try{{
//#define EH_Stop		}}catch(...){}

below the #include lines and above the main function. When I trigger Find References on the function call BoundingSquare I see the problem with the scope given as BRC.

If I uncomment these two #define lines, wait a few seconds, and re-run the Find References then the correct scope is given in Find References Results.

Can you run the same test and see if you are getting the same result please? We need to start by testing the same thing on the same code, since strange things are happening here.
enwogion Posted - Oct 09 2009 : 03:12:16 AM
Yeah, sorry I should have mentioned that it wasn't in a buildable state.

If you double click on BoundSquare() in Circle.cpp, and click Find References, the last entry in the results tab will be c.BoundingSquare() in TestWT.cpp. It is preceeded by BRC(20).

As it stands VA Outline does indeed show the CCircle funtions correctly. But if you remove the curly brackets from the EH_Start/EH_Stop pair around BoundingSquare(), then BoundingSquare() disappears from VA Outline, and is replaced with EH_Start.

For the solution I'm running EH_Start/EH_Stop are only defined in StdAfx.h, where they are empty macros. FELINE_TEST_STDAFX_DUMMY is also defined in StdAfx as an empty macro. If I replace EH_Start/EH_Stop with FELINE_TEST_STDAFX_DUMMY, then VA Outline shows: "BoundingSquare() FELINE_TEST_STDAFX_DUMMY". I don't really understand why VA would interpret EH_Start differently to FELINE_TEST_STDAFX_DUMMY, as they are both just empty macros.

Thanks,
Rob
feline Posted - Oct 08 2009 : 1:15:13 PM
I have the solution now, thank you for that.

case=33413

I have opened it in VS2005 with VA 1738 on a winXP SP3 machine.

By default it does not compile, so I have been fiddling with it. In order to simplify things down, so I have a basic test to look at, I have:

* left all of the #define statements in "ExHandle.h" commented out.
* removed all of the macro lines from all of the cpp files except for "Circle.cpp", where they were straight forward
* uncommented the #define statements at the top of "Circle.cpp"

So my entire test case is contained within "Circle.cpp", and the solution compiles.

The function bodies are still wrapped in "{EH_Start}" and "{EH_Stop}". Removing the curly brackets from these lines stops the project compiling. I am not really sure what is going on here, but currently I don't care, since it does not seem necessary to figure it out.

Both the alt-m list and VA Outline for this file is listing the correct functions in the correct order. This is without making any changes to VA's StdAfx.h file!

What problems should I be seeing in this file, in this situation?
enwogion Posted - Oct 08 2009 : 02:40:11 AM
Ok done, thought I could only send screenshots through there for some reason :)
feline Posted - Oct 07 2009 : 3:45:19 PM
You can simply send me files directly if that helps, simply send them via the form:

http://www.wholetomato.com/support/contact.asp

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

Currently this link is refusing to load, my browser is just sitting here, doing nothing useful.
enwogion Posted - Oct 07 2009 : 07:14:34 AM
I have added FELINE_TEST_STDAFX_DUMMY to StdAfx and and Intellisense happily autocompletes it for me in my solution. So it would appear that VA is reading in StdAfx.h.

I have uploaded a test solution to the following location: http://filetransfer.renishaw.net/e8vedu2m
You'll need to register to access it.

I have defined EH_Start, EH_Stop and FELINE_TEST_STDAFX_DUMMY as empty macros. If you have a look at Square.cpp I have surrounded CSquare with {EH_Start} and {EH_Stop}, ~CSquare with EH_Start and EH_Stop, and SetSide with FELINE_TEST_STDAFX_DUMMY. If you click the VA drop-down list, you should see:

CSquare::CSquare(double side)
CSquare::SetSide(double side)
CSquare::SetSide(double side)
EH_Start

So, surrounding with FELINE_TEST_STDAFX_DUMMY causes 2 copies of the same function to appear in the list, and surrounding with EH_Start, EH_Stop causes the function name to be replaced with EH_Start in the list.

Thanks
feline Posted - Oct 06 2009 : 4:34:31 PM
Lets go back to basics. Can you try adding the following to VA's StdAfx.h file:

#define FELINE_TEST_STDAFX_DUMMY

and rebuild your VA symbol database. If you now add FELINE_TEST_STDAFX_DUMMY on its own to a cpp file how is it shown?

Assuming you have show stable symbols in italic turned on this should be shown in italic, and coloured as a macro. Does this work or not? If it works then your changes to VA's StdAfx.h are being correctly read and understood.

Once we get to this point we can start trying to fix the problem with your macros.
enwogion Posted - Oct 06 2009 : 08:32:26 AM
Have managed to get VA to read the StdAfx file by uninstalling and reinstalling VA. After opening a solution for the first time after the reinstall, devenv.exe makes several open requests to StdAfx.h (in FileMon) in "C:\\Documents and Settings\\re134618\\Application Data\\VisualAssist\\Misc".

Unfortunatly, this doesn't actually seem to make any difference.

With the macros surrounded with {}, VA's drop-down list at the top-left of a cpp file happily displays all of the functions in the cpp file. If I remove the {} from the macros surrounding one of the functions, that function disappears from the drop-down list and is replaced with EH_Start. So it doesn't look like VA us ignoring these macros.

We have created a dummy project that demonstrates this behaviour. We should be able to make this available if it will help?

Thanks

enwogion Posted - Oct 06 2009 : 03:28:19 AM
There is definitly a blank line at the bottom of the file.

Have now repeated this on a stand-alone Win2000 machine (not connected to the internet, so has no AV software installed). It didn't read StdAfx.h from DocumentsAndSettings nor from Program Files. We saved the FileMon log (~60MB), we can get that to you if you think it would help.

Any ideas?

Thanks
feline Posted - Oct 05 2009 : 08:05:05 AM
If you look in "C:\\Program Files\\Visual Assist X\\Misc\\" you should see both a "StfAfx.h" and "StdafxVa.h" file, which is why you are seeing activity for this second file from filemon.

These are different files with different content, so copying and renaming "StdAfx.h" is not going to help.

Can you open your modified VA StdAfx.h file and make sure there is at least one blank line at the very end of the file? If there is no blank line this can cause problems.


Are you able to run this same filemon test on your colleagues machine? As far as I can tell there is nothing wrong with the directory layout you are using, so apart from the blank line test I am not sure why you are having problems. I am starting to wonder about anti-virus or file permissions, something machine specific that is stopping VA behaving normally.
enwogion Posted - Oct 05 2009 : 03:26:39 AM
StdAfx.h is in "C:\\Documents and Settings\\re134618\\Application Data\\VisualAssist\\Misc"

When I used FileMon, I noticed that VA attempted to access StdAfxVa.h in this directory, but it didn't exist. I copied StdAfx.h and renamed it to StdAfxVa.h, but VA didn't try and access it the next time (I'd still pressed the rebuild database button).

It also doesn't access anything in "C:\\Program Files\\Visual Assist X\\Misc" either
feline Posted - Oct 02 2009 : 09:03:35 AM
Close all but one IDE instances, press the rebuild symbol database button, and restart a single IDE instance, and any changes to VA's StdAfx.h file will be read.

If VA is not responding to changes in this file then perhaps VA is not finding it. Which directory have you placed the file in?

If you run filemon is VA, the IDE process, actually reading your modified StdAfx.h file?

http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx
enwogion Posted - Oct 02 2009 : 06:10:43 AM
When does stdafx.h get read?
I have tried clearing cache, rebuilding the symbol database, opening a closing the solution, rebuilding the solution and rebooting my PC, but the file's accessed time is exactly the same as it's modified time i.e. the time a added the lines:

#define EH_Start
#define EH_Stop
#define EH_TC_START
#define EH_TC_STOP

Thanks,
Rob
accord Posted - Oct 01 2009 : 3:38:21 PM
About the corruption: you can check it easily: just press

VA Options -> Performance -> Clear history, cache and temporary files

and then

VA Options -> Performance -> Rebuild symbol databases

It will rebuild symbol databases, so if it will work, then if was only a corruption.

To ignore these macros completely: you can do this by following the instructions here:

http://docs.wholetomato.com?W302
enwogion Posted - Oct 01 2009 : 11:14:51 AM
EH_START and EH_STOP are marcos which wrap the entire function in a try/catch block:

EH_START:
{
try {{

EH_STOP
}}
catch(GMLException::EGMLExceptionReason& __eExp__)
{
throw GMLException::CGMLException(__eExp__, __GML_EXCEPTION_LOCATION__);
}
}

EH_TC_START does exactly the same thing.

The reason we have {} around these macros is because VA won't work at all if we don't. Is these any way of getting VA to completely ignore these macros?

I'd agree that it looks like these are what are causing my issue, however, the other functions picked up correctly (i.e. didn't call them BRC) by the rename dialogue are also wrapped by these macros.
Another odd thing I've noticed is that my colleagues, using the same code and the same version of VA and VS, do not seem to get this issue. Is it likely that this is due to a corrupt VA or VS installation?

Thanks,
Rob
feline Posted - Sep 25 2009 : 1:23:43 PM
An interesting part of your screen shot is:



What are the {EH_TC_Start} and {EH_TC_Stop} lines? They seem to be confusing VA's parser, in fact they are confusing me as well, since the body of the function GetCtrlPts seems to be {EH_TC_Start}, which is clearly wrong, but that is what the code says.
enwogion Posted - Sep 25 2009 : 07:12:33 AM
This is the function where clicking on BRC (260) takes me:

void CNURBS_SurfaceStruct::GetCtrlPts(float **pPts)

{EH_TC_Start}
{
*pPts = reinterpret_cast<float*>(ctrlPts.GetArray());
}
{EH_TC_Stop}

As you can see it is not called BRC. Running Find in files on BRC, for the whole solution, returns no hits. So I'm still not sure where BRC is coming from.

I will upload another screen shot for you that has underlined code.

Thanks,
Rob
accord Posted - Sep 18 2009 : 3:46:50 PM
I got your screenshot, thank you:



BRC is the name of a function, which Visual Assist has found somewhere in NURBS_SurfaceStruct.cpp. If you double click on the code in the rename dialog, Visual Assist will take you there.
The question mark icon '?' usually means that Visual Assist isn't sure about the type of the symbol, so it is up to you to confirm these references (if you think that these are valid) by checking the checkboxes.

The question here is why aren't these symbols recognized? Is there any complex macro or template code in this file?
If you turn on

VA Options -> Advanced -> Underlines -> Underline mistyped symbols using

and then modify the file, Visual Assist will underline symbols that it doesn't recognize. Are there any underlines in the lines where rename dialog put the question mark? (for example ln 260, 284, etc. in NURBS_SurfaceStruct.cpp). If yes, taking a screenshot of some underlined symbol may help identifying the problem.
enwogion Posted - Sep 18 2009 : 07:12:52 AM
Done.
accord Posted - Sep 17 2009 : 4:01:21 PM
Can you please take a screenshot of a rename dialog in which there are lines beginning with BRC?

You can upload the picture to a sharing service (for exampel imageshack.us) or just submit the file via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, and I will post the picture here.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000