News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Intergrate the nativeparser_base to our parsertest project

Started by ollydbg, July 07, 2012, 03:37:02 AM

Previous topic - Next topic

ollydbg

Quote from: MortenMacFly on July 12, 2012, 07:34:50 AM
Quote from: ollydbg on July 12, 2012, 02:17:04 AM
You may not understand my idea.
...maybe I need to rre-phrase. As you see:

<Unit filename="cc_test\test.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>

...although the file is in the project, it belongs to a the special target "{~None~}" which means in no target it is checked. I was under the impression hat only those files are parsed, that belong to a real target (like "default") and this file only in case it is being opened (which you don't need to do). How does CC collect its list of files to parse precisely? I'll have a look...
I think CC just add all the files belong to the project, you can see below:

void NativeParser::AddProjectToParser(cbProject* project)
{
....



    if (project)
    {
        size_t fileCount = 0;
        for (FilesList::iterator it = project->GetFilesList().begin(); it != project->GetFilesList().end(); ++it)
        {
            ProjectFile* pf = *it;
            if (pf && FileTypeOf(pf->relativeFilename) == ftHeader)
            {
                if (AddFileToParser(project, pf->file.GetFullPath(), parser))
                    ++fileCount;
            }
        }
        for (FilesList::iterator it = project->GetFilesList().begin(); it != project->GetFilesList().end(); ++it)
        {
            ProjectFile* pf = *it;
            if (pf && FileTypeOf(pf->relativeFilename) == ftSource)
            {
                if (AddFileToParser(project, pf->file.GetFullPath(), parser))
                    fileCount++;
            }
        }

        wxString log(F(_("Done adding %d files of project (%s) to parser."), fileCount, prj.wx_str()));
        CCLogger::Get()->DebugLog(log);
    }

...


BTW: I noticed that in our codeblocks.cbp, there are different targets which have the save class name "Token", CodeCompletion plugin target and debugger plugin target. Click on the "Token" and context menu select goto declaration will bring me to:
plugins\debuggergdb\parsewatchvalue.cpp

This is pretty annoying...... :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Quote from: ollydbg on July 12, 2012, 08:45:00 AM
I think CC just add all the files belong to the project, you can see below:
[...]
Hmmm... seems you are right. But if that is a good idea... I don't know. At least we should skip files not related to any target. This would avoid the freeze you are mentioning.

BTW: I've done the directory layout changes in trunk. I merged them from the xml_compiler branch which was actually an error. I meant these 4 commits to be applied in trunk had not switched back to trunk before the first commit. ::) :-[

However - we have the history.... although its in a branch. And as it doesn't do any functional change its OK I'd say...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Quote from: MortenMacFly on July 13, 2012, 09:37:28 AM
BTW: I've done the directory layout changes in trunk. I merged them from the xml_compiler branch which was actually an error. I meant these 4 commits to be applied in trunk had not switched back to trunk before the first commit.
Wow, you're using single working copy for all the branches? You're a brave man:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

MortenMacFly

Quote from: oBFusCATed on July 13, 2012, 10:41:21 AM
Wow, you're using single working copy for all the branches? You're a brave man:)
You can switch only partially to a branch, like I did for the CC plugin. This is nice if the changes are related to a single directory, only. Unfortunately here, I forgot to switch this folder back to trunk before. After the first commit I realised that I had even clicked away the warning of the SVN software... maybe it was too early today. ::)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]