2
This file is part of the Free Pascal Integrated Development Environment
3
Copyright (c) 1998 by Berczi Gabor
5
Symbol browse support routines for the IDE
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
20
uses Objects,Drivers,Views,Menus,Dialogs,
29
{ Browser tab constants }
38
PBrowserWindow = ^TBrowserWindow;
40
PGDBValueCollection = ^TGDBValueCollection;
42
PGDBValue = ^TGDBValue;
43
TGDBValue = Object(TObject)
44
constructor Init(Const AExpr : String;ASym : PSymbol);
46
function GetText : String;
47
destructor Done;virtual;
55
TGDBValueCollection = Object(TCollection)
56
function At(Index: sw_Integer): PGDBValue;
60
PSymbolView = ^TSymbolView;
61
TSymbolView = object(TLocalMenuListBox)
62
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
63
destructor Done;virtual;
64
procedure HandleEvent(var Event: TEvent); virtual;
65
procedure SetState(AState: Word; Enable: Boolean); virtual;
66
function GotoItem(Item: sw_integer): boolean; virtual;
67
function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
68
function GetPalette: PPalette; virtual;
69
function GetLocalMenu: PMenu; virtual;
70
procedure ClearHighlights;
71
procedure AutoTrackSource; virtual;
72
procedure Browse; virtual;
73
procedure GotoSource; virtual;
74
procedure TrackSource; virtual;
75
procedure OptionsDlg; virtual;
77
MyBW : PBrowserWindow;
78
function TrackReference(R: PReference; AutoTrack: boolean): boolean; virtual;
79
function GotoReference(R: PReference): boolean; virtual;
82
PSymbolScopeView = ^TSymbolScopeView;
83
TSymbolScopeView = object(TSymbolView)
84
constructor Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
85
destructor Done; virtual;
87
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
88
procedure HandleEvent(var Event: TEvent); virtual;
89
procedure Draw; virtual;
90
procedure LookUp(S: string); virtual;
91
function GotoItem(Item: sw_integer): boolean; virtual;
92
function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
94
Symbols: PSymbolCollection;
95
SymbolsValue : PGDBValueCollection;
99
PSymbolReferenceView = ^TSymbolReferenceView;
100
TSymbolReferenceView = object(TSymbolView)
101
constructor Init(var Bounds: TRect; AReferences: PReferenceCollection; AHScrollBar, AVScrollBar: PScrollBar);
102
destructor Done; virtual;
103
procedure HandleEvent(var Event: TEvent); virtual;
104
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
105
procedure SelectItem(Item: Sw_Integer); virtual;
106
function GotoItem(Item: sw_integer): boolean; virtual;
107
function TrackItem(Item: sw_integer; AutoTrack: boolean): boolean; virtual;
108
procedure Browse; virtual;
110
References: PReferenceCollection;
113
PSymbolMemInfoView = ^TSymbolMemInfoView;
114
TSymbolMemInfoView = object(TStaticText)
115
constructor Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
116
destructor Done; virtual;
117
procedure GetText(var S: String); virtual;
118
function GetPalette: PPalette; virtual;
120
MemInfo: PSymbolMemInfo;
121
MyBW : PBrowserWindow;
124
PSymbolMemoView = ^TSymbolMemoView;
125
TSymbolMemoView = object(TFPMemo)
126
function GetPalette: PPalette; virtual;
129
PSymbolInheritanceView = ^TSymbolInheritanceView;
131
TSymbolInheritanceView = object(TOutlineViewer)
132
{$else notHASOUTLINE}
133
TSymbolInheritanceView = object(TLocalMenuListBox)
135
constructor Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
136
destructor Done; virtual;
137
function GetRoot: Pointer; virtual;
138
function HasChildren(Node: Pointer): Boolean; virtual;
139
function GetChild(Node: Pointer; I: sw_Integer): Pointer; virtual;
140
function GetNumChildren(Node: Pointer): sw_Integer; virtual;
141
function GetNumChildrenExposed(Node: Pointer) : sw_Integer; virtual;
142
procedure Adjust(Node: Pointer; Expand: Boolean); virtual;
143
function IsExpanded(Node: Pointer): Boolean; virtual;
145
function GetText(Node: Pointer): String; virtual;
146
{$else not HASOUTLINE}
147
procedure ExpandAll(Node: Pointer);
148
function GetNode(I : sw_Integer) : Pointer; virtual;
149
function GetLineNode(Item : sw_Integer) : Pointer; virtual;
150
function GetText(Item,MaxLen: Sw_Integer): String; virtual;
152
procedure NodeSelected(P: pointer); virtual;
153
procedure Selected(I: sw_Integer); virtual;
154
procedure HandleEvent(var Event: TEvent); virtual;
155
function GetPalette: PPalette; virtual;
157
Root : PObjectSymbol;
158
MyBW : PBrowserWindow;
161
PBrowserTabItem = ^TBrowserTabItem;
162
TBrowserTabItem = record
165
Next : PBrowserTabItem;
168
PBrowserTab = ^TBrowserTab;
169
TBrowserTab = object(TView)
170
Items: PBrowserTabItem;
171
constructor Init(var Bounds: TRect; AItems: PBrowserTabItem);
172
function GetItemCount: sw_integer; virtual;
173
function GetItem(Index: sw_integer): PBrowserTabItem; virtual;
174
procedure SetParams(AFlags: word; ACurrent: Sw_integer); virtual;
175
procedure SelectItem(Index: Sw_integer); virtual;
176
procedure Draw; virtual;
177
function GetPalette: PPalette; virtual;
178
procedure HandleEvent(var Event: TEvent); virtual;
179
destructor Done; virtual;
182
Current : Sw_integer;
185
PUnitInfoPanel = ^TUnitInfoPanel;
186
TUnitInfoPanel = object(TPanel)
187
InOwnerCall: boolean;
188
procedure HandleEvent(var Event: TEvent); virtual;
191
TBrowserWindow = object(TFPWindow)
192
constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
193
const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
194
AInheritance: PObjectSymbol; AMemInfo: PSymbolMemInfo);
195
procedure HandleEvent(var Event: TEvent); virtual;
196
procedure SetState(AState: Word; Enable: Boolean); virtual;
197
procedure Close; virtual;
198
procedure SelectTab(BrowserTab: Sw_integer); virtual;
199
function GetPalette: PPalette; virtual;
200
function Disassemble : boolean;
201
destructor Done;virtual;
203
PageTab : PBrowserTab;
206
ScopeView : PSymbolScopeView;
207
ReferenceView : PSymbolReferenceView;
208
InheritanceView: PSymbolInheritanceView;
209
MemInfoView : PSymbolMemInfoView;
210
UnitInfoText : PSymbolMemoView;
211
UnitInfoUsed : PSymbolScopeView;
212
UnitInfoDependent : PSymbolScopeView;
213
UnitInfo : PUnitInfoPanel;
216
DebuggerValue : PGDBValue;
219
procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
220
ParentBrowser : PBrowserWindow;
221
Symbols: PSymbolCollection; References: PReferenceCollection;
222
Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
224
function IsSymbolInfoAvailable: boolean;
226
procedure OpenOneSymbolBrowser(Name : String);
228
procedure CloseAllBrowsers;
230
procedure RemoveBrowsersCollection;
233
GlobalsCollection : PSortedCollection = nil;
234
ProcedureCollection : PSortedCollection = nil;
235
ModulesCollection : PSortedCollection = nil;
245
FPConst,FPUtils,FPVars,{$ifndef FPDEBUG}FPDebug{$endif},FPIDE;
247
{$ifdef USERESSTRINGS}
252
msg_symbolnotfound = #3'Symbol %s not found';
253
msg_nobrowserinfoavailable = 'No Browser info available';
254
msg_cantfindfile = 'Can''t find %s';
256
menu_local_gotosource = '~G~oto source';
257
menu_local_tracksource = '~T~rack source';
258
menu_local_options = '~O~ptions...';
259
menu_local_clear = '~C~lear';
260
menu_local_saveas = 'Save ~a~s';
262
{ Symbol view local menu items }
263
menu_symlocal_browse = '~B~rowse';
264
menu_symlocal_gotosource = '~G~oto source';
265
menu_symlocal_tracksource = '~T~rack source';
266
menu_symlocal_options = '~O~ptions...';
268
{ Symbol browser meminfo page }
269
msg_sizeinmemory = 'Size in memory';
270
msg_sizeonstack = 'Size on stack';
272
msg_usedfirstin = 'Used first in';
273
msg_mainsource = 'Main source';
274
msg_sourcefiles = 'Source files';
276
dialog_browse = 'Browse: %s';
278
const { Symbol browser tabs }
279
{ must be char constants (so cannot be resourcestring)}
280
label_browsertab_scope = 'S';
281
label_browsertab_reference = 'R';
282
label_browsertab_inheritance = 'I';
283
label_browsertab_memory = 'M';
284
label_browsertab_unit = 'U';
286
procedure CloseAllBrowsers;
287
procedure SendCloseIfBrowser(P: PView); {$ifndef FPC}far;{$endif}
290
((TypeOf(P^)=TypeOf(TBrowserWindow)) or
291
(TypeOf(P^)=TypeOf(TSymbolView)) or
292
(TypeOf(P^)=TypeOf(TSymbolScopeView)) or
293
(TypeOf(P^)=TypeOf(TSymbolReferenceView)) or
294
(TypeOf(P^)=TypeOf(TSymbolMemInfoView)) or
295
(TypeOf(P^)=TypeOf(TSymbolInheritanceView)) or
296
(TypeOf(P^)=TypeOf(TSymbolMemoView))) then
297
Message(P,evCommand,cmClose,nil);
301
Desktop^.ForEach(@SendCloseIfBrowser);
304
procedure RemoveBrowsersCollection;
306
if assigned(GlobalsCollection) then
308
GlobalsCollection^.deleteAll;
309
Dispose(GlobalsCollection,done);
310
GlobalsCollection:=nil;
312
if assigned(ProcedureCollection) then
314
ProcedureCollection^.deleteAll;
315
Dispose(ProcedureCollection,done);
316
ProcedureCollection:=nil;
318
if assigned(ModulesCollection) then
320
ModulesCollection^.deleteAll;
321
Dispose(ModulesCollection,done);
322
ModulesCollection:=nil;
326
function NewBrowserTabItem(ASign: char; ALink: PView; ANext: PBrowserTabItem): PBrowserTabItem;
327
var P: PBrowserTabItem;
329
New(P); FillChar(P^,SizeOf(P^),0);
330
with P^ do begin Sign:=ASign; Link:=ALink; Next:=ANext; end;
331
NewBrowserTabItem:=P;
334
procedure DisposeBrowserTabItem(P: PBrowserTabItem);
336
if P<>nil then Dispose(P);
339
procedure DisposeBrowserTabList(P: PBrowserTabItem);
343
if P^.Next<>nil then DisposeBrowserTabList(P^.Next);
344
DisposeBrowserTabItem(P);
348
function IsSymbolInfoAvailable: boolean;
350
IsSymbolInfoAvailable:=BrowCol.Modules<>nil;
353
procedure OpenOneSymbolBrowser(Name : String);
355
var Index : sw_integer;
359
Symbols: PSymbolCollection;
361
function Search(P : PSymbol) : boolean;
363
Search:=UpcaseStr(P^.Items^.LookUp(Name,Index))=Name;
367
Name:=UpcaseStr(Name);
368
If BrowCol.Modules<>nil then
370
PS:=BrowCol.Modules^.FirstThat(@Search);
373
S:=PS^.Items^.At(Index);
375
if (not assigned(symbols) or (symbols^.count=0)) and
376
assigned(S^.Ancestor) then
377
Symbols:=S^.Ancestor^.Items;
378
if (S^.Flags and (sfObject or sfClass))=0 then
380
else if S^.Ancestor=nil then
383
Anc:=SearchObjectForSymbol(S^.Ancestor);
384
OpenSymbolBrowser(0,20,
385
PS^.Items^.At(Index)^.GetName,
386
PS^.Items^.At(Index)^.GetText,
387
PS^.Items^.At(Index),nil,
388
Symbols,PS^.Items^.At(Index)^.References,Anc,PS^.MemInfo);
393
ErrorBox(msg_symbolnotfound,@P);
397
ErrorBox(msg_nobrowserinfoavailable,nil);
400
(*procedure ReadBrowseLog(FileName: string);
402
IOOK,EndOfFile: boolean;
410
procedure ProcessSymTable(Indent: integer; Owner: PSymbolCollection);
411
var IndentS,S,Source: string;
413
Ref: PSymbolReference;
418
Params: array[0..30] of PString;
423
IndentS:=CharStr(' ',Indent); ExitBack:=false;
426
if copy(Line,1,length(IndentS))<>IndentS then ExitBack:=true else
427
if copy(Line,Indent+1,3)='***' then
430
S:=copy(Line,Indent+1+3,255);
431
P:=Pos('***',S); if P=0 then P:=length(S)+1;
432
S:=Trim(copy(S,1,P-1));
433
if (copy(S,1,1)='_') and (Pos('$$',S)>0) then
437
if P>0 then Delete(S,1,P+1);
443
P:=Pos('$',S); if P=0 then P:=length(S)+1;
444
Params[PCount]:=TypeNames^.Add(copy(S,1,P-1));
449
Sym^.SetParams(PCount,@Params);
452
New(Sym, Init(S, varsym, 0, nil));
456
if copy(Line,Indent+1,3)='---' then
459
S:=Trim(copy(Line,Indent+1+12,255));
460
if Level=1 then Typ:=unitsym else
462
if (Sym<>nil) and (Sym^.GetName=S) then
465
New(Sym, Init(S, Typ, 0, nil));
470
New(Sym^.Items, Init(0,50));
471
ProcessSymTable(Indent+2,Sym^.Items);
474
if copy(Line,Indent+1,1)=' ' then
477
S:=copy(Line,Indent+1+2,255);
478
P:=Pos('(',S); if P=0 then P:=length(S)+1;
479
Source:=Trim(copy(S,1,P-1)); Delete(S,1,P);
480
P:=Pos(',',S); if P=0 then P:=length(S)+1;
481
PX.Y:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
482
P:=Pos(')',S); if P=0 then P:=length(S)+1;
483
PX.X:=StrToInt(copy(S,1,P-1)); Delete(S,1,P);
484
PS:=ModuleNames^.Add(Source);
485
New(Ref, Init(PS, PX));
486
if Sym^.References=nil then
487
New(Sym^.References, Init(10,50));
488
Sym^.References^.Insert(Ref);
490
if ExitBack=false then
492
until EndOfFile or ExitBack;
504
while (IOResult=0) and (EndOfFile=false) do
505
ProcessSymTable(0,Modules);
512
{****************************************************************************
514
****************************************************************************}
516
constructor TGDBValue.Init(Const AExpr : String;ASym : PSymbol);
524
destructor TGDBValue.Done;
531
If Assigned(Expr) then
538
procedure TGDBValue.GetValue;
544
if not assigned(Debugger) then
546
if not Debugger^.IsRunning then
548
if (S^.typ in [fieldvarsym,staticvarsym,localvarsym,paravarsym]) or (GDBI=Debugger^.RunCount) then
552
if assigned(Expr) then
554
p:=Debugger^.GetValue(Expr^);
555
St:=NewStr(GetPChar(p));
558
GDBI:=Debugger^.RunCount;
560
{$endif ndef NODEBUG}
564
function TGDBValue.GetText : String;
568
GetText:=S^.GetText+' = '+GetStr(St)
573
{****************************************************************************
575
****************************************************************************}
576
function TGDBValueCollection.At(Index: sw_Integer): PGDBValue;
578
At:= Inherited At(Index);
580
{****************************************************************************
582
****************************************************************************}
584
constructor TSymbolView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar);
586
inherited Init(Bounds,1,AVScrollBar);
587
HScrollBar:=AHScrollBar;
589
if assigned(HScrollBar) then
591
HScrollBar^.SetRange(1,80);
593
Options:=Options or (ofSelectable+ofTopSelect);
594
EventMask:=EventMask or evBroadcast;
597
procedure TSymbolView.ClearHighlights;
599
Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
602
procedure TSymbolView.AutoTrackSource;
608
procedure TSymbolView.OptionsDlg;
613
destructor TSymbolView.Done;
615
EventMask:=EventMask and not evBroadcast;
619
procedure TSymbolView.SetState(AState: Word; Enable: Boolean);
623
inherited SetState(AState,Enable);
624
if ((OState xor State) and sfFocused)<>0 then
625
if GetState(sfFocused) then
627
if (MiscOptions and moAutoTrackSource)<>0 then
631
Message(Desktop,evBroadcast,cmClearLineHighlights,nil);
634
procedure TSymbolView.Browse;
639
procedure TSymbolView.GotoSource;
641
if GotoItem(Focused) then
642
PutCommand(Owner,evCommand,cmClose,nil);
645
procedure TSymbolView.TrackSource;
647
TrackItem(Focused,false);
650
procedure TSymbolView.HandleEvent(var Event: TEvent);
651
var DontClear: boolean;
657
case Event.KeyCode of
665
if HScrollBar<>nil then
666
HScrollBar^.HandleEvent(Event);
667
else DontClear:=true;
669
if DontClear=false then ClearEvent(Event);
682
case Event.Command of
691
else DontClear:=true;
693
if DontClear=false then ClearEvent(Event);
696
case Event.Command of
698
if Event.InfoPtr=@Self then
699
if (MiscOptions and moAutoTrackSource)<>0 then
700
if GetState(sfFocused) then
704
inherited HandleEvent(Event);
707
function TSymbolView.GetPalette: PPalette;
709
P: string[length(CBrowserListBox)] = CBrowserListBox;
714
function TSymbolView.GetLocalMenu: PMenu;
716
GetLocalMenu:=NewMenu(
717
NewItem(menu_symlocal_browse,'',kbNoKey,cmSymBrowse,hcSymBrowse,
718
NewItem(menu_symlocal_gotosource,'',kbNoKey,cmSymGotoSource,hcSymGotoSource,
719
NewItem(menu_symlocal_tracksource,'',kbNoKey,cmSymTrackSource,hcSymTrackSource,
721
NewItem(menu_symlocal_options,'',kbNoKey,cmSymOptions,hcSymOptions,
725
function TSymbolView.GotoItem(Item: sw_integer): boolean;
731
function TSymbolView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
737
function LastBrowserWindow: PBrowserWindow;
738
var BW: PBrowserWindow;
739
procedure IsBW(P: PView); {$ifndef FPC}far;{$endif}
741
if (P^.HelpCtx=hcBrowserWindow) then
746
Desktop^.ForEach(@IsBW);
747
LastBrowserWindow:=BW;
750
function TSymbolView.TrackReference(R: PReference; AutoTrack: boolean): boolean;
751
var W: PSourceWindow;
757
P.X:=R^.Position.X-1; P.Y:=R^.Position.Y-1;
759
W:=SearchOnDesktop(R^.GetFileName,false)
761
W:=TryToOpenFile(nil,R^.GetFileName,P.X,P.Y,true);
762
if not assigned(W) then
765
if IDEApp.OpenSearch(R^.GetFileName+'*') then
767
W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
775
BW:=LastBrowserWindow;
781
Desktop^.InsertBefore(W,BW^.NextView);
783
W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P.Y);
786
if Assigned(W)=false then
787
ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
789
TrackReference:=W<>nil;
792
function TSymbolView.GotoReference(R: PReference): boolean;
793
var W: PSourceWindow;
796
W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
802
if IDEApp.OpenSearch(R^.GetFileName+'*') then
804
W:=TryToOpenFile(nil,R^.GetFileName,R^.Position.X-1,R^.Position.Y-1,true);
811
if Assigned(W)=false then
812
ErrorBox(FormatStrStr(msg_cantfindfile,R^.GetFileName),nil);
813
GotoReference:=W<>nil;
816
{****************************************************************************
818
****************************************************************************}
820
constructor TSymbolScopeView.Init(var Bounds: TRect; ASymbols: PSymbolCollection; AHScrollBar, AVScrollBar: PScrollBar);
822
inherited Init(Bounds,AHScrollBar, AVScrollBar);
825
New(SymbolsValue,Init(50,50));
826
SetRange(Symbols^.Count);
829
destructor TSymbolScopeView.Done;
831
{if assigned(Symbols) then
833
the elements belong to other lists
835
dispose(Symbols,done);
837
if Assigned(SymbolsValue) then
839
Dispose(SymbolsValue,Done);
845
procedure TSymbolScopeView.HandleEvent(var Event: TEvent);
846
var OldFocus: sw_integer;
850
case Event.KeyCode of
853
LookUp(copy(LookUpStr,1,length(LookUpStr)-1));
857
if Event.CharCode in[#33..#255] then
859
LookUp(LookUpStr+Event.CharCode);
865
inherited HandleEvent(Event);
866
if OldFocus<>Focused then
870
procedure TSymbolScopeView.Draw;
871
var DeltaX: sw_integer;
874
if Assigned(HScrollBar)=false then DeltaX:=0 else
875
DeltaX:=HScrollBar^.Value-HScrollBar^.Min;
876
SetCursor(2+SymbolTypLen+length(LookUpStr)-DeltaX,Focused-TopItem);
879
procedure TSymbolScopeView.LookUp(S: string);
880
var Idx,Slength: Sw_integer;
885
if (Symbols=nil) or (S='') then NS:='' else
887
S:=Symbols^.LookUp(S,Idx);
894
LookUpStr:=Copy(NS,1,Slength);
895
SetState(sfCursorVis,LookUpStr<>'');
899
function TSymbolScopeView.GotoItem(Item: sw_integer): boolean;
907
OK:=(S^.References<>nil) and (S^.References^.Count>0);
909
OK:=GotoReference(S^.References^.At(0));
914
function TSymbolScopeView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
922
OK:=(S^.References<>nil) and (S^.References^.Count>0);
924
OK:=TrackReference(S^.References^.At(0),AutoTrack);
929
procedure TSymbolScopeView.SetGDBCol;
933
if assigned(MyBW) and (SymbolsValue^.Count=0) then
935
For i:=0 to Symbols^.Count-1 do
938
SymbolsValue^.Insert(New(PGDBValue,Init(GetStr(MyBW^.Prefix)+S^.GetName,S)));
943
function TSymbolScopeView.GetText(Item,MaxLen: Sw_Integer): String;
948
S:=Symbols^.At(Item);
949
if Assigned(SymbolsValue) and (SymbolsValue^.Count>Item) then
950
SG:=SymbolsValue^.At(Item)
957
GetText:=copy(S1,1,MaxLen);
961
{****************************************************************************
963
****************************************************************************}
965
constructor TSymbolReferenceView.Init(var Bounds: TRect; AReferences: PReferenceCollection;
966
AHScrollBar, AVScrollBar: PScrollBar);
968
inherited Init(Bounds,AHScrollBar, AVScrollBar);
969
References:=AReferences;
970
NewList(AReferences);
971
SetRange(References^.Count);
974
destructor TSymbolReferenceView.Done;
979
procedure TSymbolReferenceView.HandleEvent(var Event: TEvent);
980
var OldFocus: sw_integer;
988
case Event.KeyCode of
990
TrackItem(Focused,false);
993
else DontClear:=true;
995
if DontClear=false then ClearEvent(Event);
998
inherited HandleEvent(Event);
999
if OldFocus<>Focused then
1000
if (MiscOptions and moAutoTrackSource)=0 then
1004
procedure TSymbolReferenceView.Browse;
1009
function TSymbolReferenceView.GetText(Item,MaxLen: Sw_Integer): String;
1013
P:=References^.At(Item);
1014
S:=P^.GetFileName+'('+IntToStr(P^.Position.Y)+','+IntToStr(P^.Position.X)+')';
1015
GetText:=copy(S,1,MaxLen);
1018
function TSymbolReferenceView.GotoItem(Item: sw_integer): boolean;
1023
OK:=GotoReference(List^.At(Item));
1027
function TSymbolReferenceView.TrackItem(Item: sw_integer; AutoTrack: boolean): boolean;
1032
OK:=TrackReference(List^.At(Item),AutoTrack);
1036
procedure TSymbolReferenceView.SelectItem(Item: Sw_Integer);
1042
constructor TSymbolMemInfoView.Init(var Bounds: TRect; AMemInfo: PSymbolMemInfo);
1044
inherited Init(Bounds,'');
1045
Options:=Options or (ofSelectable+ofTopSelect);
1050
destructor TSymbolMemInfoView.Done;
1052
{ if assigned(MemInfo) then
1057
procedure TSymbolMemInfoView.GetText(var S: String);
1058
function SizeStr(Size: longint): string;
1061
S:=IntToStrL(Size,7);
1063
if Size>1 then S:=S+'s';
1069
function AddrStr(Addr: longint): string;
1070
{ Warning this is endian specific code !! (PM) }
1071
type TLongint = record LoW,HiW: word; end;
1073
with TLongint(Addr) do
1074
AddrStr:='$'+hexstr(HiW,4)+hexstr(LoW,4);
1078
AddFormatParamStr(msg_sizeinmemory);
1079
AddFormatParamStr(msg_sizeonstack);
1083
{ ' Memory location: '+AddrStr(MemInfo^.Addr)+#13+
1084
' Local address: '+AddrStr(MemInfo^.LocalAddr)+#13+}
1086
{ ??? internal linker ??? }
1088
'%18s: '+SizeStr(MemInfo^.Size)+#13+
1089
'%18s: '+SizeStr(MemInfo^.PushSize)+#13+
1094
function TSymbolMemInfoView.GetPalette: PPalette;
1096
GetPalette:=inherited GetPalette;
1099
function TSymbolMemoView.GetPalette: PPalette;
1100
const P: string[length(CFPSymbolMemo)] = CFPSymbolMemo;
1105
{****************************************************************************
1106
TSymbolInheritanceView
1107
****************************************************************************}
1109
constructor TSymbolInheritanceView.Init(var Bounds: TRect; AHScrollBar, AVScrollBar: PScrollBar; ARoot: PObjectSymbol);
1112
inherited Init(Bounds,AHScrollBar,AVScrollBar);
1113
{$else not HASOUTLINE}
1114
inherited Init(Bounds,1,AVScrollBar);
1115
HScrollBar:=AHScrollBar;
1116
{$endif not HASOUTLINE}
1117
Options:=Options or (ofSelectable+ofTopSelect);
1123
{$else not HASOUTLINE}
1124
SetRange(GetNumChildrenExposed(Root));
1125
{$endif not HASOUTLINE}
1128
destructor TSymbolInheritanceView.Done;
1131
belongs to a symbolcollection (PM)
1132
if assigned(Root) then
1133
dispose(Root,done); }
1137
function TSymbolInheritanceView.GetRoot: Pointer;
1142
function TSymbolInheritanceView.HasChildren(Node: Pointer): Boolean;
1144
HasChildren:=GetNumChildren(Node)>0;
1147
function TSymbolInheritanceView.GetChild(Node: Pointer; I: sw_Integer): Pointer;
1149
GetChild:=PObjectSymbol(Node)^.GetDescendant(I);
1152
function TSymbolInheritanceView.GetNumChildren(Node: Pointer): sw_Integer;
1154
GetNumChildren:=PObjectSymbol(Node)^.GetDescendantCount;
1157
function TSymbolInheritanceView.GetNumChildrenExposed(Node: Pointer) : sw_Integer;
1161
Procedure AddCount(P : PObjectSymbol);
1166
if not assigned(P) then
1168
Count:=P^.GetDescendantCount;
1170
for I:=0 to Count-1 do
1172
D:=P^.GetDescendant(I);
1179
GetNumChildrenExposed:=Nb;
1183
procedure TSymbolInheritanceView.Adjust(Node: Pointer; Expand: Boolean);
1185
PObjectSymbol(Node)^.Expanded:=Expand;
1188
function TSymbolInheritanceView.IsExpanded(Node: Pointer): Boolean;
1190
IsExpanded:=PObjectSymbol(Node)^.Expanded;
1193
procedure TSymbolInheritanceView.HandleEvent(var Event: TEvent);
1194
var DontClear: boolean;
1195
{$ifndef HASOUTLINE}
1203
case Event.KeyCode of
1204
{$ifndef HASOUTLINE}
1206
NodeSelected(GetLineNode(Cursor.Y-Origin.Y));
1209
kbCtrlLeft,kbCtrlRight :
1210
if Assigned(HScrollBar) then
1211
HScrollBar^.HandleEvent(Event)
1214
else DontClear:=true;
1216
if DontClear=false then ClearEvent(Event);
1220
{$ifndef HASOUTLINE}
1221
MakeLocal(Event.Where,P);
1224
if Event.double then
1226
Message(@Self,evKeyDown,kbEnter,nil);
1231
inherited HandleEvent(Event);
1234
function TSymbolInheritanceView.GetPalette: PPalette;
1235
const P: string[length(CBrowserOutline)] = CBrowserOutline;
1241
function TSymbolInheritanceView.GetText(Node: Pointer): String;
1243
GetText:=PObjectSymbol(Node)^.GetName;
1246
{$else not HASOUTLINE}
1247
function TSymbolInheritanceView.GetNode(I : sw_Integer) : Pointer;
1253
P:=P^.GetDescendant(I);
1254
GetNode:=Pointer(P);
1257
procedure TSymbolInheritanceView.ExpandAll(Node: Pointer);
1263
For i:=0 to GetNumChildren(Node)-1 do
1265
P:=GetChild(Node,I);
1271
function TSymbolInheritanceView.GetLineNode(Item : sw_Integer) : Pointer;
1275
procedure FindSymbol(var P:PObjectSymbol);
1280
if not assigned(P) then
1283
While (NT<Item) and (Des<GetNumChildren(P)) do
1285
Q:=P^.GetDescendant(Des);
1292
Nc:=GetNumChildrenExposed(Q);
1312
function TSymbolInheritanceView.GetText(Item,MaxLen: Sw_Integer): String;
1314
P,Ans : PObjectSymbol;
1315
NC,NT,NumParents : Integer;
1317
procedure FindSymbol(var P:PObjectSymbol);
1322
if not assigned(P) then
1325
While (NT<Item) and (Des<GetNumChildren(P)) do
1327
Q:=P^.GetDescendant(Des);
1334
Nc:=GetNumChildrenExposed(Q);
1357
While Assigned(Ans) do
1362
S:=CharStr('-',NumParents)+S;
1363
GetText:=Copy(S,1,MaxLen);
1372
procedure TSymbolInheritanceView.Selected(I: sw_Integer);
1379
procedure TSymbolInheritanceView.NodeSelected(P: pointer);
1387
S:=PObjectSymbol(P)^.Symbol;
1389
{ this happens for the top objects view (PM) }
1393
if S^.Ancestor=nil then
1396
Anc:=SearchObjectForSymbol(S^.Ancestor);
1397
OpenSymbolBrowser(Origin.X-1,
1400
{$else not HASOUTLINE}
1402
{$endif not HASOUTLINE}
1405
S^.Items,S^.References,Anc,S^.MemInfo);
1409
{****************************************************************************
1411
****************************************************************************}
1413
constructor TBrowserTab.Init(var Bounds: TRect; AItems: PBrowserTabItem);
1415
inherited Init(Bounds);
1416
Options:=Options or ofPreProcess;
1421
procedure TBrowserTab.SetParams(AFlags: word; ACurrent: Sw_integer);
1424
SelectItem(ACurrent);
1427
procedure TBrowserTab.SelectItem(Index: Sw_integer);
1428
var P: PBrowserTabItem;
1431
P:=GetItem(Current);
1432
if (P<>nil) and (P^.Link<>nil) then
1437
function TBrowserTab.GetItemCount: sw_integer;
1447
GetItemCount:=Count;
1450
function TBrowserTab.GetItem(Index: sw_integer): PBrowserTabItem;
1451
var Counter: integer;
1456
while (P<>nil) and (Counter<Index) do
1464
procedure TBrowserTab.Draw;
1466
SelColor, NormColor, C: word;
1467
I,CurX,Count: Sw_integer;
1468
function Names(Idx: integer): char;
1470
Names:=GetItem(Idx)^.Sign;
1473
NormColor:=GetColor(1); SelColor:=GetColor(2);
1474
MoveChar(B,'�',SelColor,Size.X);
1476
for I:=0 to GetItemCount-1 do
1477
if (Flags and (1 shl I))<>0 then
1480
if Current=I then C:=SelColor
1482
if Count=1 then MoveChar(B[CurX],'�',SelColor,1)
1483
else MoveChar(B[CurX],'�',SelColor,1);
1484
MoveCStr(B[CurX+1],' '+Names(I)+' ',C);
1488
MoveChar(B[CurX],'�',SelColor,1);
1489
WriteLine(0,0,Size.X,Size.Y,B);
1492
procedure TBrowserTab.HandleEvent(var Event: TEvent);
1496
function GetItemForCoord(X: integer): integer;
1497
var I,CurX,Idx: integer;
1500
for I:=0 to GetItemCount-1 do
1501
if (Flags and (1 shl I))<>0 then
1503
if (CurX+1<=X) and (X<=CurX+3) then
1504
begin Idx:=I; Break; end;
1507
GetItemForCoord:=Idx;
1512
if MouseInView(Event.Where) then
1515
MakeLocal(Event.Where,P);
1516
Idx:=GetItemForCoord(P.X);
1519
until not MouseEvent(Event, evMouseMove);
1524
DontClear:=false; Idx:=-1;
1525
for I:=0 to GetItemCount-1 do
1526
if (GetCtrlCode(GetItem(I)^.Sign)=Event.KeyCode){ or
1527
(GetItem(I)^.Sign=UpCase(Event.CharCode))} then
1528
if (Flags and (1 shl I))<>0 then
1537
if DontClear=false then ClearEvent(Event);
1540
inherited HandleEvent(Event);
1543
function TBrowserTab.GetPalette: PPalette;
1544
const P: string[length(CBrowserTab)] = CBrowserTab;
1549
destructor TBrowserTab.Done;
1551
if Items<>nil then DisposeBrowserTabList(Items);
1555
procedure TUnitInfoPanel.HandleEvent(var Event: TEvent);
1557
if (Event.What=evBroadcast) and (Event.Command=cmListItemSelected) and
1558
(InOwnerCall=false) then
1561
if Assigned(Owner) then
1562
Owner^.HandleEvent(Event);
1565
inherited HandleEvent(Event);
1568
constructor TBrowserWindow.Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Sw_Integer;ASym : PSymbol;
1569
const AName,APrefix: string; ASymbols: PSymbolCollection; AReferences: PReferenceCollection;
1570
AInheritance: PObjectSymbol; AMemInfo: PSymbolMemINfo);
1572
HSB,VSB: PScrollBar;
1573
CST: PColorStaticText;
1575
function CreateVSB(R: TRect): PScrollBar;
1579
R2.Copy(R); R2.Move(1,0); R2.A.X:=R2.B.X-1;
1580
New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoX+gfGrowHiX+gfGrowHiY;
1583
function CreateHSB(R: TRect): PScrollBar;
1587
R2.Copy(R); R2.Move(0,1); R2.A.Y:=R2.B.Y-1;
1588
New(SB, Init(R2)); SB^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
1592
inherited Init(Bounds, FormatStrStr(dialog_browse,ATitle), ANumber);
1593
HelpCtx:=hcBrowserWindow;
1595
Prefix:=NewStr(APrefix);
1597
GetExtent(R); R.Grow(-1,-1); R.B.Y:=R.A.Y+1;
1599
if {assigned(Debugger) and Debugger^.IsRunning and}
1600
assigned(Sym) and (Sym^.typ in [fieldvarsym,staticvarsym,localvarsym,paravarsym]) then
1602
New(DebuggerValue,Init(ATitle,Sym));
1603
New(ST, Init(R, ' '+DebuggerValue^.GetText));
1608
New(ST, Init(R, ' '+AName));
1611
ST^.GrowMode:=gfGrowHiX;
1614
GetExtent(R); R.Grow(-1,-1); Inc(R.A.Y,2);
1615
if assigned(ASymbols) and (ASymbols^.Count>0) then
1621
New(ScopeView, Init(R, ASymbols, HSB, VSB));
1622
ScopeView^.GrowMode:=gfGrowHiX+gfGrowHiY;
1624
ScopeView^.MyBW:=@Self;
1625
ScopeView^.SetGDBCol;
1627
if assigned(AReferences) and (AReferences^.Count>0) then
1633
New(ReferenceView, Init(R, AReferences, HSB, VSB));
1634
ReferenceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
1635
Insert(ReferenceView);
1636
ReferenceView^.MyBW:=@Self;
1638
if assigned(AInheritance) then
1644
New(InheritanceView, Init(R, HSB,VSB, AInheritance));
1645
InheritanceView^.GrowMode:=gfGrowHiX+gfGrowHiY;
1646
Insert(InheritanceView);
1647
InheritanceView^.MyBW:=@Self;
1649
if assigned(AMemInfo) then
1651
New(MemInfoView, Init(R, AMemInfo));
1652
MemInfoView^.GrowMode:=gfGrowHiX+gfGrowHiY;
1653
Insert(MemInfoView);
1654
MemInfoView^.MyBW:=@Self;
1656
if Assigned(Asym) and (TypeOf(ASym^)=TypeOf(TModuleSymbol)) then
1657
with PModuleSymbol(Sym)^ do
1659
New(UnitInfo, Init(R));
1660
UnitInfo^.GetExtent(R3);
1664
if (Assigned(UsedUnits) or Assigned(DependentUnits))=false then
1666
HSB:=CreateHSB(R2); {UnitInfo^.Insert(HSB); HSB:=nil;}
1668
{UnitInfo^.Insert(VSB);
1669
VSB will be owned by UnitInfoText PM }
1670
New(UnitInfoText, Init(R2,HSB,VSB, nil));
1671
with UnitInfoText^ do
1673
GrowMode:=gfGrowHiX;
1674
if Assigned(LoadedFrom) then
1676
AddLine(FormatStrStr2('%s : %s',msg_usedfirstin,GetStr(LoadedFrom)));
1677
AddLine(FormatStrStr('%s : ',msg_mainsource));
1678
AddLine(FormatStrStr(' %s',GetStr(MainSource)));
1679
if Assigned(SourceFiles) and (SourceFiles^.Count>1) then
1681
AddLine(FormatStrStr('%s : ',msg_sourcefiles));
1682
for I:=0 to SourceFiles^.Count-1 do
1683
AddLine(FormatStrStr(' %s',GetStr(SourceFiles^.At(I))));
1687
UnitInfo^.Insert(UnitInfoText);
1689
if Assigned(UsedUnits) then
1691
Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
1692
New(CST, Init(R2,'� Used units �'+CharStr('�',255),ColorIndex(12),false));
1693
CST^.GrowMode:=gfGrowHiX;
1694
UnitInfo^.Insert(CST);
1696
Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+4;
1697
if Assigned(DependentUnits)=false then R2.B.Y:=R3.B.Y;
1698
{HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }
1701
{UnitInfo^.Insert(VSB); this created crashes,
1702
that were difficult to findout PM }
1703
New(UnitInfoUsed, Init(R2,UsedUnits,HSB,VSB));
1704
UnitInfoUsed^.GrowMode:=gfGrowHiY+gfGrowHiX;
1705
UnitInfoUsed^.MyBW:=@Self;
1706
UnitInfo^.Insert(UnitInfoUsed);
1709
if Assigned(DependentUnits) then
1711
Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R2.A.Y+1;
1712
New(CST, Init(R2,'� Dependent units �'+CharStr('�',255),ColorIndex(12),false));
1713
CST^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
1714
UnitInfo^.Insert(CST);
1716
Inc(R2.A.Y,R2.B.Y-R2.A.Y); R2.B.Y:=R3.B.Y;
1717
{HSB:=CreateHSB(R2); UnitInfo^.Insert(HSB); }
1720
{ UnitInfo^.Insert(VSB); this created crashes,
1721
that were difficult to findout PM }
1722
New(UnitInfoDependent, Init(R2,DependentUnits,HSB,VSB));
1723
UnitInfoDependent^.GrowMode:=gfGrowLoY+gfGrowHiX+gfGrowHiY;
1724
UnitInfoDependent^.MyBW:=@Self;
1725
UnitInfo^.Insert(UnitInfoDependent);
1728
if Assigned(UnitInfoText) then
1729
UnitInfoText^.Select;
1734
GetExtent(R); R.Grow(-1,-1); R.Move(0,1); R.B.Y:=R.A.Y+1;
1735
New(PageTab, Init(R,
1736
NewBrowserTabItem(label_browsertab_scope,ScopeView,
1737
NewBrowserTabItem(label_browsertab_reference,ReferenceView,
1738
NewBrowserTabItem(label_browsertab_inheritance,InheritanceView,
1739
NewBrowserTabItem(label_browsertab_memory,MemInfoView,
1740
NewBrowserTabItem(label_browsertab_unit,UnitInfo,
1742
PageTab^.GrowMode:=gfGrowHiX;
1745
if assigned(ScopeView) then
1747
else if assigned(ReferenceView) then
1748
SelectTab(btReferences)
1749
else if assigned(MemInfoView) then
1750
SelectTab(btMemInfo)
1752
if assigned(InheritanceView) then
1753
SelectTab(btInheritance);
1756
destructor TBrowserWindow.Done;
1758
{ UnitInfoText needs to be removed first
1759
to avoid crashes within the UnitInfo destructor PM }
1760
if Assigned(UnitInfoText) then
1762
UnitInfo^.Delete(UnitInfoText);
1763
Dispose(UnitInfoText,Done);
1766
if assigned(DebuggerValue) then
1768
Dispose(DebuggerValue,Done);
1771
if assigned(Prefix) then
1779
procedure TBrowserWindow.HandleEvent(var Event: TEvent);
1780
var DontClear: boolean;
1782
Symbols: PSymbolCollection;
1788
case Event.Command of
1791
if Assigned(DebuggerValue) and
1792
(DebuggerValue^.GDBI<>Event.InfoLong) then
1794
If Assigned(ST^.Text) then
1795
DisposeStr(ST^.Text);
1796
ST^.Text:=NewStr(DebuggerValue^.GetText);
1802
cmListItemSelected :
1805
if (Event.InfoPtr=ScopeView) then
1807
S:=ScopeView^.Symbols^.At(ScopeView^.Focused);
1808
MakeGlobal(ScopeView^.Origin,P);
1809
Desktop^.MakeLocal(P,P); Inc(P.Y,ScopeView^.Focused-ScopeView^.TopItem);
1812
if (Event.InfoPtr=UnitInfoUsed) then
1814
S:=UnitInfoUsed^.Symbols^.At(UnitInfoUsed^.Focused);
1815
MakeGlobal(UnitInfoUsed^.Origin,P);
1816
Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoUsed^.Focused-UnitInfoUsed^.TopItem);
1819
if (Event.InfoPtr=UnitInfoDependent) then
1821
S:=UnitInfoDependent^.Symbols^.At(UnitInfoDependent^.Focused);
1822
MakeGlobal(UnitInfoDependent^.Origin,P);
1823
Desktop^.MakeLocal(P,P); Inc(P.Y,UnitInfoDependent^.Focused-UnitInfoDependent^.TopItem);
1828
if S^.Ancestor=nil then Anc:=nil else
1829
Anc:=SearchObjectForSymbol(S^.Ancestor);
1831
if (not assigned(Symbols) or (symbols^.count=0)) then
1832
if assigned(S^.Ancestor) then
1833
Symbols:=S^.Ancestor^.Items;
1834
if (S^.GetReferenceCount>0) or (assigned(Symbols) and (Symbols^.Count>0)) or (Anc<>nil) then
1835
OpenSymbolBrowser(Origin.X-1,P.Y,
1837
ScopeView^.GetText(ScopeView^.Focused,255),
1839
Symbols,S^.References,Anc,S^.MemInfo);
1846
case Event.Command of
1848
if Event.InfoPtr=ScopeView then
1849
if ReferenceView<>nil then
1850
if ReferenceView^.Range>0 then
1851
ReferenceView^.GotoItem(0);
1853
if Event.InfoPtr=ScopeView then
1854
if (ScopeView<>nil) and (ScopeView^.Range>0) then
1856
S:=ScopeView^.At(ScopeView^.Focused);
1857
if (S^.References<>nil) and (S^.References^.Count>0) then
1858
TrackItem(S^.References^.At(0));
1859
else DontClear:=true;
1861
if DontClear=false then ClearEvent(Event);
1866
case Event.KeyCode of
1870
If not Disassemble then
1872
else DontClear:=true;
1874
if DontClear=false then ClearEvent(Event);
1877
inherited HandleEvent(Event);
1880
function TBrowserWindow.Disassemble : boolean;
1883
if not assigned(sym) or (sym^.typ<>procsym) then
1885
{ We need to load exefile }
1888
if not assigned(Debugger) then
1891
if assigned(Debugger) then
1892
Debugger^.SetExe(ExeFile);
1894
if not assigned(Debugger) or not Debugger^.HasExe then
1896
{ goto source/assembly mixture }
1897
InitDisassemblyWindow;
1898
DisassemblyWindow^.LoadFunction(Sym^.GetName);
1899
DisassemblyWindow^.SelectInDebugSession;
1906
procedure TBrowserWindow.SetState(AState: Word; Enable: Boolean);
1907
{var OldState: word;}
1910
inherited SetState(AState,Enable);
1911
{ if ((State xor OldState) and sfActive)<>0 then
1912
if GetState(sfActive)=false then
1913
Message(Desktop,evBroadcast,cmClearLineHighlights,nil);}
1916
procedure TBrowserWindow.Close;
1921
procedure TBrowserWindow.SelectTab(BrowserTab: Sw_integer);
1922
var Tabs: Sw_integer;
1931
if assigned(ScopeView) then
1934
if assigned(ReferenceView) then
1935
ReferenceView^.Select;
1937
if assigned(MemInfoView) then
1938
MemInfoView^.Select;
1942
if Assigned(Sym) then
1944
if Pos('proc',Sym^.GetText)>0 then
1945
{ insert function breakpoint }
1952
PB:=BreakpointsCollection^.GetType(bt_function,copy(GetStr(PS),1,l-1));
1953
If Assigned(PB) then
1954
BreakpointsCollection^.Delete(PB);
1955
Sym^.Name:=NewStr(copy(GetStr(PS),1,l-1));
1961
Sym^.Name:=NewStr(GetStr(PS)+'*');
1963
New(PB,init_function(GetStr(PS)));
1965
BreakpointsCollection^.Insert(PB);
1966
BreakpointsCollection^.Update;
1969
else if pos('var',Sym^.GetText)>0 then
1970
{ insert watch point }
1977
PB:=BreakpointsCollection^.GetType(bt_awatch,copy(PS^,1,l-1));
1978
If Assigned(PB) then
1979
BreakpointsCollection^.Delete(PB);
1980
Sym^.Name:=NewStr(copy(PS^,1,l-1));
1986
Sym^.Name:=NewStr(GetStr(PS)+'*');
1988
New(PB,init_type(bt_awatch,GetStr(PS)));
1990
BreakpointsCollection^.Insert(PB);
1991
BreakpointsCollection^.Update;
1999
if assigned(ScopeView) then
2000
Tabs:=Tabs or (1 shl btScope);
2001
if assigned(ReferenceView) then
2002
Tabs:=Tabs or (1 shl btReferences);
2003
if assigned(InheritanceView) then
2004
Tabs:=Tabs or (1 shl btInheritance);
2005
if assigned(MemInfoView) then
2006
Tabs:=Tabs or (1 shl btMemInfo);
2008
if Assigned(Sym) then
2009
if (Pos('proc',Sym^.GetText)>0) or (Pos('var',Sym^.GetText)>0) then
2010
Tabs:=Tabs or (1 shl btBreakWatch);
2012
if assigned(UnitInfo) then
2013
Tabs:=Tabs or (1 shl btUnitInfo);
2014
if PageTab<>nil then PageTab^.SetParams(Tabs,BrowserTab);
2017
function TBrowserWindow.GetPalette: PPalette;
2018
const S: string[length(CBrowserWindow)] = CBrowserWindow;
2023
procedure OpenSymbolBrowser(X,Y: Sw_integer;const Name,Line: string;S : PSymbol;
2024
ParentBrowser : PBrowserWindow;
2025
Symbols: PSymbolCollection; References: PReferenceCollection;
2026
Inheritance: PObjectSymbol; MemInfo: PSymbolMemInfo);
2028
PB : PBrowserWindow;
2031
if X=0 then X:=Desktop^.Size.X-35;
2033
R.B.X:=R.A.X+35; R.B.Y:=R.A.Y+15;
2034
while (R.B.Y>Desktop^.Size.Y) do R.Move(0,-1);
2035
if assigned(ParentBrowser) and assigned(ParentBrowser^.Prefix) and
2036
assigned(ParentBrowser^.sym) and
2037
(ParentBrowser^.sym^.typ<>unitsym)
2040
st:=GetStr(ParentBrowser^.Prefix)+' '+Name;
2045
if assigned(S) and ((S^.Flags and sfPointer)<>0) then
2048
if assigned(S^.Ancestor) and
2049
((S^.Ancestor^.Flags and sfRecord)<>0) then
2052
else if assigned(S) and ((S^.Flags and sfRecord)<>0) then
2055
PB:=New(PBrowserWindow, Init(R,
2056
st2,SearchFreeWindowNo,S,Line,st,
2057
Symbols,References,Inheritance,MemInfo));
2058
if (assigned(S) and (S^.typ in [fieldvarsym,staticvarsym,localvarsym,paravarsym])) or
2059
(assigned(ParentBrowser) and ParentBrowser^.IsValid) then
2062
Desktop^.Insert(PB);