mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 19:29:26 +02:00
* Merging revisions r46425 from trunk:
------------------------------------------------------------------------ r46425 | michael | 2020-08-14 12:33:07 +0200 (Fri, 14 Aug 2020) | 1 line * Improved exception handling, patch by Henrique Werlang (bug ID 37567) ------------------------------------------------------------------------ git-svn-id: branches/fixes_3_2@46621 -
This commit is contained in:
parent
299421721a
commit
b2c215203e
@ -123,15 +123,7 @@ end;
|
||||
Function ExecuteStubCreator(P : PStubCreator) : Boolean; stdcall;
|
||||
|
||||
begin
|
||||
Result:=False;
|
||||
try
|
||||
TStubCreator(P).Execute;
|
||||
Result:=True;
|
||||
except
|
||||
On E: Exception do
|
||||
Writeln('Exception ',E.ClassName,' ',E.Message);
|
||||
// Ignore
|
||||
end;
|
||||
Result:=TStubCreator(P).Execute;
|
||||
end;
|
||||
|
||||
Procedure GetStubCreatorLastError(P : PStubCreator; AError : PAnsiChar;
|
||||
|
@ -75,7 +75,7 @@ type
|
||||
Public
|
||||
Constructor Create(AOwner : TComponent); override;
|
||||
Destructor Destroy; override;
|
||||
Procedure Execute;
|
||||
Function Execute: Boolean;
|
||||
Procedure GetLastError(Out AError,AErrorClass : String);
|
||||
// Streams take precedence over filenames. They will be freed on destroy!
|
||||
// OutputStream can be used combined with write callbacks.
|
||||
@ -202,19 +202,22 @@ begin
|
||||
Include(O,woForwardClasses);
|
||||
end;
|
||||
|
||||
procedure TStubCreator.Execute;
|
||||
|
||||
function TStubCreator.Execute: Boolean;
|
||||
begin
|
||||
FLastErrorClass:='';
|
||||
FLastError:='';
|
||||
Result := False;
|
||||
if Defines.IndexOf('MakeStub')=-1 then
|
||||
|
||||
Try
|
||||
DoExecute;
|
||||
|
||||
Result := True;
|
||||
except
|
||||
On E : Exception do
|
||||
begin
|
||||
FLastErrorClass:=E.Classname;
|
||||
FLastError:=E.Message;
|
||||
Raise;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -307,6 +310,8 @@ begin
|
||||
SCanner.OnLog:=SE.Onlog;
|
||||
For S in FDefines do
|
||||
Scanner.AddDefine(S);
|
||||
if FDefines.IndexOf('MAKESTUB')=-1 then
|
||||
Scanner.AddDefine('MAKESTUB');
|
||||
Scanner.OpenFile(InputFilename);
|
||||
// Parser
|
||||
Parser:=TPasParser.Create(Scanner, FileResolver, SE);
|
||||
@ -340,7 +345,7 @@ begin
|
||||
FLineNumberWidth:=4;
|
||||
FIndentSize:=2;
|
||||
FExtraUnits:='';
|
||||
FOptions:=[woNoImplementation,woNoExternalClass,woNoExternalVar,woNoExternalFunc,woNoAsm,woSkipPrivateExternals,woAlwaysRecordHelper];
|
||||
FOptions:=[woNoImplementation,woNoExternalClass,woNoExternalVar,woNoExternalFunc,woNoAsm,woSkipPrivateExternals,woAlwaysRecordHelper,woSkipHints];
|
||||
end;
|
||||
|
||||
destructor TStubCreator.Destroy;
|
||||
|
Loading…
Reference in New Issue
Block a user