I realised that you already conflict with a patch of OllyDbg. It will be hard to resolve this in the end and I don't want to take such a risk later on.
@MortenMacFly
Yes, Loaden's patch about "handling conditional preprocessor" is totally different with "my patch of handling Preprocessor". We use different methods, let me give a explanation:
My patch released in the "ptest" project, see here:
ParserTester for codecompletion plugin do the main work in the Tokenizer class. That is to say, when a Tokenizer return a wxString, it will never return a wxString stream like "#" "ifdef", because all the handling of conditional preprocesser directives was done in the Tokenizer::DoGetToken().
The aim I implement this was that I want to solve some problems caused by these code:
void function ( int i, #ifdef AAA
int j)
#else
)
#endif
{
XXXX
};
You see, when a #if is appeared in the function arguments parentheses, the parser may fail (because the current SVN code just match a closing parenthesis after it see a opening parenthesis) . But I'd say these kind of code happens in a rare situation.
Refer to Loaden's patch, he just do the "handling conditioanl preprocessor" in the Parserthread class. So, he didn't change Tokenizer class so much. The Most advantage of Loaden's patch is that he implement a true "expression solver". For example:
//#define AAA
#ifdef AAA
#include <xxx.h>
#else
#include <yyy.h>
#endif
The current SVN code (also the patch supplied by me) only parse the code like below, all the #else branches were skipped whether AAA is defined or not.
//#define AAA
#include <xxx.h>
But with Loaden's patch, the expression value after #if was dynamically evaluated when parsing, and only a true conditioanl preprocessor branch will be parsed.
So, As a conclusion: Loaden's Patch is much better than mine, you should pick his patch.