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

Code Completion & Workspace

<< < (3/7) > >>

seb_seb0:

--- Quote from: ollydbg on May 10, 2011, 03:51:19 pm ---
--- Quote from: oBFusCATed on May 04, 2011, 08:38:53 am ---Ollydbg, you should put A, B, AFunction in different projects.

--- End quote ---
it works fine.
I just got some time to separate "A", "B", and "AFunction" in three cbp, and only allow one tokenstree for the whole workspace.
And I can have "DoSomething" in the auto suggestion list after "pPointer->". :D



--- End quote ---

Yes, for simple projects, it works. But for my project, it fails, and I cannot pinpoint the problem yet. Give me a bit of time, and I will post you a minimal test case. The code I have posted is a typical case where it fails (implementation of a virtual interface, and calling it from somewhere else)
Thanks for the help.

BTW, here is a crash dump which occurs when max parsers thread are set to 1:


--- Code: ---D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe caused an Access Violation at location 65f12fae in module D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll Reading from location 00000000.

Registers:
eax=00000000 ebx=00000000 ecx=0000006d edx=00000000 esi=00000312 edi=0241b120
eip=65f12fae esp=0022eed8 ebp=0022eed8 iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010202

Call stack:
65F12FAE  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F12FAE  _ZN8cbPlugin9OnReleaseEb
65F13015  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F13015  _ZN8cbPlugin9OnReleaseEb
65F12FFD  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F12FFD  _ZN8cbPlugin9OnReleaseEb
65F09005  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F09005  _ZN12cbToolPlugin9BuildMenuEP9wxMenuBar
65F0FAD0  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F0FAD0  _ZN8cbPlugin9OnReleaseEb
65ED7F8E  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65ED7F8E
65EC1B27  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65EC1B27
65EC071E  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65EC071E
65EAADBE  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65EAADBE
65F0A614  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\share\codeblocks\plugins\codecompletion.dll:65F0A614  _ZN12cbToolPlugin9BuildMenuEP9wxMenuBar
618744D0  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.dll:618744D0  _ZN7Manager12ProcessEventER15CodeBlocksEvent
6188B20C  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.dll:6188B20C  _ZN13PluginManager13NotifyPluginsER15CodeBlocksEvent
618A911E  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.dll:618A911E  _ZN14ProjectManager10SetProjectEP9cbProjectb
618B998A  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.dll:618B998A  _ZN14ProjectManager19EndLoadingWorkspaceEv
618AE517  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.dll:618AE517  _ZN14ProjectManager13LoadWorkspaceERK8wxString
0042C476  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:0042C476
0042FDC5  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:0042FDC5
6CCC7670  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCC7670  _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
6CCC77A9  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCC77A9  _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
6CCC7B74  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCC7B74  _ZN12wxEvtHandler12ProcessEventER7wxEvent
6CCC7528  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCC7528  _ZN12wxEvtHandler20ProcessPendingEventsEv
6CC417AE  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CC417AE  _ZN12wxAppConsole20ProcessPendingEventsEv
6D05E549  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6D05E549  _ZN18wxIconLocationBaseC2ERK8wxString
7E42B372  C:\WINNT\system32\USER32.dll:7E42B372  MoveWindow
7E42B317  C:\WINNT\system32\USER32.dll:7E42B317  MoveWindow
7E4278D0  C:\WINNT\system32\USER32.dll:7E4278D0  GetWindowTextLengthW
7C90E473  C:\WINNT\system32\ntdll.dll:7C90E473  KiUserCallbackDispatcher
6CCF569A  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCF569A  _ZN11wxEventLoop8DispatchEv
6CD8D518  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CD8D518  _ZN17wxEventLoopManual3RunEv
6CD6BB19  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CD6BB19  _ZN9wxAppBase8MainLoopEv
004058C4  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004058C4
6CC73248  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CC73248  _Z14wxUninitializev
6CCCD392  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCCD392  _Z7wxEntryP11HINSTANCE__S0_Pci
00401D71  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:00401D71
004627C6  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004627C6
004010DB  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004010DB
00401158  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:00401158
7C817077  C:\WINNT\system32\kernel32.dll:7C817077  RegisterWaitForInputIdle


-------------------

Error occured on Wednesday, May 4, 2011 at 10:50:15.

D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe caused an Access Violation at location 7c919af2 in module C:\WINNT\system32\ntdll.dll Writing to location 00000146.

Registers:
eax=00000136 ebx=00000000 ecx=0000036c edx=01326250 esi=01326240 edi=00000000
eip=7c919af2 esp=0022f8e4 ebp=0022f958 iopl=0         nv up ei pl zr na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010246

