mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-04 14:51:31 +01:00
starter: StartLazarus accepts --debug parameter: debug output will be written to debug.log file in the primary config directory (issue #1307).
Modified patch from Bogusław Brandys git-svn-id: trunk@9817 -
This commit is contained in:
parent
88501206d4
commit
1742704d47
@ -1397,7 +1397,7 @@ initialization
|
||||
SynTextDrawerFinalization:=false;
|
||||
{$ENDIF}
|
||||
{$IFNDEF HE_LEADBYTES}
|
||||
Ini tializeLeadBytes;
|
||||
InitializeLeadBytes;
|
||||
{$ENDIF}
|
||||
|
||||
finalization
|
||||
|
||||
@ -108,6 +108,7 @@ type
|
||||
FLazarusProcess: TLazarusProcess;
|
||||
FLazarusPath: string;
|
||||
FLazarusPID: Integer;
|
||||
FLazarusDebug: Boolean;
|
||||
FCmdLineParams: TStrings;
|
||||
procedure ParseCommandLine;
|
||||
function GetCommandLineParameters: string;
|
||||
@ -143,14 +144,18 @@ end;
|
||||
procedure TLazarusManager.ParseCommandLine;
|
||||
const
|
||||
LazarusPidOpt='--lazarus-pid=';
|
||||
LazarusDebugOpt ='--debug';
|
||||
var
|
||||
i: Integer;
|
||||
Param: string;
|
||||
begin
|
||||
FCmdLineParams := TStringList.Create;
|
||||
FLazarusPID := 0;
|
||||
FLazarusDebug := false;
|
||||
for i := 1 to ParamCount do begin
|
||||
Param := ParamStr(i);
|
||||
if LeftStr(Param,length(LazarusDebugOpt))=LazarusDebugOpt then
|
||||
FLazarusDebug := true;
|
||||
if LeftStr(Param,length(LazarusPidOpt))=LazarusPidOpt then begin
|
||||
try
|
||||
FLazarusPID :=
|
||||
@ -172,6 +177,9 @@ begin
|
||||
Result := ' --no-splash-screen --started-by-startlazarus';
|
||||
for i := 0 to FCmdLineParams.Count - 1 do
|
||||
Result := Result + ' ' + FCmdLineParams[i];
|
||||
if FLazarusDebug then
|
||||
Result := Result + ' --debug-log=' +
|
||||
AppendPathDelim(GetPrimaryConfigPath) + 'debug.log';
|
||||
end;
|
||||
|
||||
function TLazarusManager.GetLazarusPath(const FileName: string) : string;
|
||||
@ -243,9 +251,8 @@ procedure TLazarusManager.WaitForLazarus;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
begin
|
||||
if FLazarusPID<>0 then begin
|
||||
if FLazarusPID<>0 then
|
||||
WaitForPID(FLazarusPID);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TLazarusManager.Run;
|
||||
|
||||
@ -47,6 +47,7 @@ Name: {group}\Lazarus Forums; Filename: {app}\Lazarus Forums.url; IconFilename:
|
||||
Name: {group}\Lazarus Wiki Help; Filename: {app}\Lazarus Wiki Help.url; IconFilename: {app}\images\LazarusProject.ico
|
||||
Name: {group}\{cm:UninstallProgram,Lazarus}; Filename: {uninstallexe}
|
||||
Name: {userdesktop}\Lazarus; Filename: {app}\lazarus.exe; Tasks: desktopicon
|
||||
Name: {group}\{#AppName} (debug); Filename: {app}\startlazarus.exe; Parameters: --debug; WorkingDir: {app}
|
||||
|
||||
[Run]
|
||||
Filename: {app}\fpc\{#FPCVersion}\bin\i386-win32\fpcmkcfg.exe; Parameters: "-d ""basepath={app}\fpc\{#FPCVersion}"" -o fpc.cfg"; Flags: runhidden; Tasks: ; Languages:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user