Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

vector<int> is OK, but string or wstring no-work.

<< < (9/23) > >>

blueshake:
hi,ollydbg:

I get some codes from the string test file.It seems the typedef can not handle correctly.

--- Code: ---class basic_string
{

};
_GLIBCXX_BEGIN_NAMESPACE(std)

  template<typename _Alloc>
    class allocator;

  template<class _CharT>
    struct char_traits;

  template<typename _CharT, typename _Traits = char_traits<_CharT>,
           typename _Alloc = allocator<_CharT> >
    class basic_string;

  template<> struct char_traits<char>;

  typedef basic_string<char>    string;

#ifdef _GLIBCXX_USE_WCHAR_T
  template<> struct char_traits<wchar_t>;

  typedef basic_string<wchar_t> wstring;
#endif

#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
     && defined(_GLIBCXX_USE_C99_STDINT_TR1))

  template<> struct char_traits<char16_t>;
  template<> struct char_traits<char32_t>;

  typedef basic_string<char16_t> u16string;
  typedef basic_string<char32_t> u32string;

#endif

_GLIBCXX_END_NAMESPACE

//string aaaa;
//aaaa.
--- End code ---



you can find that the string loses its ancestor.It work before.

MortenMacFly:

--- Quote from: blueshake on January 12, 2010, 09:46:26 am ---you can find that the string loses its ancestor.It work before.

--- End quote ---
Exactly. That's what I noticed, too. Still: I don't see why that is. But it's most likely related to Ollydbg's patch. So I was hoping he'd help us...

ollydbg:

--- Quote from: MortenMacFly on January 12, 2010, 10:11:17 am ---
--- Quote from: blueshake on January 12, 2010, 09:46:26 am ---you can find that the string loses its ancestor.It work before.

--- End quote ---
Exactly. That's what I noticed, too. Still: I don't see why that is. But it's most likely related to Ollydbg's patch. So I was hoping he'd help us...

--- End quote ---
Ok, I will try my best to find the bug :D

ollydbg:
This is a patch for testing, I just add a member variable to ParserThread and Token. It seems the parser works better. :D.
Also, I refined my testString.txt.

Comments and suggestion are welcome. :D

[attachment deleted by admin]

ollydbg:
I noticed that we have forgot one Macro replacement rule


--- Code: ---_GLIBCXX_END_NAMESPACE   to  }
--- End code ---

in default.conf file , change to this

--- Code: --- <TOKEN_REPLACEMENTS>
<ssmap>
   <_GLIBCXX_END_NAMESPACE>
<![CDATA[}]]>
</_GLIBCXX_END_NAMESPACE>
<_GLIBCXX_BEGIN_NAMESPACE>
<![CDATA[+namespace]]>
</_GLIBCXX_BEGIN_NAMESPACE>
<_GLIBCXX_BEGIN_NAMESPACE_TR1>
<![CDATA[-namespace tr1 {]]>
</_GLIBCXX_BEGIN_NAMESPACE_TR1>
<_GLIBCXX_BEGIN_NESTED_NAMESPACE>
<![CDATA[+namespace]]>
</_GLIBCXX_BEGIN_NESTED_NAMESPACE>
<_GLIBCXX_END_NAMESPACE_TR1>
<![CDATA[}]]>
</_GLIBCXX_END_NAMESPACE_TR1>
<_GLIBCXX_END_NESTED_NAMESPACE>
<![CDATA[}]]>
</_GLIBCXX_END_NESTED_NAMESPACE>
<_GLIBCXX_STD>
<![CDATA[std]]>
</_GLIBCXX_STD>
</ssmap>
</TOKEN_REPLACEMENTS>
--- End code ---

Edit

Also, this rule should be added to this function body

--- Code: ---Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NAMESPACE"),          _T("}"));
--- End code ---


--- Code: ---void CodeCompletion::LoadTokenReplacements()
{
    ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("code_completion"));

    ConfigManagerContainer::StringToStringMap& repl = Tokenizer::GetTokenReplacementsMap();
    repl.clear();

    if (!cfg->Exists(_T("token_replacements")))
    {
        // first run; add default replacements string
        Tokenizer::SetReplacementString(_T("_GLIBCXX_STD"),                    _T("std"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NESTED_NAMESPACE"), _T("+namespace"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NESTED_NAMESPACE"),   _T("}"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE"),        _T("+namespace"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_END_NAMESPACE_TR1"),      _T("}"));
        Tokenizer::SetReplacementString(_T("_GLIBCXX_BEGIN_NAMESPACE_TR1"),    _T("-namespace tr1 {"));
    }
    else
        cfg->Read(_T("token_replacements"), &repl);
}
--- End code ---
By the way, I found it's hard to enter in the CC's configure dialog.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version