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
 Visual Assist Not Processing All of Long File
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dewtell
Junior Member

18 Posts

Posted - Jun 20 2012 :  6:14:05 PM  Show Profile  Reply with Quote
Using Visual Studio 2008 with Visual Assist X version 10.7.1906.0, with the handling of recursive macro calling turned on as noted in topic http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=10595

I have a long C++ file (48000 lines long) as part of the project, and Visual Assist X functionality only seems to be available in around the first 10000 lines or so. I noticed this a few days ago when doing several edits in this file, and noticing that the autocompletion of my typing was only available in the first part of the file. I've just been trying to trace the usage of a global variable defined on line 476, and noticed that the only usage identified by VAX's Find References is on line 3919 (not finding the original reference I was tracing from line 15587).

By doing binary search, I have identified exactly where the autocompletion cuts out, right around an #ifdef block of code at line 7824 that is disabled:

add_net_to_table_rec(&primary_clock_sources,GET_NET_TOKEN_CLOCK_ID(token_ind),false); // Save primary clock associated with internal source
#ifdef _DEBUG_MULTIMODE_ANALYSIS 
                                printf(clock_sources.no = %d\\n,clock_sources.no);
                                printf( net_no = %d, src = %d \\n", out_net, src);

#endif
                            }
                        // Pseudo-internal clock so add control
                        if (multimode_analysis && reached_src) 

Autocompletion works right after the semicolon at line 7823, just before the #ifdef, and fails after the close bracket on line 7829 and all subsequent lines on which I have tried it. Attempting to find references for the global variable multimode_analysis on line 7832 fails (with a "Find References is not available because the symbol is unrecognized" message), but going to the declaration and finding references does identify a later reference at line 7966, so it's not quite as simple as saying that all VAX analysis stops at line 7824. However, it misses all six references to multimode_analysis that occur at line 8185 or later (while finding all the reference from line 7804 or earlier).

There are ten previous #ifdefs for _DEBUG_MULTIMODE_ANALYSIS in this file, as well as four subsequent ones, so it's not as simple as the analysis cutting out at the first #ifdef of this variable.

I don't know if this is sufficient to track down the bug, but I hope it helps. I can't give you the whole file, because it contains too much proprietary information. Obviously, we would like to break this file down into shorter files at some future point, but it would be helpful to have VAX working on the whole file first before trying to refactor it further.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 20 2012 :  9:46:30 PM  Show Profile  Reply with Quote
Unfortunately, there is a file size limit which you may be experiencing. There is an open case for this so we may consider to enable VA in larger code files at some point:

case=8621 (as it turned out, the file size wasn't over the limit)

How large is your file in bytes? I'm not sure if VA parses the first part of the file in cases like this though. I did a test with a large file (>5 mb) and VA's definition field started to show nonsense in the lower part of the file, so it seems so.

Edited by - accord on Jun 28 2012 10:36:11 PM
Go to Top of Page

dewtell
Junior Member

18 Posts

Posted - Jun 21 2012 :  5:19:51 PM  Show Profile  Reply with Quote
The file is currently 2090997 bytes, 47832 lines. That should at least let you estimate how many bytes to the code section in question above.
Go to Top of Page

dewtell
Junior Member

18 Posts

Posted - Jun 21 2012 :  5:33:58 PM  Show Profile  Reply with Quote
The file in question is our biggest single cpp file, but we have 15 files of 10,000 lines or more, and another 21 files between 5,000 and 10,000 lines. So if you have more information about maximum file size, that would be helpful to us. Based on the above info, I'm guessing that anything over about 7,000 lines is suspect.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jun 21 2012 :  11:32:59 PM  Show Profile  Reply with Quote
A passing comment on file size, as part of the final testing for new builds of VA, I check VA in a 23,000 line .cpp file, so you should not have any problems in anything smaller than this, unless all of the lines are massively long, pushing the file size right up.

The last time I encountered this problem, it required an 5meg cpp file of around 101,000 lines to trigger.

I am not sure it is a file size problem causing you problems only 8,000 lines into a file.

Is it possible you have mismatched curly brackets in your file? I have seen code like this cause VA problems:

void vaHasProblemsAfterThisFunction()
{
#if 0
    {
        {
#endif
}

since our parser is designed to check inside the #if 0 #endif block. Your comment that the problem happens after the closing curly bracket makes me wonder if something similar is happening.

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

dewtell
Junior Member

18 Posts

Posted - Jun 27 2012 :  3:39:59 PM  Show Profile  Reply with Quote
I've visually checked the #ifdef'd and/or commented out code preceding this point in the file, and as far as I can tell, all the curly braces within such a block of code are matched within the block. We do have various combinations such as commented-out code (with /* */ ) containing an #ifdef, and vice-versa, but I don't see mismatched braces.

HOWEVER, did you notice that the code fragment I quoted had mismatched double quotes within the #ifdef section? I just did, and when I fixed the mismatched quotes, all of a sudden autocompletion works past that section, finding references for multimode_analysis works, etc... I don't know if there's any way to warn about "quoted string in inactive #ifdef section extends beyond the end of the section", but it would have been helpful here...

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jun 28 2012 :  11:02:29 PM  Show Profile  Reply with Quote
Interesting, thank you for the update. I don't recall a mismatched double quote causing a problem like this before, so this is something to be aware of.

Normally when a problem like this shows up, you can narrow down the problem area by looking at the Alt-M list, or VA Outline, and checking for the last function that is shown correctly. If you know that after a specific function VA is having problems, it is normally relatively quick to pin down the problem area.

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:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000