Codetool failure on "Find procedure"
Original Reporter info from Mantis: Bart @flyingsheep
-
Reporter name: Bart Broersma
Original Reporter info from Mantis: Bart @flyingsheep
- Reporter name: Bart Broersma
Description:
I just updated from 31810 to 33153, and now I have problems with codetools.
I use Find declaration (Ctrl+Click) to jump to a declaration, then I
use "Find procedure method" (Ctrl+Shiff+Down) to jump to the methods
implementation. All is fine.
Now I try to jump back to the procedure definition "Find procedure
definition" (Ctrl+Shift+Up), and I get an error:
H:\Programmas\SvnLaz\lcl\controls.pp(25,14) Error: cursor pos outside of code
(This exact errormsg results from Ctrl+Click on Button1.SetFocus -> Ctrl+Shift+Down -> Ctrl+Shift+Up)
The weird part is that this only happens to me on WinME.
The exact same revision on my Suse 10.0 (same machine) works perfectly fine.
On a Win7 laptop I also cannot reproduce the issue.
Steps to reproduce:
One TButton on a Form
In Button1Click one line of code:
Button1.SetFocus
- Ctrl+Click on SetFocus -> opens controls.pp @ procedure SetFocus (TWinControl)
- Ctrl+Shift+Down on SetFocus -> opens wincontrol.inc @ TWinControl.SetFocus, with cursor on first line after "begin"
- Ctrl+Click+Up: Error as described above
Additional information:
1.
Sometimes, but not always, after step 2, the caret in the then opened file is not visible, and there is no resposn to Ctrl+Shift+Up. You must first click on the source, or switch between tabs to make the cursor visible.
If this is the case the errormsg changes to:
H:\Programmas\SvnLaz\lcl\controls.pp(-1,15) Error: cursor pos outside of code
(Note the cursorposition: -1,15)
2.
After step 2 in the opened wincontrol.inc Ctrl+Click no longer works, that is the words no longer get underlined and do not respond to clicks.
I finally was able to build the IDE with -dCTDEBUG (had to fix some errors though, see #20605 (closed)).
This would give me a > 700 K logfile, which I can post if needed.
Here's an excerpt from it:
SetPrimaryConfigPath NewValue="H:\Programmas\SvnLaz" -> "H:\Programmas\SvnLaz"
Adding "--pcp=H:\Programmas\SvnLaz" as a parameter
Adding "--debug-log=H:\Programmas\SvnLaz\Lazarus.log" as a parameter
9
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=F:\LazarusProjecten\u_test.pp
[TCodeToolManager.OnGetCodeToolForBuffer]
Sender=F:\LazarusProjecten\u_test.pp
[TCodeToolManager.OnGetCodeToolForBuffer]
Sender=F:\LazarusProjecten\u_test.pp
[TCodeToolManager.OnGetCodeToolForBuffer]
Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
TCodeToolManager.FindDeclaration H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp(y=2003,x=15)
TCodeToolManager.FindDeclaration A F:\LazarusProjecten\u_test.pp x=14 y=39
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\stdctrls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\PROGRAMMAS\SVNLAZ\lcl\lclclasses.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
[TCodeToolManager.OnGetCodeToolForBuffer] Sender=H:\Programmas\fpc\Source\rtl\win32\classes.pp
TCodeToolManager.FindDeclaration H:\PROGRAMMAS\SVNLAZ\lcl\controls.pp(y=2003,x=15)
### TCodeToolManager.HandleException: "cursor pos outside of code" at Line=25 Col=14 in "H:\Programmas\SvnLaz\lcl\controls.pp"
Unit() Start=1411 "unit " End=1700 "}" Self=0A4577CC P=00000000 NB=0A457D6C Interface Section() Start=1700 "inter" End=112518 "" Self=0A457D6C P=00000000 NB=0B85008C
&LtPos;follows 700 K line (witn no lineendings) like:
Uses Section() Start=1762 "uses" End=1977 "rces;" Self=0B68AE70 P=0A457D6C NB=0B68AAB0
use unit() Start=1770 "Class" End=1777 "asses" Self=0ACCF3B8 P=0B68AE70 NB=0B68AED0
use unit() Start=1779 "SysUt" End=1787 "Utils" Self=0B68AED0 P=0B68AE70 NB=0B68A990
Finally followed by: >
TApplication.HandleException Division by zero
Stack trace:
$0064C31D RAISECATCHABLEEXCEPTION, line 358 of fileprocs.pas
$0065D55F TLINKSCANNER__CONSISTENCYCHECK, line 1616 of linkscanner.pas
$00657643 TCODEBUFFER__CONSISTENCYCHECK, line 1252 of codecache.pas
$006565E1 TCODECACHE__CONSISTENCYCHECK, line 931 of codecache.pas
$0069C9E1 TCODETOOLMANAGER__WRITEDEBUGREPORT, line 5761 of codetoolmanager.pas
$00691906 TCODETOOLMANAGER__WRITEERROR, line 1782 of codetoolmanager.pas
$00691719 TCODETOOLMANAGER__HANDLEEXCEPTION, line 1755 of codetoolmanager.pas
$00691C38 TCODETOOLMANAGER__JUMPTOMETHOD, line 1846 of codetoolmanager.pas
$00470A24 TMAINIDE__DOJUMPTOOTHERPROCEDURESECTION, line 15192 of main.pp
$004475AC TMAINIDE__ONPROCESSIDECOMMAND, line 3286 of main.pp
$007A6362 TSOURCENOTEBOOK__PROCESSPARENTCOMMAND, line 7058 of sourceeditor.pp
$007995B2 TSOURCEEDITOR__PROCESSUSERCOMMAND, line 3122 of sourceeditor.pp
$00902DEB TCUSTOMSYNEDIT__DOONPROCESSCOMMAND, line 6735 of synedit.pp
$00900A82 TCUSTOMSYNEDIT__COMMANDPROCESSOR, line 6105 of synedit.pp
$008F68E4 TCUSTOMSYNEDIT__KEYDOWN, line 2436 of synedit.pp
$00571266 TWINCONTROL__KEYDOWNBEFOREINTERFACE, line 5498 of H:/PROGRAMMAS/SVNLAZ/lcl/include/wincontrol.inc
$005714E4 TWINCONTROL__DOKEYDOWNBEFOREINTERFACE, line 5667 of H:/PROGRAMMAS/SVNLAZ/lcl/include/wincontrol.inc
Things I have tried:
- use a brand new clean profile: no change
- open a different project: no change
Using these feature (Find declaration/Find procedure method) in my own libs/programs (with or without include-files) does not trigger the issue.
Mantis conversion info:
- Mantis ID: 20606
- OS: WinMe
- OS Build: MS
- Build: 33190
- Platform: i386
- Version: 0.9.31 (SVN)
- Fixed in version: 0.9.31 (SVN)