codetools: find gdb line: find proc body

git-svn-id: trunk@44948 -
This commit is contained in:
mattias 2014-05-06 22:00:55 +00:00
parent c239838960
commit a32057acc8
2 changed files with 11 additions and 7 deletions

View File

@ -34,7 +34,7 @@ uses
Classes, SysUtils, FileUtil, LazLoggerBase, LazLogger, SynEdit, IDEDialogs,
SrcEditorIntf, LazIDEIntf, ProjectIntf, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, ButtonPanel, CodyStrConsts, CodeCache, CodeToolManager,
CodeTree, KeywordFuncLists;
CodeTree, KeywordFuncLists, PascalParserTool, LinkScanner;
type
@ -492,12 +492,16 @@ begin
if Node.Desc=ctnProcedure then begin
// proc node => find body
debugln(['TCodyFindGDBLineDialog.FindGDBIdentifier AAA1']);
ClassNode:=Tool.FindClassOrInterfaceNode(Node);
if ClassNode<>nil then begin
debugln(['TCodyFindGDBLineDialog.FindGDBIdentifier AAA2']);
ProcNode:=Tool.FindCorrespondingProcNode(Node);
debugln(['TCodyFindGDBLineDialog.FindGDBIdentifier AAA3 ',ProcNode<>nil]);
try
Tool.BuildTree(lsrInitializationStart);
except
on E: Exception do begin
// ignore
end;
end;
ProcNode:=Tool.FindCorrespondingProcNode(Node,[phpAddClassName]);
if ProcNode<>nil then
Node:=ProcNode;
end;

View File

@ -863,7 +863,7 @@ begin
if ClassNode<>nil then begin
//debugln('TPascalReaderTool.FindCorrespondingProcNode Class');
// in a class definition -> search method body
StartNode:=ClassNode.GetTopMostNodeOfType(ctnTypeSection)
StartNode:=ClassNode.GetTopMostNodeOfType(ctnTypeSection);
end else if NodeIsMethodBody(ProcNode) then begin
//debugln('TPascalReaderTool.FindCorrespondingProcNode Method ',ExtractClassNameOfProcNode(ProcNode));
// in a method body -> search in class
@ -890,7 +890,7 @@ begin
if StartNode=nil then exit;
ProcHead:=ExtractProcHead(ProcNode,Attr);
//debugln('TPascalReaderTool.FindCorrespondingProcNode StartNode=',StartNode.DescAsString,' ProcHead=',dbgstr(ProcHead));
//debugln('TPascalReaderTool.FindCorrespondingProcNode StartNode=',StartNode.DescAsString,' ProcHead=',dbgstr(ProcHead),' ',dbgs(Attr),' ',StartNode.DescAsString);
Result:=FindProcNode(StartNode,ProcHead,Attr);
if Result=ProcNode then begin
// found itself -> search further