User forums > Nightly builds

The 20 February 2011 build (7017) is out.

<< < (3/11) > >>

Phenom:
Bug with CC:
Type a function declaration, e.g.:

--- Code: ---void foo(int arg1, int arg2)

--- End code ---

Inside the function body, type an argument's name and an '(' character. The call tip for that function is shown.

ollydbg:

--- Quote from: Phenom on February 24, 2011, 08:53:18 pm ---Bug with CC:
Type a function declaration, e.g.:

--- Code: ---void foo(int arg1, int arg2)

--- End code ---

Inside the function body, type an argument's name and an '(' character. The call tip for that function is shown.

--- End quote ---
confirm, I will check this bug. :D

ollydbg:
Ok, I found the bug. the sample code is:

--- Code: ---void foo(int arg1, int arg2)
{
    arg1(
}


--- End code ---

you enter the "(" here, and finally, it will call ShowCallTip() function

it seems there are something wrong in this function call (nativeparser.cpp line 1874)

--- Code: ---            else
            {
                wxString s;
                wxString full;
                if(!PrettyPrintToken(full, *token, *tokens))
                    full = wxT("Error while pretty printing token!");
                BreakUpInLines(s, full, chars_per_line);
                m_CallTips.Add(s);
            }

--- End code ---

the *token is actually  "arg1", see:

--- Quote ---> p *token
$2 = {
  <BlockAllocated<Token, 50000u, false>> = {
    static allocator = {
      allocBlocks = std::vector of length 1, capacity 1 = {0xdaa0020},
      first = 0xdb565a0,
      ref_count = 0,
      max_refs = 0,
      total_refs = 0
    }
  },
  members of Token:
  m_Type = "int",
  m_ActualType = "int",
  m_Name = "arg1",
  m_Args = "",
  m_BaseArgs = "",
  m_AncestorsString = "",
  m_TemplateArgument = "",
  m_FileIdx = 6,
  m_Line = 10,
  m_ImplFileIdx = 0,
  m_ImplLine = 0,
  m_ImplLineStart = 0,
  m_ImplLineEnd = 0,
  m_Scope = tsUndefined,
  m_TokenKind = tkVariable,
  m_IsOperator = false,
  m_IsLocal = false,
  m_IsTemp = true,
  m_IsConst = false,
  m_ParentIndex = 429,
  m_Children = std::set with 0 elements,
  m_Ancestors = std::set with 0 elements,
  m_DirectAncestors = std::set with 0 elements,
  m_Descendants = std::set with 0 elements,
  m_Aliases = 0 count of wxArrayString,
  m_TemplateType = 0 count of wxArrayString,
  m_TemplateMap = std::map with 0 elements,
  m_TemplateAlias = "",
  m_UserData = 0x0,
  m_TokensTree = 0x6939f30,
  m_Self = 3111,
  m_Ticket = 3383
}

--- End quote ---

But after running this function, the string "full" is below:

--- Code: ---> p full
$3 = "void foo(int arg1, int arg2)"
>>>>>>cb_gdb:

--- End code ---

So, my guess is there is something wrong with "PrettyPrintToken try to print arg1". :D :D

oBFusCATed:
This patch fixes the problem for me, but I've not done extensive testing, so there are chances for other bugs...


--- Code: ---Index: src/plugins/codecompletion/nativeparser.cpp
===================================================================
--- src/plugins/codecompletion/nativeparser.cpp (revision 7025)
+++ src/plugins/codecompletion/nativeparser.cpp (working copy)
@@ -1727,7 +1727,9 @@
 
 bool PrettyPrintToken(wxString &result, Token const &token, TokensTree const &tokens, bool root = true)
 {
-    if (token.m_ParentIndex != -1)
+    if (token.m_ParentIndex != -1 &&
+        ((token.m_TokenKind == tkConstructor) || (token.m_TokenKind == tkFunction)
+         || (token.m_TokenKind == tkClass) || (token.m_TokenKind == tkNamespace)))
     {
         if (!PrettyPrintToken(result, *tokens.at(token.m_ParentIndex), tokens, false))
             return false;

--- End code ---

stahta01:
Patch needed for NON-PCH Type Build under Windows (CB_PRECOMP and WX_PRECOMP not defined and NOPCH is defined)

Tim S.


--- Code: ---Index: src/sdk/projectfileoptionsdlg.cpp
===================================================================
--- src/sdk/projectfileoptionsdlg.cpp (revision 7028)
+++ src/sdk/projectfileoptionsdlg.cpp (working copy)
@@ -12,6 +12,7 @@
 #ifndef CB_PRECOMP
     #include "cbproject.h"
     #include "compilerfactory.h"
+    #include "editormanager.h"
     #include "logmanager.h"
     #include "projectmanager.h"
     #include <wx/xrc/xmlres.h>

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version