Call stack:
7C919AF2  C:\WINNT\system32\ntdll.dll:7C919AF2  RtlpWaitForCriticalSection
7C901046  C:\WINNT\system32\ntdll.dll:7C901046  RtlEnterCriticalSection
6CCC7566  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCC7566  _ZN12wxEvtHandler20ProcessPendingEventsEv
6CC417AE  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CC417AE  _ZN12wxAppConsole20ProcessPendingEventsEv
6D05E549  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6D05E549  _ZN18wxIconLocationBaseC2ERK8wxString
7E42B372  C:\WINNT\system32\USER32.dll:7E42B372  MoveWindow
7E42B317  C:\WINNT\system32\USER32.dll:7E42B317  MoveWindow
7E4278D0  C:\WINNT\system32\USER32.dll:7E4278D0  GetWindowTextLengthW
7C90E473  C:\WINNT\system32\ntdll.dll:7C90E473  KiUserCallbackDispatcher
6CCF569A  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCF569A  _ZN11wxEventLoop8DispatchEv
6CD8D518  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CD8D518  _ZN17wxEventLoopManual3RunEv
6CD6BB19  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CD6BB19  _ZN9wxAppBase8MainLoopEv
004058C4  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004058C4
6CC73248  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CC73248  _Z14wxUninitializev
6CCCD392  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\wxmsw28u_gcc_cb.dll:6CCCD392  _Z7wxEntryP11HINSTANCE__S0_Pci
00401D71  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:00401D71
004627C6  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004627C6
004010DB  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:004010DB
00401158  D:\WORK\03_MISSIONS\00_SDK\IDE\CODEBLOCKS\codeblocks.exe:00401158
7C817077  C:\WINNT\system32\kernel32.dll:7C817077  RegisterWaitForInputIdle


--- End code ---

Sebastien

seb_seb0:
The project is too complex, and I cannot find a minimal test case.
I can see the virtual class in the symbol browser, but the context menu "find declaration" does not work.
In the workspace, if I have projects A + B + C, the bug occurs. If I have A + B, or A + C, or B+C, it works fine...

Consider the 2 images here:
http://img833.imageshack.us/g/test1ms.png/

In the 1st image, consider the virtual class L3D_IRenderSystem.
L3D_IRenderSystem is defined in the lib, and I use a pointer to it in the main program.
I can see it in the symbol browser, but when I right click on "Find the Declaration of : 'L3D_IRenderSystem'", I get the error message "Not found ..."

In the 2nd image, you can see that the parser seems to be stuck somewhere (it can stay a whole day in this state).
Do you have some special tricks to debug the codecompletion plugin ?

Regards,

Sebastien

[attachment deleted by admin]

ollydbg:

--- Quote ---In the 1st image, consider the virtual class L3D_IRenderSystem.
L3D_IRenderSystem is defined in the lib, and I use a pointer to it in the main program.
I can see it in the symbol browser, but when I right click on "Find the Declaration of : 'L3D_IRenderSystem'", I get the error message "Not found ..."
--- End quote ---
"Find the Declaration" is just doing a scope match. I wrote this in the wiki, see:
6 Automatic Code Completion

and about debugging cc plugin, there are two kind of tracer
1, if you want to debug the parser, you can simply follow this:
7 Code completion debugging support

2, if you want to see how "find the declaration works", you should enable the
7.4 Debug Smart Sense log output
Note that CC does not do "full preprocessor" and "type check", so it may failed in parsing something. But if the parser is running endlessly, it mostly has a infinite loop bug, this bug should be fixed.

MortenMacFly:
For the record, the issue you are experiencing and show in "Images.7z" is really a bug. I experience this myself on certain projects, hence I don't know how to reproduce because in fact it does work sometimes and sometimes it does not. :?

It seems (however) not related to the number of parsers or to the option "one parser per workspace".

There are actually two bugs here:
1.) If a parser fails CC should not completely be broken, or at least this parser should be able to re-start / invalidate.
2.) The actual error might be caused by a parser bug, but I do have my doubts here as it sometimes works!

The projects where I am facing this issue have the following structure:
WS:
  PRJ(1..N): A library with default / debug target, virtual target "All"
  PRJ(N+1): A project that creates several executables using the libraries as DLL (debug/release, different setup of compiler flags)
  PRJ(N+2): A project that creates several executables using the libraries statically (debug/release, different setup of compiler flags)
  PRJ(N+3): A testing project

ollydbg:

--- Quote from: MortenMacFly on May 12, 2011, 02:34:12 pm ---There are actually two bugs here:
1.) If a parser fails CC should not completely be broken, or at least this parser should be able to re-start / invalidate.
2.) The actual error might be caused by a parser bug, but I do have my doubts here as it sometimes works!

--- End quote ---
How does a parser know itself get failed? We say a parser get failed mostly because it exit DoParse() function too early, or internally it just Skip to the EOF.

I guess mostly the bug was caused by not correctly beginning search scopes.
e.g.

--- Code: ---...
using namespace std;
...
vector<int> a;

--- End code ---
If we try to resolve the "type" of the variable "a", we need to resolve the type string "vector < int >". Then the first step was try to resolve the string "vector". But if "std" is not in the beginning search scope, then we may failed in resolving the "vector" type. :D. This is my guess until a test code to reproduce it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version