mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 13:39:17 +02:00
Use RaiseGDBException from LazTracer unit. Remove similar funcs from IDEProcs and ComponentReg.
git-svn-id: trunk@58622 -
This commit is contained in:
parent
a20ec2d6bc
commit
b20cf40349
@ -308,11 +308,6 @@ implementation
|
||||
const
|
||||
BasePath = 'ComponentPaletteOptions/';
|
||||
|
||||
procedure RaiseException(const Msg: string);
|
||||
begin
|
||||
raise Exception.Create(Msg);
|
||||
end;
|
||||
|
||||
function ComponentPriority(Category: TComponentPriorityCategory; Level: integer
|
||||
): TComponentPriority;
|
||||
begin
|
||||
@ -659,9 +654,9 @@ end;
|
||||
procedure TRegisteredComponent.ConsistencyCheck;
|
||||
begin
|
||||
if (FComponentClass=nil) then
|
||||
RaiseException('TRegisteredComponent.ConsistencyCheck FComponentClass=nil');
|
||||
raise Exception.Create('TRegisteredComponent.ConsistencyCheck FComponentClass=nil');
|
||||
if not IsValidIdent(FComponentClass.ClassName) then
|
||||
RaiseException('TRegisteredComponent.ConsistencyCheck not IsValidIdent(FComponentClass.ClassName)');
|
||||
raise Exception.Create('TRegisteredComponent.ConsistencyCheck not IsValidIdent(FComponentClass.ClassName)');
|
||||
end;
|
||||
|
||||
function TRegisteredComponent.GetPriority: TComponentPriority;
|
||||
@ -982,7 +977,7 @@ end;
|
||||
procedure TBaseComponentPalette.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock<=0 then
|
||||
RaiseException('TBaseComponentPalette.EndUpdate');
|
||||
raise Exception.Create('TBaseComponentPalette.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if (FUpdateLock=0) and fChanged then
|
||||
Update(False);
|
||||
|
@ -42,9 +42,9 @@ var
|
||||
------------------------------------------------------------------------------}
|
||||
procedure RaiseGDBException(const Msg: string);
|
||||
begin
|
||||
debugln(lrsERRORInLib, Msg);
|
||||
DebugLn(lrsERRORInCode, Msg);
|
||||
// creates an exception, that gdb catches:
|
||||
debugln(lrsCreatingGdbCatchableError);
|
||||
DebugLn(lrsCreatingGdbCatchableError);
|
||||
DumpStack;
|
||||
{$ifndef HASAMIGA} // On Amiga Division by 0 is not catchable, just crash
|
||||
if (length(Msg) div (length(Msg) div 10000))=0 then ;
|
||||
@ -55,7 +55,7 @@ procedure RaiseAndCatchException;
|
||||
begin
|
||||
try
|
||||
{$ifndef HASAMIGA} // On Amiga Division by 0 is not catchable, just crash
|
||||
if (length(lrsERRORInLib) div (length(lrsERRORInLib) div 10000))=0 then ;
|
||||
if (length(lrsERRORInCode) div (length(lrsERRORInCode) div 10000))=0 then ;
|
||||
{$else}
|
||||
DumpStack;
|
||||
{$endif}
|
||||
|
@ -39,7 +39,7 @@ resourceString
|
||||
lrsCanNotExecute = 'can not execute %s';
|
||||
lrsListMustBeEmpty = 'List must be empty';
|
||||
lrsListIndexExceedsBounds = 'List index exceeds bounds (%d)';
|
||||
lrsERRORInLib = 'ERROR in libraries: ';
|
||||
lrsERRORInCode = 'ERROR in code: ';
|
||||
lrsCreatingGdbCatchableError = 'Creating gdb catchable error:';
|
||||
|
||||
// XPath
|
||||
|
@ -37,9 +37,17 @@ unit DebuggerDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, Forms, Controls, IDEProcs, LazFileUtils, LCLProc, LazLoggerBase, Debugger,
|
||||
IDEImagesIntf, MainIntf, EditorOptions, IDECommands, DbgIntfDebuggerBase,
|
||||
DbgIntfMiscClasses, BaseDebugManager;
|
||||
Classes,
|
||||
// LCL
|
||||
Forms, Controls, LCLProc,
|
||||
// LazUtils
|
||||
LazFileUtils, LazLoggerBase,
|
||||
// IdeIntf
|
||||
IDEImagesIntf, IDECommands,
|
||||
// DebuggerIntf
|
||||
DbgIntfDebuggerBase, DbgIntfMiscClasses,
|
||||
// IDE
|
||||
MainIntf, EditorOptions, BaseDebugManager, Debugger;
|
||||
|
||||
type
|
||||
|
||||
@ -143,7 +151,7 @@ end;
|
||||
|
||||
procedure TDebuggerDlg.EndUpdate;
|
||||
begin
|
||||
if FUpdateCount < 1 then RaiseException('TDebuggerDlg.EndUpdate');
|
||||
if FUpdateCount < 1 then RaiseGDBException('TDebuggerDlg.EndUpdate');
|
||||
Dec(FUpdateCount);
|
||||
if FUpdateCount = 0 then DoEndUpdate;
|
||||
end;
|
||||
|
@ -1994,7 +1994,7 @@ begin
|
||||
if LastPaintSender=Sender then begin
|
||||
//writeln('NOTE: TDesigner.PaintControl E control painted twice: ',
|
||||
// Sender.Name,':',Sender.ClassName,' DC=',DbgS(TheMessage.DC));
|
||||
//RaiseException('');
|
||||
//RaiseGDBException('');
|
||||
end;
|
||||
LastPaintSender:=Sender;
|
||||
|
||||
|
@ -56,7 +56,7 @@ uses
|
||||
// IdeIntf
|
||||
PackageDependencyIntf, PropEditUtils, PropEdits, UnitResources, IDEDialogs,
|
||||
// IDE
|
||||
IDEProcs, PackageDefs;
|
||||
PackageDefs;
|
||||
|
||||
type
|
||||
//----------------------------------------------------------------------------
|
||||
@ -757,10 +757,10 @@ procedure TJITComponentList.DestroyJITComponent(JITComponent:TComponent);
|
||||
var a:integer;
|
||||
begin
|
||||
if JITComponent=nil then
|
||||
RaiseException('TJITComponentList.DestroyJITForm JITComponent=nil');
|
||||
RaiseGDBException('TJITComponentList.DestroyJITForm JITComponent=nil');
|
||||
a:=IndexOf(JITComponent);
|
||||
if a<0 then
|
||||
RaiseException('TJITComponentList.DestroyJITForm JITComponent.ClassName='+
|
||||
RaiseGDBException('TJITComponentList.DestroyJITForm JITComponent.ClassName='+
|
||||
JITComponent.ClassName);
|
||||
if a>=0 then DestroyJITComponent(a);
|
||||
end;
|
||||
@ -1315,7 +1315,7 @@ var
|
||||
Action: TModalResult;
|
||||
begin
|
||||
if IndexOf(JITOwnerComponent)<0 then
|
||||
RaiseException('TJITComponentList.AddJITChildComponentFromStream');
|
||||
RaiseGDBException('TJITComponentList.AddJITChildComponentFromStream');
|
||||
{$IFDEF VerboseJITForms}
|
||||
debugln('[TJITComponentList.AddJITChildComponentFromStream] A');
|
||||
{$ENDIF}
|
||||
@ -1763,7 +1763,7 @@ var
|
||||
begin
|
||||
TypeInfo:=PTypeInfo(JITClass.ClassInfo);
|
||||
if TypeInfo=nil then
|
||||
RaiseException('TJITComponentList.DoRenameUnitNameOfClass');
|
||||
RaiseGDBException('TJITComponentList.DoRenameUnitNameOfClass');
|
||||
TypeData:=GetTypeData(TypeInfo);
|
||||
//DebugLn(['TJITComponentList.DoRenameUnitNameOfClass Old=',TypeData^.UnitName,' New=',NewUnitName]);
|
||||
OldPropCount:=GetTypeDataPropCountAddr(TypeData)^;
|
||||
|
@ -318,7 +318,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
if ResultPos<>NewLength+1 then
|
||||
RaiseException('Internal error');
|
||||
RaiseGDBException('Internal error');
|
||||
end;
|
||||
|
||||
function IDEDirectiveValueToString(const s: string): string;
|
||||
@ -357,7 +357,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
if ResultPos<>NewLength+1 then
|
||||
RaiseException('Internal error');
|
||||
RaiseGDBException('Internal error');
|
||||
end;
|
||||
|
||||
function IDEDirectiveNameToDirective(const DirectiveName: string): TIDEDirective;
|
||||
|
@ -613,7 +613,7 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
if StartPos>EndPos then
|
||||
RaiseException('TCheckLFMDialog.AddReplaceMent StartPos>EndPos');
|
||||
RaiseGDBException('TCheckLFMDialog.AddReplaceMent StartPos>EndPos');
|
||||
// check for intersection
|
||||
for i:=0 to LFMChangeList.Count-1 do begin
|
||||
Entry:=TLFMChangeEntry(LFMChangeList[i]);
|
||||
@ -625,7 +625,7 @@ begin
|
||||
EndPos:=Max(EndPos,Entry.EndPos);
|
||||
end else begin
|
||||
// not allowed
|
||||
RaiseException('TCheckLFMDialog.AddReplaceMent invalid Intersection');
|
||||
RaiseGDBException('TCheckLFMDialog.AddReplaceMent invalid Intersection');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
@ -51,7 +51,7 @@ uses
|
||||
// IDEIntf
|
||||
LazIDEIntf, IDECommands, MenuIntf, SrcEditorIntf, IDEDialogs, IDEImagesIntf,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, IDEOptionDefs, IDEProcs, CodeExplOpts;
|
||||
LazarusIDEStrConsts, IDEOptionDefs, CodeExplOpts;
|
||||
|
||||
type
|
||||
TCodeExplorerView = class;
|
||||
@ -2050,7 +2050,7 @@ var
|
||||
CurPage: TCodeExplorerPage;
|
||||
begin
|
||||
if FUpdateCount<=0 then
|
||||
RaiseException('TCodeExplorerView.EndUpdate');
|
||||
RaiseGDBException('TCodeExplorerView.EndUpdate');
|
||||
dec(FUpdateCount);
|
||||
if FUpdateCount=0 then begin
|
||||
CurPage:=CurrentPage;
|
||||
|
@ -845,7 +845,7 @@ begin
|
||||
icoLinkerOptions,icoCustomOptions:
|
||||
CurOptions:=MergeWithDelimiter(CurOptions,UnparsedOption,' ');
|
||||
else
|
||||
RaiseException('GatherInheritedOptions');
|
||||
RaiseGDBException('GatherInheritedOptions');
|
||||
end;
|
||||
InheritedOptionStrings[o]:=CurOptions;
|
||||
end;
|
||||
@ -933,7 +933,7 @@ var
|
||||
EndPos: LongInt;
|
||||
begin
|
||||
if Switch='' then
|
||||
RaiseException('ConvertSearchPathToCmdLine no Switch');
|
||||
RaiseGDBException('ConvertSearchPathToCmdLine no Switch');
|
||||
Result := '';
|
||||
if (Paths = '') then exit;
|
||||
|
||||
|
@ -51,8 +51,7 @@ uses
|
||||
PropEdits, PropEditUtils, ObjectInspector, FormEditingIntf, ComponentReg,
|
||||
UnitResources, IDEOptEditorIntf, IDEDialogs, ComponentEditors,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, EditorOptions, EnvironmentOpts, IDEProcs, Project, MainIntf,
|
||||
PackageDefs,
|
||||
LazarusIDEStrConsts, EditorOptions, EnvironmentOpts, Project, MainIntf, PackageDefs,
|
||||
// Designer
|
||||
CustomNonFormDesigner, NonControlDesigner, FrameDesigner, ControlSelection,
|
||||
JITForms, DesignerProcs;
|
||||
@ -613,8 +612,8 @@ Begin
|
||||
// free/unbind a non form component and its designer form
|
||||
aForm:=GetDesignerForm(AComponent);
|
||||
if (AForm<>nil) and (not (AForm is TNonFormProxyDesignerForm)) then
|
||||
RaiseException(Format(lisCFETCustomFormEditorDeleteComponentWhereIsTheTCustomN,
|
||||
[AComponent.ClassName]));
|
||||
RaiseGDBException(Format(lisCFETCustomFormEditorDeleteComponentWhereIsTheTCustomN,
|
||||
[AComponent.ClassName]));
|
||||
|
||||
if (AForm <> nil) then
|
||||
begin
|
||||
@ -626,7 +625,7 @@ Begin
|
||||
if FreeComponent then
|
||||
JITNonFormList.DestroyJITComponent(AComponent);
|
||||
end else
|
||||
RaiseException('TCustomFormEditor.DeleteComponent '+AComponent.ClassName);
|
||||
RaiseGDBException('TCustomFormEditor.DeleteComponent '+AComponent.ClassName);
|
||||
end else if FreeComponent then begin
|
||||
if (AComponent.Owner=nil) then
|
||||
DebugLn(['WARNING: TCustomFormEditor.DeleteComponent freeing orphaned component ',DbgSName(AComponent)]);
|
||||
@ -874,7 +873,7 @@ var
|
||||
begin
|
||||
Result := Nil;
|
||||
if FindNonFormFormNode(LookupRoot) <> nil then
|
||||
RaiseException(lisCFETCustomFormEditorCreateNonFormFormAlreadyExists);
|
||||
RaiseGDBException(lisCFETCustomFormEditorCreateNonFormFormAlreadyExists);
|
||||
if LookupRoot is TComponent then
|
||||
begin
|
||||
if LookupRoot is TCustomFrame then
|
||||
@ -901,8 +900,8 @@ begin
|
||||
(Result as INonControlDesigner).Mediator:=MediatorClass.CreateMediator(nil,LookupRoot);
|
||||
end;
|
||||
end else
|
||||
RaiseException(Format(lisCFETCustomFormEditorCreateNonFormFormUnknownType, [
|
||||
LookupRoot.ClassName]));
|
||||
RaiseGDBException(Format(lisCFETCustomFormEditorCreateNonFormFormUnknownType,
|
||||
[LookupRoot.ClassName]));
|
||||
end;
|
||||
|
||||
procedure TCustomFormEditor.RenameJITComponent(AComponent: TComponent;
|
||||
@ -912,7 +911,7 @@ var
|
||||
begin
|
||||
JITComponentList:=FindJITList(AComponent);
|
||||
if JITComponentList=nil then
|
||||
RaiseException('TCustomFormEditor.RenameJITComponent');
|
||||
RaiseGDBException('TCustomFormEditor.RenameJITComponent');
|
||||
JITComponentList.RenameComponentClass(AComponent,NewClassName);
|
||||
end;
|
||||
|
||||
@ -923,7 +922,7 @@ var
|
||||
begin
|
||||
JITComponentList:=FindJITList(AComponent);
|
||||
if JITComponentList=nil then
|
||||
RaiseException('TCustomFormEditor.RenameJITComponent');
|
||||
RaiseGDBException('TCustomFormEditor.RenameJITComponent');
|
||||
JITComponentList.RenameComponentUnitname(AComponent,NewUnitName);
|
||||
end;
|
||||
|
||||
@ -959,7 +958,7 @@ var
|
||||
begin
|
||||
JITComponentList:=FindJITList(ALookupRoot);
|
||||
if JITComponentList=nil then
|
||||
RaiseException('TCustomFormEditor.CreateNewJITMethod');
|
||||
RaiseGDBException('TCustomFormEditor.CreateNewJITMethod');
|
||||
Result:=JITComponentList.CreateNewMethod(ALookupRoot,AMethodName);
|
||||
end;
|
||||
|
||||
@ -970,7 +969,7 @@ var
|
||||
begin
|
||||
JITComponentList:=FindJITList(AComponent);
|
||||
if JITComponentList=nil then
|
||||
RaiseException('TCustomFormEditor.RenameJITMethod');
|
||||
RaiseGDBException('TCustomFormEditor.RenameJITMethod');
|
||||
JITComponentList.RenameMethod(AComponent,OldMethodName,NewMethodName);
|
||||
end;
|
||||
|
||||
@ -1337,7 +1336,7 @@ begin
|
||||
if csInline in NewComponent.ComponentState then begin
|
||||
JITList:=FindJITList(OwnerComponent);
|
||||
if JITList=nil then
|
||||
RaiseException('TCustomFormEditor.CreateComponent '+TypeClass.ClassName);
|
||||
RaiseGDBException('TCustomFormEditor.CreateComponent '+TypeClass.ClassName);
|
||||
JITList.ReadInlineJITChildComponent(NewComponent);
|
||||
end;
|
||||
|
||||
@ -1365,7 +1364,7 @@ begin
|
||||
NewUnitName:=AUnitName;
|
||||
JITList:=GetJITListOfType(TypeClass);
|
||||
if JITList=nil then
|
||||
RaiseException('TCustomFormEditor.CreateComponent '+TypeClass.ClassName);
|
||||
RaiseGDBException('TCustomFormEditor.CreateComponent '+TypeClass.ClassName);
|
||||
NewJITIndex := JITList.AddNewJITComponent(NewUnitName,TypeClass,DisableAutoSize);
|
||||
if NewJITIndex < 0 then
|
||||
exit;
|
||||
@ -1579,8 +1578,8 @@ begin
|
||||
// create JIT Component
|
||||
JITList:=GetJITListOfType(AncestorType);
|
||||
if JITList=nil then
|
||||
RaiseException('TCustomFormEditor.CreateComponentFromStream ClassName='+
|
||||
AncestorType.ClassName);
|
||||
RaiseGDBException('TCustomFormEditor.CreateComponentFromStream ClassName='+
|
||||
AncestorType.ClassName);
|
||||
NewJITIndex := JITList.AddJITComponentFromStream(BinStream, UnitResourcefileFormat,
|
||||
AncestorType,NewUnitName,Interactive,Visible,DisableAutoSize,
|
||||
ContextObj);
|
||||
@ -1599,8 +1598,8 @@ var
|
||||
begin
|
||||
JITList:=FindJITList(Root);
|
||||
if JITList=nil then
|
||||
RaiseException('TCustomFormEditor.CreateChildComponentFromStream ClassName='+
|
||||
Root.ClassName);
|
||||
RaiseGDBException('TCustomFormEditor.CreateChildComponentFromStream ClassName='+
|
||||
Root.ClassName);
|
||||
|
||||
JITList.AddJITChildComponentsFromStream(
|
||||
Root,BinStream,ComponentClass,ParentControl,NewComponents);
|
||||
|
@ -44,7 +44,7 @@ uses
|
||||
// LCL
|
||||
LCLType, LCLIntf, Forms, Controls, Dialogs, ExtCtrls,
|
||||
// LazUtils
|
||||
LazFileUtils, LazFileCache, LazLoggerBase, Laz2_XMLCfg, LazUTF8,
|
||||
LazFileUtils, LazFileCache, LazLoggerBase, Laz2_XMLCfg, LazUTF8, LazTracer,
|
||||
// codetools
|
||||
CodeCache, CodeToolManager, PascalParserTool, CodeTree,
|
||||
// IDEIntf
|
||||
@ -52,7 +52,7 @@ uses
|
||||
CompOptsIntf, IDEDialogs, ToolBarIntf,
|
||||
// IDE
|
||||
CompilerOptions, EnvironmentOpts, SourceEditor, ProjectDefs, Project,
|
||||
IDEProcs, InputHistory, Debugger, LazarusIDEStrConsts, TransferMacros,
|
||||
InputHistory, Debugger, LazarusIDEStrConsts, TransferMacros,
|
||||
MainBar, MainIntf, MainBase, BaseBuildManager, SourceMarks, DebuggerDlg,
|
||||
Watchesdlg, BreakPointsdlg, BreakPropertyDlg, LocalsDlg, WatchPropertyDlg,
|
||||
CallStackDlg, EvaluateDlg, RegistersDlg, AssemblerDlg, DebugOutputForm,
|
||||
@ -1599,7 +1599,7 @@ begin
|
||||
FDialogs[DlgType]:=nil;
|
||||
exit;
|
||||
end;
|
||||
RaiseException('Invalid debug window '+Sender.ClassName);
|
||||
RaiseGDBException('Invalid debug window '+Sender.ClassName);
|
||||
end;
|
||||
|
||||
procedure TDebugManager.ViewDebugDialog(const ADialogType: TDebugDialogType;
|
||||
@ -2219,7 +2219,7 @@ var
|
||||
NewSrcMark: TSourceMark;
|
||||
begin
|
||||
if not (ABreakpoint is TManagedBreakPoint) then
|
||||
RaiseException('TDebugManager.CreateSourceMarkForBreakPoint');
|
||||
RaiseGDBException('TDebugManager.CreateSourceMarkForBreakPoint');
|
||||
ManagedBreakPoint:=TManagedBreakPoint(ABreakpoint);
|
||||
|
||||
if (ManagedBreakPoint.SourceMark<>nil) or Destroying then exit;
|
||||
@ -2989,7 +2989,7 @@ begin
|
||||
// consistency check
|
||||
if (ASourceMark=nil) or (not ASourceMark.IsBreakPoint)
|
||||
or (ASourceMark.Data=nil) or (not (ASourceMark.Data is TIDEBreakPoint)) then
|
||||
RaiseException('TDebugManager.DoDeleteBreakPointAtMark');
|
||||
RaiseGDBException('TDebugManager.DoDeleteBreakPointAtMark');
|
||||
|
||||
{$ifdef VerboseDebugger}
|
||||
DebugLn('TDebugManager.DoDeleteBreakPointAtMark A ',ASourceMark.GetFilename,
|
||||
|
@ -35,11 +35,15 @@ unit EditDefineTree;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileProcs, FileUtil, IDEProcs, CodeToolManager,
|
||||
DefineTemplates, LinkScanner,
|
||||
Classes, SysUtils,
|
||||
// LazUtils
|
||||
FileUtil, LazTracer,
|
||||
// CodeTools
|
||||
FileProcs, CodeToolManager, DefineTemplates, LinkScanner,
|
||||
// IdeIntf
|
||||
CompOptsIntf,
|
||||
CompilerOptions, TransferMacros,
|
||||
LazarusIDEStrConsts;
|
||||
// IDE
|
||||
IDEProcs, CompilerOptions, LazarusIDEStrConsts;
|
||||
|
||||
|
||||
// global
|
||||
@ -249,7 +253,7 @@ var
|
||||
begin
|
||||
Result:=false; // no change
|
||||
if ParentTemplate=nil then
|
||||
RaiseException('UpdateCompilerOptionsTemplates internal error');
|
||||
RaiseGDBException('UpdateCompilerOptionsTemplates internal error');
|
||||
|
||||
{ ToDo:
|
||||
|
||||
|
@ -35,9 +35,15 @@ unit EncloseSelectionDlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons,
|
||||
ExtCtrls, BasicCodeTools, CodeToolManager, SourceChanger,
|
||||
LazarusIDEStrConsts, LazConf, LazUTF8, IDEProcs, ButtonPanel;
|
||||
Classes, SysUtils,
|
||||
// LCL
|
||||
Forms, Controls, Graphics, Dialogs, ExtCtrls, ButtonPanel,
|
||||
// LazUtils
|
||||
LazUTF8, LazTracer,
|
||||
// CodeTools
|
||||
BasicCodeTools, CodeToolManager, SourceChanger,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, LazConf;
|
||||
|
||||
type
|
||||
TEncloseSelectionType = (
|
||||
@ -89,7 +95,7 @@ begin
|
||||
estWith: Result:='With | do begin..end';
|
||||
estPascalComment: Result:='{..}';
|
||||
else
|
||||
RaiseException('EncloseSelectionTypeDescription');
|
||||
RaiseGDBException('EncloseSelectionTypeDescription');
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -155,7 +161,7 @@ begin
|
||||
+'}'+LineEnding;
|
||||
|
||||
else
|
||||
RaiseException('GetEnclosedSelectionParams');
|
||||
RaiseGDBException('GetEnclosedSelectionParams');
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -427,7 +433,7 @@ begin
|
||||
EncloseSelectionTypeDescription(Result))=0
|
||||
then
|
||||
exit;
|
||||
RaiseException('TEncloseSelectionDialog.GetEncloseType');
|
||||
RaiseGDBException('TEncloseSelectionDialog.GetEncloseType');
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -39,15 +39,11 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Laz_AVL_Tree,
|
||||
// LCL
|
||||
LCLProc,
|
||||
// Codetools
|
||||
FileProcs,
|
||||
// LazUtils
|
||||
LazFileUtils,
|
||||
// IDE
|
||||
IDEProcs;
|
||||
|
||||
LazFileUtils, LazTracer;
|
||||
|
||||
type
|
||||
{ TFileReference }
|
||||
|
||||
@ -161,7 +157,7 @@ begin
|
||||
ANode:=FTree.FindSuccessor(ANode);
|
||||
end;
|
||||
if StartPos<>length(FSearchPath)+1 then
|
||||
RaiseException('TFileReferenceList.UpdateSearchPath');
|
||||
RaiseGDBException('TFileReferenceList.UpdateSearchPath');
|
||||
end;
|
||||
Include(FFlags,frfSearchPathValid);
|
||||
end;
|
||||
@ -209,7 +205,7 @@ end;
|
||||
|
||||
procedure TFileReferenceList.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock<=0 then RaiseException('TFileReferenceList.EndUpdate');
|
||||
if FUpdateLock<=0 then RaiseGDBException('TFileReferenceList.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if (frfChanged in FFlags) then begin
|
||||
Exclude(FFlags,frfChanged);
|
||||
|
@ -34,7 +34,7 @@ uses
|
||||
Classes, SysUtils, Laz_AVL_Tree,
|
||||
// LazUtils
|
||||
FileUtil, LazFileUtils, LazUtilities, LazFileCache, LazUTF8, LazUTF8Classes,
|
||||
Laz2_XMLCfg, AvgLvlTree,
|
||||
Laz2_XMLCfg, AvgLvlTree, LazLoggerBase, LazTracer,
|
||||
// LCL
|
||||
StdCtrls, ExtCtrls,
|
||||
// CodeTools
|
||||
@ -224,9 +224,6 @@ function GetCurrentUserName: string;
|
||||
function GetCurrentMailAddress: string;
|
||||
function GetProgramSearchPath: string;
|
||||
|
||||
// debugging
|
||||
procedure RaiseException(const Msg: string);
|
||||
|
||||
// miscellaneous
|
||||
procedure CheckList(List: TList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
procedure CheckList(List: TFPList; TestListNil, TestDoubles, TestNils: boolean);
|
||||
@ -1108,21 +1105,21 @@ var
|
||||
begin
|
||||
if List=nil then begin
|
||||
if TestListNil then
|
||||
RaiseException('CheckList List is Nil');
|
||||
RaiseGDBException('CheckList List is Nil');
|
||||
exit;
|
||||
end;
|
||||
Cnt:=List.Count;
|
||||
if TestNils then begin
|
||||
for i:=0 to Cnt-1 do
|
||||
if List[i]=nil then
|
||||
RaiseException('CheckList item is Nil');
|
||||
RaiseGDBException('CheckList item is Nil');
|
||||
end;
|
||||
if TestDoubles then begin
|
||||
for i:=0 to Cnt-2 do begin
|
||||
CurItem:=List[i];
|
||||
for j:=i+1 to Cnt-1 do begin
|
||||
if List[j]=CurItem then
|
||||
RaiseException('CheckList Double');
|
||||
RaiseGDBException('CheckList Double');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1137,21 +1134,21 @@ var
|
||||
begin
|
||||
if List=nil then begin
|
||||
if TestListNil then
|
||||
RaiseException('CheckList List is Nil');
|
||||
RaiseGDBException('CheckList List is Nil');
|
||||
exit;
|
||||
end;
|
||||
Cnt:=List.Count;
|
||||
if TestNils then begin
|
||||
for i:=0 to Cnt-1 do
|
||||
if List[i]=nil then
|
||||
RaiseException('CheckList item is Nil');
|
||||
RaiseGDBException('CheckList item is Nil');
|
||||
end;
|
||||
if TestDoubles then begin
|
||||
for i:=0 to Cnt-2 do begin
|
||||
CurItem:=List[i];
|
||||
for j:=i+1 to Cnt-1 do begin
|
||||
if List[j]=CurItem then
|
||||
RaiseException('CheckList Double');
|
||||
RaiseGDBException('CheckList Double');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1166,7 +1163,7 @@ begin
|
||||
Cnt1:=List1.Count;
|
||||
for i:=0 to Cnt1 do begin
|
||||
if List2.IndexOf(List1[i])>=0 then
|
||||
RaiseException('CheckEmptyListCut');
|
||||
RaiseGDBException('CheckEmptyListCut');
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1756,7 +1753,7 @@ begin
|
||||
end;
|
||||
//DebugLn(['StringListToString ',dbgstr(Result),' ',Size,' ',p]);
|
||||
if Size<>p-1 then
|
||||
RaiseException('StringListToString');
|
||||
RaiseGDBException('StringListToString');
|
||||
end;
|
||||
|
||||
procedure StringToStringList(const s: string; List: TStrings);
|
||||
@ -1864,7 +1861,7 @@ begin
|
||||
inc(OldPos);
|
||||
end;
|
||||
if NewPos-1<>NewLen then
|
||||
RaiseException('ERROR: BinaryStrToText: '+IntToStr(NewLen)+'<>'+IntToStr(NewPos-1));
|
||||
RaiseGDBException('ERROR: BinaryStrToText: '+IntToStr(NewLen)+'<>'+IntToStr(NewPos-1));
|
||||
end;
|
||||
|
||||
{-------------------------------------------------------------------------------
|
||||
@ -2108,21 +2105,6 @@ begin
|
||||
GetProgramSearchPath := GetEnvironmentVariableUTF8('PATH');
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
procedure RaiseException(const Msg: string);
|
||||
|
||||
Raises an exception.
|
||||
gdb does not catch fpc Exception objects, therefore this procedure raises
|
||||
a standard AV which is catched by gdb.
|
||||
------------------------------------------------------------------------------}
|
||||
procedure RaiseException(const Msg: string);
|
||||
begin
|
||||
DebugLn('ERROR in IDE: ',Msg);
|
||||
// creates an exception, that gdb catches:
|
||||
DebugLn('Creating gdb catchable error:');
|
||||
if (length(Msg) div (length(Msg) div 10000))=0 then ;
|
||||
end;
|
||||
|
||||
function CopyDirectoryWithMethods(const SrcDirectory, DestDirectory: string;
|
||||
OnCopyFile: TOnCopyFileMethod; OnCopyError: TOnCopyErrorMethod;
|
||||
Data: TObject): boolean;
|
||||
|
14
ide/main.pp
14
ide/main.pp
@ -6331,7 +6331,7 @@ begin
|
||||
AFilename:=ExpandFileNameUTF8(TrimFilename(AFilename));
|
||||
//debugln('TMainIDE.DoOpenProjectFile A2 "'+AFileName+'"');
|
||||
if not FilenameIsAbsolute(AFilename) then
|
||||
RaiseException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8');
|
||||
RaiseGDBException('TMainIDE.DoOpenProjectFile: buggy ExpandFileNameUTF8');
|
||||
DiskFilename:=GetPhysicalFilenameCached(AFilename,false);
|
||||
if DiskFilename<>AFilename then begin
|
||||
// e.g. encoding changed
|
||||
@ -8286,10 +8286,10 @@ begin
|
||||
ActiveUnitInfo:=nil;
|
||||
if AForm<>nil then begin
|
||||
if (AForm.Designer=nil) then
|
||||
RaiseException('TMainIDE.GetUnitWithForm AForm.Designer');
|
||||
RaiseGDBException('TMainIDE.GetUnitWithForm AForm.Designer');
|
||||
AComponent:=AForm.Designer.LookupRoot;
|
||||
if AComponent=nil then
|
||||
RaiseException('TMainIDE.GetUnitWithForm AComponent=nil');
|
||||
RaiseGDBException('TMainIDE.GetUnitWithForm AComponent=nil');
|
||||
GetUnitWithPersistent(AComponent,ActiveSourceEditor,ActiveUnitInfo);
|
||||
end;
|
||||
end;
|
||||
@ -9154,11 +9154,11 @@ begin
|
||||
[ctfSwitchToFormSource]) then exit;
|
||||
ActiveForm:=CurDesigner.Form;
|
||||
if ActiveForm=nil then
|
||||
RaiseException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form');
|
||||
RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: TDesigner without a form');
|
||||
// find source for form
|
||||
ActiveUnitInfo:=Project1.UnitWithComponent(CurDesigner.LookupRoot);
|
||||
if ActiveUnitInfo=nil then begin
|
||||
RaiseException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source');
|
||||
RaiseGDBException('[TMainIDE.OnPropHookPersistentDeleting] Error: form without source');
|
||||
end;
|
||||
if APersistent is TComponent then begin
|
||||
// mark references modified
|
||||
@ -11546,7 +11546,7 @@ begin
|
||||
AComponent.Name,NewName,AComponent.ClassName,true);
|
||||
ApplyBossResult(lisUnableToRenameVariableInSource);
|
||||
end else begin
|
||||
RaiseException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName);
|
||||
RaiseGDBException('TMainIDE.DesignerRenameComponent internal error:'+AComponent.Name+':'+AComponent.ClassName);
|
||||
end;
|
||||
|
||||
// rename inherited components
|
||||
@ -12517,7 +12517,7 @@ var
|
||||
begin
|
||||
AComponent:=ADesigner.LookupRoot;
|
||||
if AComponent=nil then
|
||||
RaiseException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil');
|
||||
RaiseGDBException('TMainIDE.GetProjectFileWithDesigner Designer.LookupRoot=nil');
|
||||
Result:=GetProjectFileWithRootComponent(AComponent);
|
||||
end;
|
||||
|
||||
|
@ -813,7 +813,7 @@ end;
|
||||
procedure TMainIDEBase.ActivateCodeToolAbortableMode;
|
||||
begin
|
||||
if ToolStatus=itNone then
|
||||
RaiseException('TMainIDEBase.ActivateCodeToolAbortableMode Error 1');
|
||||
RaiseGDBException('TMainIDEBase.ActivateCodeToolAbortableMode Error 1');
|
||||
ToolStatus:=itCodeTools;
|
||||
CodeToolBoss.OnCheckAbort:=@OnCodeToolBossCheckAbort;
|
||||
CodeToolBoss.Abortable:=true;
|
||||
|
@ -2019,7 +2019,7 @@ end;
|
||||
procedure TUnitInfo.SetFilename(const AValue: string);
|
||||
begin
|
||||
if fSource<>nil then
|
||||
RaiseException('TUnitInfo.SetFilename Source<>nil')
|
||||
RaiseGDBException('TUnitInfo.SetFilename Source<>nil')
|
||||
else
|
||||
SetInternalFilename(AValue);
|
||||
end;
|
||||
@ -3741,7 +3741,7 @@ end;
|
||||
|
||||
procedure TProject.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock<=0 then RaiseException('TProject.EndUpdate');
|
||||
if FUpdateLock<=0 then RaiseGDBException('TProject.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
FSourceDirectories.EndUpdate;
|
||||
FDefineTemplates.EndUpdate;
|
||||
|
@ -55,8 +55,11 @@ unit ProjectInspector;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LCLType, Forms, Controls, Buttons, ComCtrls,
|
||||
Classes, SysUtils,
|
||||
// LCL
|
||||
LCLProc, LCLType, Forms, Controls, Buttons, ComCtrls,
|
||||
Menus, Dialogs, FileUtil, LazFileUtils, LazFileCache, ExtCtrls, Graphics,
|
||||
// LazControls
|
||||
TreeFilterEdit,
|
||||
// IDEIntf
|
||||
IDEHelpIntf, IDECommands, IDEDialogs, IDEImagesIntf, LazIDEIntf, ProjectIntf,
|
||||
@ -1489,7 +1492,7 @@ end;
|
||||
|
||||
procedure TProjectInspectorForm.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock=0 then RaiseException('TProjectInspectorForm.EndUpdate');
|
||||
if FUpdateLock=0 then RaiseGDBException('TProjectInspectorForm.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock=0 then
|
||||
IdleConnected:=true;
|
||||
|
@ -36,10 +36,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, RegExpr,
|
||||
// LCL
|
||||
LCLProc,
|
||||
// LazUtils
|
||||
LazFileUtils, Laz2_XMLCfg,
|
||||
LazFileUtils, Laz2_XMLCfg, LazLoggerBase, LazTracer,
|
||||
// IDE
|
||||
IDEProcs;
|
||||
|
||||
@ -379,7 +377,7 @@ end;
|
||||
procedure TPublishModuleOptions.UnlockModified;
|
||||
begin
|
||||
if FModifiedLock<=0 then
|
||||
RaiseException('TPublishModuleOptions.UnlockModified');
|
||||
RaiseGDBException('TPublishModuleOptions.UnlockModified');
|
||||
dec(FModifiedLock);
|
||||
end;
|
||||
|
||||
|
@ -52,7 +52,7 @@ uses
|
||||
ExtendedNotebook,
|
||||
// LazUtils
|
||||
LConvEncoding, FileUtil, LazFileUtils, LazFileCache, LazUTF8, LazUTF8Classes,
|
||||
LazMethodList, LazLoggerBase, LazLogger, Translations, LazUtilities,
|
||||
LazMethodList, LazLoggerBase, LazLogger, Translations, LazUtilities, LazTracer,
|
||||
// codetools
|
||||
BasicCodeTools, CodeBeautifier, CodeToolManager, CodeCache, SourceLog,
|
||||
LinkScanner, CodeTree, SourceChanger,
|
||||
@ -9795,7 +9795,7 @@ procedure TSourceEditorManagerBase.RegisterMarklingProducer(
|
||||
aProducer: TSourceMarklingProducer);
|
||||
begin
|
||||
if fProducers.IndexOf(aProducer)>=0 then
|
||||
RaiseException('TSourceEditorManagerBase.RegisterProducer already registered');
|
||||
RaiseGDBException('TSourceEditorManagerBase.RegisterProducer already registered');
|
||||
fProducers.Add(aProducer);
|
||||
FreeNotification(aProducer);
|
||||
end;
|
||||
|
@ -38,7 +38,7 @@ uses
|
||||
LResources, LCLMemManager,
|
||||
// LazUtils
|
||||
LConvEncoding, LazFileCache, FileUtil, LazFileUtils, LazLoggerBase, LazUtilities,
|
||||
LazUTF8, AvgLvlTree,
|
||||
LazUTF8, LazTracer, AvgLvlTree,
|
||||
// Codetools
|
||||
BasicCodeTools, CodeToolsStructs, CodeToolManager, FileProcs, DefineTemplates,
|
||||
CodeCache, CodeTree, FindDeclarationTool, KeywordFuncLists,
|
||||
@ -4823,7 +4823,7 @@ begin
|
||||
NewFilename:=MainIDE.CreateNewUniqueFilename(NewShortFilename,
|
||||
NewFileExt,NewOwner,SearchFlags,true);
|
||||
if NewFilename='' then
|
||||
RaiseException('');
|
||||
RaiseGDBException('');
|
||||
NewShortFilename:=ExtractFilenameOnly(NewFilename);
|
||||
// use as unitname the NewShortFilename, but with the case of the
|
||||
// original unitname. e.g. 'unit12.pas' becomes 'Unit12.pas'
|
||||
@ -4859,7 +4859,7 @@ var
|
||||
r: TRect;
|
||||
begin
|
||||
if not AncestorType.InheritsFrom(TComponent) then
|
||||
RaiseException('TLazSourceFileManager.CreateNewForm invalid AncestorType');
|
||||
RaiseGDBException('TLazSourceFileManager.CreateNewForm invalid AncestorType');
|
||||
|
||||
//debugln('TLazSourceFileManager.CreateNewForm START ',NewUnitInfo.Filename,' ',AncestorType.ClassName,' ',dbgs(ResourceCode<>nil));
|
||||
// create a buffer for the new resource file and for the LFM file
|
||||
|
@ -4568,7 +4568,7 @@ begin
|
||||
else
|
||||
DbgOut(' LCLObject=',TControl(LCLObject).ClassName);
|
||||
DebugLn('');
|
||||
RaiseException('GetWidgetOrigin Window=nil');
|
||||
RaiseGDBException('GetWidgetOrigin Window=nil');
|
||||
{$ENDIF}
|
||||
Result.X:=0;
|
||||
Result.Y:=0;
|
||||
@ -4767,7 +4767,7 @@ begin
|
||||
if SourceWindow = nil then
|
||||
begin
|
||||
{$IFDEF RaiseExceptionOnNilPointers}
|
||||
RaiseException('TranslateGdkPointToClientArea Window=nil');
|
||||
RaiseGDBException('TranslateGdkPointToClientArea Window=nil');
|
||||
{$ENDIF}
|
||||
DebugLn('WARNING: TranslateGdkPointToClientArea SourceWindow=nil');
|
||||
end;
|
||||
@ -6878,7 +6878,7 @@ var
|
||||
DebugLn('WARNING: SetWidgetSizeAndPosition: resizing BIG ',
|
||||
' Control=',LCLControl.Name,':',LCLControl.ClassName,
|
||||
' NewSize=',dbgs(LCLWidth),',',dbgs(LCLHeight));
|
||||
//RaiseException('');
|
||||
//RaiseGDBException('');
|
||||
end;
|
||||
|
||||
procedure WriteWarningParentWidgetNotFound;
|
||||
|
@ -4759,7 +4759,7 @@ begin
|
||||
end;
|
||||
|
||||
{$IFDEF RaiseExceptionOnNilPointers}
|
||||
RaiseException('TGtk2WidgetSet.GetDeviceSize Window=nil');
|
||||
RaiseGDBException('TGtk2WidgetSet.GetDeviceSize Window=nil');
|
||||
{$ENDIF}
|
||||
DebugLn('TGtk2WidgetSet.GetDeviceSize:', ' WARNING: DC ',DbgS(DC),' without gdkwindow.',
|
||||
' Widget=',DbgS(DevCtx.Widget));
|
||||
|
@ -61,7 +61,7 @@ uses
|
||||
// CodeTools
|
||||
BasicCodeTools, DefineTemplates, CodeToolManager, FileProcs,
|
||||
// LazUtils
|
||||
LazFileUtils, LazFileCache,
|
||||
LazFileUtils, LazFileCache, LazTracer,
|
||||
// IDEIntf
|
||||
ProjectIntf, CompOptsIntf, IDEWindowIntf, LazIDEIntf, IDEMsgIntf, IDEExternToolIntf,
|
||||
// IDE
|
||||
@ -180,13 +180,13 @@ end;
|
||||
function TPGIPAmbiguousFileGroup.Add(SrcFile, PPUFile: TPGInterPkgFile): integer;
|
||||
begin
|
||||
if (SrcFile=nil) and (PPUFile=nil) then
|
||||
RaiseException('');
|
||||
RaiseGDBException('');
|
||||
if (SrcFile<>nil) and (PPUFile<>nil) and (PPUFile.OwnerInfo<>SrcFile.OwnerInfo) then
|
||||
RaiseException('bug: not equal: PPUFile.OwnerInfo='+PPUFile.OwnerInfo.Name+' SrcFile.OwnerInfo='+SrcFile.OwnerInfo.Name);
|
||||
RaiseGDBException('bug: not equal: PPUFile.OwnerInfo='+PPUFile.OwnerInfo.Name+' SrcFile.OwnerInfo='+SrcFile.OwnerInfo.Name);
|
||||
if (SrcFile<>nil) and FilenameIsCompiledSource(SrcFile.ShortFilename) then
|
||||
RaiseException('bug: src is compiled file: SrcFile.Filename='+SrcFile.FullFilename);
|
||||
RaiseGDBException('bug: src is compiled file: SrcFile.Filename='+SrcFile.FullFilename);
|
||||
if (PPUFile<>nil) and not FilenameIsCompiledSource(PPUFile.ShortFilename) then
|
||||
RaiseException('bug: compiled file is source:'+PPUFile.FullFilename);
|
||||
RaiseGDBException('bug: compiled file is source:'+PPUFile.FullFilename);
|
||||
Result:=length(CompiledFiles);
|
||||
SetLength(CompiledFiles,Result+1);
|
||||
SetLength(Sources,Result+1);
|
||||
|
@ -37,8 +37,9 @@ unit PackageDefs;
|
||||
interface
|
||||
|
||||
uses
|
||||
// FCL, LCL
|
||||
// FCL
|
||||
Classes, SysUtils, contnrs, typinfo, Laz_AVL_Tree,
|
||||
// LCL
|
||||
LCLType, LResources, Graphics, Controls, Forms, Dialogs,
|
||||
// Codetools
|
||||
FileProcs, LazConfigStorage, BasicCodeTools, DefineTemplates, CodeToolManager,
|
||||
@ -1253,7 +1254,7 @@ end;
|
||||
function GetDependencyWithIndex(First: TPkgDependency;
|
||||
ListType: TPkgDependencyList; Index: integer): TPkgDependency;
|
||||
begin
|
||||
if Index<0 then RaiseException('GetDependencyWithIndex');
|
||||
if Index<0 then RaiseGDBException('GetDependencyWithIndex');
|
||||
Result:=First;
|
||||
while (Result<>nil) and (Index>0) do begin
|
||||
Result:=Result.NextDependency[ListType];
|
||||
@ -2634,7 +2635,7 @@ end;
|
||||
|
||||
procedure TLazPackage.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock=0 then RaiseException('TLazPackage.EndUpdate');
|
||||
if FUpdateLock=0 then RaiseGDBException('TLazPackage.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
FDefineTemplates.EndUpdate;
|
||||
FSourceDirectories.EndUpdate;
|
||||
@ -2755,7 +2756,7 @@ end;
|
||||
procedure TLazPackage.UnlockModified;
|
||||
begin
|
||||
if FModifiedLock<=0 then
|
||||
RaiseException('TLazPackage.UnlockModified');
|
||||
RaiseGDBException('TLazPackage.UnlockModified');
|
||||
dec(FModifiedLock);
|
||||
end;
|
||||
|
||||
@ -4152,8 +4153,8 @@ end;
|
||||
procedure TPkgCompilerOptions.InvalidateOptions;
|
||||
begin
|
||||
if (LazPackage=nil) then exit;
|
||||
if LazPackage.UsageOptions=nil then RaiseException('');
|
||||
if LazPackage.UsageOptions.ParsedOpts=nil then RaiseException('');
|
||||
if LazPackage.UsageOptions=nil then RaiseGDBException('');
|
||||
if LazPackage.UsageOptions.ParsedOpts=nil then RaiseGDBException('');
|
||||
LazPackage.UsageOptions.ParsedOpts.InvalidateAll;
|
||||
end;
|
||||
|
||||
|
@ -2353,7 +2353,7 @@ end;
|
||||
procedure TPackageEditorForm.EndUpdate;
|
||||
begin
|
||||
if fUpdateLock=0 then
|
||||
RaiseException('');
|
||||
RaiseGDBException('');
|
||||
dec(fUpdateLock);
|
||||
if fUpdateLock=0 then
|
||||
IdleConnected:=true;
|
||||
|
@ -262,7 +262,7 @@ end;
|
||||
destructor TLazPackageLink.Destroy;
|
||||
begin
|
||||
//debugln('TPackageLink.Destroy ',IDAsString,' ',dbgs(Pointer(Self)));
|
||||
//if Origin=ploGlobal then RaiseException('');
|
||||
//if Origin=ploGlobal then RaiseGDBException('');
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -813,7 +813,7 @@ end;
|
||||
|
||||
procedure TLazPackageLinks.EndUpdate;
|
||||
begin
|
||||
if fUpdateLock<=0 then RaiseException('TPackageLinks.EndUpdate');
|
||||
if fUpdateLock<=0 then RaiseGDBException('TPackageLinks.EndUpdate');
|
||||
dec(fUpdateLock);
|
||||
if (plsGlobalLinksNeedUpdate in FStates) then UpdateGlobalLinks;
|
||||
if (plsUserLinksNeedUpdate in FStates) then UpdateUserLinks;
|
||||
|
@ -1163,7 +1163,7 @@ end;
|
||||
|
||||
procedure TLazPackageGraph.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock<=0 then RaiseException('TLazPackageGraph.EndUpdate');
|
||||
if FUpdateLock<=0 then RaiseGDBException('TLazPackageGraph.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock=0 then begin
|
||||
if FLockedChangeStamp>0 then
|
||||
@ -1794,7 +1794,7 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
if not IsValidPkgName(Prefix) then
|
||||
RaiseException('invalid pkg name "'+Prefix+'"');
|
||||
RaiseGDBException('invalid pkg name "'+Prefix+'"');
|
||||
// try Prefix alone
|
||||
if not PackageNameExists(Prefix,IgnorePackage) then begin
|
||||
Result:=Prefix;
|
||||
@ -2138,7 +2138,7 @@ procedure TLazPackageGraph.ReplacePackage(var OldPackage: TLazPackage;
|
||||
begin
|
||||
if (OldPkgFile.ComponentCount>0) then begin
|
||||
OldUnitName:=OldPkgFile.Unit_Name;
|
||||
if OldUnitName='' then RaiseException('MoveInstalledComponents');
|
||||
if OldUnitName='' then RaiseGDBException('MoveInstalledComponents');
|
||||
NewPkgFile:=NewPackage.FindUnit(OldUnitName,false);
|
||||
if NewPkgFile=nil then begin
|
||||
NewPkgFile:=NewPackage.AddRemovedFile(OldPkgFile.Filename,OldUnitName,
|
||||
@ -5480,7 +5480,7 @@ begin
|
||||
else
|
||||
CurLvl:=0;
|
||||
if Dependencies[BucketStarts[CurLvl]]<>nil then
|
||||
RaiseException('');
|
||||
RaiseGDBException('');
|
||||
Dependencies[BucketStarts[CurLvl]]:=Dependency;
|
||||
inc(BucketStarts[CurLvl]);
|
||||
Dependency:=Dependency.NextRequiresDependency;
|
||||
@ -5556,7 +5556,7 @@ function TLazPackageGraph.PackageCanBeReplaced(
|
||||
OldPackage, NewPackage: TLazPackage): boolean;
|
||||
begin
|
||||
if SysUtils.CompareText(OldPackage.Name,NewPackage.Name)<>0 then
|
||||
RaiseException('TLazPackageGraph.PackageCanBeReplaced');
|
||||
RaiseGDBException('TLazPackageGraph.PackageCanBeReplaced');
|
||||
|
||||
Result:=true;
|
||||
end;
|
||||
@ -5987,7 +5987,7 @@ begin
|
||||
|
||||
// open it
|
||||
if OpenDependency(Dependency,false)<>lprSuccess then
|
||||
RaiseException('TLazPackageGraph.OpenInstalledDependency');
|
||||
RaiseGDBException('TLazPackageGraph.OpenInstalledDependency');
|
||||
end;
|
||||
Dependency.RequiredPackage.Installed:=InstallType;
|
||||
end;
|
||||
|
@ -42,14 +42,14 @@ uses
|
||||
LCLType, LCLIntf, Forms, Controls, ComCtrls, StdCtrls, ExtCtrls,
|
||||
Menus, ButtonPanel,
|
||||
// LazUtils
|
||||
LazLoggerBase, LazUtilities,
|
||||
LazLoggerBase, LazUtilities, LazTracer,
|
||||
// LazControls
|
||||
LvlGraphCtrl,
|
||||
// IdeIntf
|
||||
IDECommands, PackageIntf, IDEImagesIntf,
|
||||
// IDE
|
||||
LazarusIDEStrConsts, IDEProcs, IDEOptionDefs,
|
||||
Project, PackageDefs, PackageSystem, PackageEditor, CleanPkgDeps;
|
||||
LazarusIDEStrConsts, IDEOptionDefs, Project,
|
||||
PackageDefs, PackageSystem, PackageEditor, CleanPkgDeps;
|
||||
|
||||
const
|
||||
GroupPrefixProject = '-Project-';
|
||||
@ -466,7 +466,7 @@ end;
|
||||
|
||||
procedure TPkgGraphExplorerDlg.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock<=0 then RaiseException('TPkgGraphExplorerDlg.EndUpdate');
|
||||
if FUpdateLock<=0 then RaiseGDBException('TPkgGraphExplorerDlg.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if FChangedDuringLock then UpdateAll;
|
||||
end;
|
||||
|
@ -4601,8 +4601,8 @@ begin
|
||||
if List=nil then List:=TObjectArray.Create;
|
||||
List.AddObject(UnitOwner,RequiredPackage);
|
||||
//debugln(['TPkgManager.GetMissingDependenciesForUnit A ',UnitOwner.ClassName,' ',RequiredPackage.Name]);
|
||||
//if TObject(List[List.Count-1])<>UnitOwner then RaiseException('A');
|
||||
//if TObject(List.Objects[List.Count-1])<>RequiredPackage then RaiseException('B');
|
||||
//if TObject(List[List.Count-1])<>UnitOwner then RaiseGDBException('A');
|
||||
//if TObject(List.Objects[List.Count-1])<>RequiredPackage then RaiseGDBException('B');
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
@ -7,10 +7,12 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils,
|
||||
// LazUtils
|
||||
LazTracer,
|
||||
// Codetools
|
||||
DefineTemplates, CodeToolManager,
|
||||
// IDE
|
||||
CompilerOptions, FileReferenceList, IDEProcs;
|
||||
CompilerOptions, FileReferenceList;
|
||||
|
||||
type
|
||||
|
||||
@ -140,7 +142,7 @@ end;
|
||||
|
||||
procedure TProjPackDefineTemplates.EndUpdate;
|
||||
begin
|
||||
if FUpdateLock=0 then RaiseException('TProjPackDefineTemplates.EndUpdate');
|
||||
if FUpdateLock=0 then RaiseGDBException('TProjPackDefineTemplates.EndUpdate');
|
||||
dec(FUpdateLock);
|
||||
if FUpdateLock=0 then begin
|
||||
if ptfIsPackageTemplate in FFlags then begin
|
||||
|
Loading…
Reference in New Issue
Block a user