T O P I C R E V I E W |
xMRi |
Posted - Mar 20 2007 : 05:23:50 AM I have an enumeration in a header file: enum eProgressState { ... stateConnected, ... };
If have some code in a CPP file, a switch case block case stateSaving: ASSERT(stateSaving==PROGRESSSTATE_SAVEING); // Nothing to do here break;
Moving the cursor over the stateSaving text shows a popup with exactly the code I am in. Just moving the cursor just a few pixels shows a second popup the enumeration ID value of this enum.
Also pressing ALT+G over the enum value just jumps to the current code location.
Note: The header file were the enum is defined is used 3 times in the whole solution (shared by VSS). |
14 L A T E S T R E P L I E S (Newest First) |
support |
Posted - Apr 10 2008 : 01:10:30 AM case=5567 is fixed in build 1632 |
feline |
Posted - Mar 27 2007 : 11:22:25 AM Got it. So easy when you know exactly what to do.
case=5701
It turns out VSS shared files have nothing to do with this, I can reproduce it with an enum defined inside the function. Also you only need to add the ASSERT to a single case.
I have also found a work around fix, change the code to read:
case stateConnected:
{
ASSERT(FALSE);
break;
}
case stateDisconnected:
{
ASSERT(FALSE);
break;
}
not ideal, but it does help. Thank you for your help in pinning this down. |
xMRi |
Posted - Mar 27 2007 : 09:06:50 AM Easy to repro! Just open testtooltip.cpp. A small change to the code: Just add ASSERT(FALSE); into every case block. i.E:
...
case stateConnected:
ASSERT(FALSE);
break;
case stateDisconnected:
ASSERT(FALSE);
break;
...
Click into the source file an locate the caret anywhere. Hover themouse over the enum! Watch the tooltips :-)
Locate the caret over a enum value. Press ALT+G. Caret jumps into the next line on the ASSERT!
I can repro it 100%
|
feline |
Posted - Mar 27 2007 : 08:34:03 AM Can you download and open the following test project please:
http://forum.wholetomato.com/colin/forumimages/6027_Test_project.zip
This is a VS2003 solution, which is my test solution, stripped down, to test this specific bug. If you look at the file "test_tooltip.cpp" you will see my test code, and the notes I have made, describing what happens for me.
I suspect you will see the same behaviour as me. This way we know we are both looking at the same thing. Hopefully we can reproduce the problem you are seeing in this test project, by making it a little more complex. |
xMRi |
Posted - Mar 27 2007 : 02:30:53 AM No this looks good. The structure of the directory is not the same. I see! My positing caused the confusion. I used hyphens in front of the DLL1+DLL2 Sorry. I just wanted to say that they are belonging to EXE1 All my projects are direct childs of the solution directory. Also the two DLL's of EXE1 are on the same level like the EXE. |
feline |
Posted - Mar 26 2007 : 3:00:27 PM when you have a shared header file, and alt-g jumps directly to one copy of this header file, in a separate project, is something I was able to reproduce quite easily. It was you who reported this effect over here:
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6021
case=5567
However this problem only effects alt-g, so far I am not seeing any other problems. My current test is the following, I have manually duplicated a header file (to emulate VSS shared files), giving me the two files:
c:\\src\\tests\\ManualVaTests\\bugs\\dll_files\\bug_duplicate.h c:\\src\\tests\\ManualVaTests\\bugs\\bug_duplicate.h
they both contain the code:
enum enumDuplicateVssShare
{
stateConnected,
stateDisconnected,
stateChocolate
};
the two header files are in two different projects inside the same solution. One header file is in my "tests" project and the second header file is in the "cpp_dll" project.
In the "tests" project I also have a cpp file, which contains the code:
#include "bug_duplicate.h"
static void bugEnumVssSharedHeader()
{
enumDuplicateVssShare testValue = stateChocolate;
switch(testValue)
{
case stateConnected:
break;
case stateDisconnected:
break;
case stateChocolate:
break;
}
}
when I hover the mouse over these enum values I get the correct tooltips.
Does this look like a valid test? Have I missed something obvious?
I am considering taking out the extra files and sending you this test project, to see what it does on your machine. |
xMRi |
Posted - Mar 26 2007 : 02:09:46 AM This particular Solution contains 6 Projects EXE1 for a service -DLL1 containing the message data for the service -DLL2 suporting DLL for service EXE2 a UI-program to control the service (setting INI file data) EXE3 a simulator EXE4 a test program
The .cpp file I am talking of is in EXE1. It contains a simple switch case for all values in the enum (states of a statemachine). The header file with the enum is used in EXE1 DLL2 EXE2.
There is nothing special about this.
I checked a large solution wre a lot of projects are combined for a build. Again here I am using shared header files with enums. I can repro this too. Here I have a .cpp file shared in 2 projects. Using a enum in a header file thats locates in 3 projects. Pressing Alt+G doesn't show all locations over an enum. It shows two definitions but not the header file thats used in the current project were the source file is located.
HTH |
feline |
Posted - Mar 23 2007 : 10:59:32 AM I think I need to try and setup a similar test here, and see what happens for me.
How have you organised this? Does your solution have 3 or more projects? I am picturing the following:
Solution: * project1 contains "C:\\src\\proj1\\shared_header.h" * project2 contains "C:\\src\\proj2\\shared_header.h" * project3 contains "C:\\src\\proj3\\shared_header.h"
or have you done something different?
What information is shown in FSIW? I would not expect it to show two different pieces of information. Can you post the enum from the header file, so I know I am using the same thing? |
xMRi |
Posted - Mar 23 2007 : 03:24:28 AM In fact the header file with the enum ist used three times in the project. The global find symbol dialog shows it two times, but witth different infos. But both point to the same header location. It's a header file from the third project were it is used and it's not the project were the source file resides.
The OFIW shows the file 3 times! |
feline |
Posted - Mar 22 2007 : 1:54:32 PM This is very strange. I am starting to wonder if the fact this is a VSS shared file is part of the problem. I have a test project here, where the solution contains 2 projects, and a header file has been manually copied, to emulate a VSS shared file, and using Find References on a #define in this file lists the shared header twice, as expected.
Your comment "The global find sysmbol dialog shows the values twice" bothers me slightly, considering the statement "The header file were the enum is defined is used 3 times in the whole solution"
If you look in OFIW how many times is this shared header listed? |
xMRi |
Posted - Mar 22 2007 : 06:55:25 AM No change at all.
The FindReference doesn't show the include file. Is only shows the cpp file were it is used.
The global find sysmbol dialog shows the values twice. |
feline |
Posted - Mar 21 2007 : 12:16:03 PM Can you please try upgrading to VA 1549 to see if this makes any difference:
details here: http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6019
direct download link: http://www.wholetomato.com/downloads/VA_X_Setup1549.exe
What happens if you run Find References on this enum value? |
xMRi |
Posted - Mar 21 2007 : 03:23:13 AM VS2003, C++. VA Build 1548
The tooltips don't pop up at the same time. Say are colored in the same way. When I hoover over the values the wizard bar doesn't change its contents.
If the VA-View is active its contents shows silly values, that doesn't respond to any data I see. When the VA-View is active I get only one popup with the value of the enum. Disabling the VA-View shows again a tooltip with the current code and after moving some pixels a tooltip with the enum
Anyway. Alt+G doesn't work either on this enums. It jumps just a line below the current. |
feline |
Posted - Mar 20 2007 : 12:36:33 PM Two tooltips, this suggests one is from the IDE and one is from VA.
Is this enum coloured as an enum by VA? What does VA show in the wizard bar when you place the caret into it?
Which IDE and version of VA are you using? Which language is this? C++ or C#? |