mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 04:07:57 +02:00
IDE: debug messages on run/save project failures
git-svn-id: trunk@60721 -
This commit is contained in:
parent
fac4d989d7
commit
d8c53e3eb0
29
ide/main.pp
29
ide/main.pp
@ -6884,7 +6884,10 @@ begin
|
||||
Result:=IDEQuestionDialog(lisInvalidFileName,
|
||||
lisTheTargetFileNameIsADirectory,
|
||||
mtWarning, [mrCancel,mrIgnore]);
|
||||
if Result<>mrIgnore then exit(mrCancel);
|
||||
if Result<>mrIgnore then begin
|
||||
debugln(['Error: (lazarus) [TMainIDE.DoBuildProject] invalid TargetExeName="',TargetExeName,'"']);
|
||||
exit(mrCancel);
|
||||
end;
|
||||
end;
|
||||
|
||||
// create application bundle
|
||||
@ -6984,6 +6987,8 @@ begin
|
||||
DoCheckFilesOnDisk;
|
||||
end;
|
||||
IDEWindowCreators.ShowForm(MessagesView,EnvironmentOptions.MsgViewFocus);
|
||||
if ConsoleVerbosity>=0 then
|
||||
debugln(['Info: (lazarus) [TMainIDE.DoBuildProject] Success']);
|
||||
Result:=mrOk;
|
||||
end;
|
||||
|
||||
@ -7137,17 +7142,20 @@ begin
|
||||
|
||||
// Build project first
|
||||
if ConsoleVerbosity>0 then
|
||||
debugln('Hint: (lazarus) TMainIDE.DoInitProjectRun Check build ...');
|
||||
if DoBuildProject(crRun,[]) <> mrOk then
|
||||
debugln('Hint: (lazarus) [TMainIDE.DoInitProjectRun] Check build ...');
|
||||
if DoBuildProject(crRun,[]) <> mrOk then begin
|
||||
debugln(['Info: (lazarus) [TMainIDE.DoInitProjectRun] DoBuildProject failed']);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// Check project build
|
||||
ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);
|
||||
if ConsoleVerbosity>0 then
|
||||
DebugLn(['Hint: (lazarus) TMainIDE.DoInitProjectRun ProgramFilename=',ProgramFilename]);
|
||||
DebugLn(['Hint: (lazarus) [TMainIDE.DoInitProjectRun] ProgramFilename=',ProgramFilename]);
|
||||
if ((DebugClass = nil) or DebugClass.RequiresLocalExecutable)
|
||||
and not FileExistsUTF8(ProgramFilename)
|
||||
then begin
|
||||
debugln(['Info: (lazarus) [TMainIDE.DoInitProjectRun] File TargetFile found: "',ProgramFilename,'"']);
|
||||
IDEMessageDialog(lisFileNotFound,
|
||||
Format(lisNoProgramFileSFound, [ProgramFilename]),
|
||||
mtError,[mbCancel]);
|
||||
@ -7155,8 +7163,13 @@ begin
|
||||
end;
|
||||
|
||||
// Setup debugger
|
||||
if not DebugBoss.InitDebugger then Exit;
|
||||
if not DebugBoss.InitDebugger then begin
|
||||
debugln(['Info: (lazarus) [TMainIDE.DoInitProjectRun] DebugBoss.InitDebugger failed']);
|
||||
Exit;
|
||||
end;
|
||||
|
||||
if ConsoleVerbosity>0 then
|
||||
debugln(['Info: (lazarus) [TMainIDE.DoInitProjectRun] Success']);
|
||||
Result := mrOK;
|
||||
ToolStatus := itDebugger;
|
||||
end;
|
||||
@ -7177,7 +7190,11 @@ begin
|
||||
|
||||
Handled:=false;
|
||||
Result:=DoCallRunDebug(Handled);
|
||||
if Handled then exit;
|
||||
if Handled then begin
|
||||
if Result<>mrOk then
|
||||
ToolStatus:=itNone;
|
||||
exit;
|
||||
end;
|
||||
|
||||
Result := DebugBoss.StartDebugging;
|
||||
|
||||
|
@ -3435,9 +3435,10 @@ begin
|
||||
end else begin
|
||||
WriteLPS:=WriteLPI or SomeSessionModified or (not FileExistsUTF8(SessFilename));
|
||||
end;
|
||||
//debugln(['TProject.WriteProject WriteLPI=',WriteLPI,' WriteLPS=',WriteLPS]);
|
||||
if not (WriteLPI or WriteLPS) then exit(mrOk);
|
||||
end;
|
||||
//debugln(['TProject.WriteProject WriteLPI=',WriteLPI,' WriteLPS=',WriteLPS,' Modifed=',Modified,' SessionModified=',SessionModified]);
|
||||
//debugln(['TProject.WriteProject WriteLPI=',WriteLPI,' WriteLPS=',WriteLPS,' Modified=',Modified,' SessionModified=',SessionModified]);
|
||||
|
||||
// increase usage counters
|
||||
UpdateUsageCounts(CfgFilename);
|
||||
|
@ -3940,17 +3940,25 @@ begin
|
||||
SaveEditorChangesToCodeCache(nil);
|
||||
//DebugLn('SaveProject A SaveAs=',dbgs(sfSaveAs in Flags),' SaveToTestDir=',dbgs(sfSaveToTestDir in Flags),' ProjectInfoFile=',Project1.ProjectInfoFile);
|
||||
Result:=MainIDE.DoCheckFilesOnDisk(true);
|
||||
if Result in [mrCancel,mrAbort] then exit;
|
||||
if Result in [mrCancel,mrAbort] then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] MainIDE.DoCheckFilesOnDisk failed']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if CheckMainSrcLCLInterfaces(sfQuietUnitCheck in Flags)<>mrOk then
|
||||
if CheckMainSrcLCLInterfaces(sfQuietUnitCheck in Flags)<>mrOk then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] CheckMainSrcLCLInterfaces failed']);
|
||||
exit(mrCancel);
|
||||
end;
|
||||
|
||||
// if this is a virtual project then save first the project info file
|
||||
// to get a project directory
|
||||
if Project1.IsVirtual and ([sfSaveToTestDir,sfDoNotSaveVirtualFiles]*Flags=[])
|
||||
then begin
|
||||
Result:=SaveProjectInfo(Flags);
|
||||
if Result in [mrCancel,mrAbort] then exit;
|
||||
if Result in [mrCancel,mrAbort] then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] SaveProjectInfo failed']);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
// save virtual files
|
||||
@ -3970,13 +3978,19 @@ begin
|
||||
Include(SaveFileFlags,sfSaveToTestDir);
|
||||
end;
|
||||
Result:=SaveEditorFile(AnUnitInfo.OpenEditorInfo[0].EditorComponent, SaveFileFlags);
|
||||
if Result in [mrCancel,mrAbort] then exit;
|
||||
if Result in [mrCancel,mrAbort] then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] SaveEditorFile "',AnUnitInfo.Filename,'" failed']);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
Result:=SaveProjectInfo(Flags);
|
||||
if Result in [mrCancel,mrAbort] then exit;
|
||||
if Result in [mrCancel,mrAbort] then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] SaveProjectInfo failed']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// save all editor files
|
||||
for i:=0 to SourceEditorManager.SourceEditorCount-1 do begin
|
||||
@ -4010,8 +4024,11 @@ begin
|
||||
continue;
|
||||
end;
|
||||
end;
|
||||
Result:=SaveEditorFile(SourceEditorManager.SourceEditors[i], SaveFileFlags);
|
||||
if Result=mrAbort then exit;
|
||||
Result:=SaveEditorFile(SrcEdit, SaveFileFlags);
|
||||
if Result=mrAbort then begin
|
||||
debugln(['Info: (lazarus) [SaveProject] SaveEditorFile "',SrcEdit.FileName,'" failed']);
|
||||
exit;
|
||||
end;
|
||||
// mrCancel: continue saving other files
|
||||
end;
|
||||
|
||||
@ -7383,7 +7400,10 @@ begin
|
||||
if ([sfSaveAs,sfSaveToTestDir]*Flags=[sfSaveAs]) then begin
|
||||
// let user choose a filename
|
||||
Result:=ShowSaveProjectAsDialog(sfSaveMainSourceAs in Flags);
|
||||
if Result<>mrOk then exit;
|
||||
if Result<>mrOk then begin
|
||||
debugln(['Info: (lazarus) [SaveProjectInfo] ShowSaveProjectAsDialog failed']);
|
||||
exit;
|
||||
end;
|
||||
Flags:=Flags-[sfSaveAs,sfSaveMainSourceAs];
|
||||
end;
|
||||
|
||||
@ -7391,10 +7411,14 @@ begin
|
||||
UpdateProjectResourceInfo;
|
||||
|
||||
// save project info file
|
||||
//debugln(['SaveProjectInfo ',Project1.ProjectInfoFile,' Test=',sfSaveToTestDir in Flags,' Virt=',Project1.IsVirtual]);
|
||||
if (not (sfSaveToTestDir in Flags))
|
||||
and (not Project1.IsVirtual) then begin
|
||||
Result:=Project1.WriteProject([],'',EnvironmentOptions.BuildMatrixOptions);
|
||||
if Result=mrAbort then exit;
|
||||
if Result=mrAbort then begin
|
||||
debugln(['Info: (lazarus) [SaveProjectInfo] Project1.WriteProject failed']);
|
||||
exit;
|
||||
end;
|
||||
EnvironmentOptions.LastSavedProjectFile:=Project1.ProjectInfoFile;
|
||||
IDEProtocolOpts.LastProjectLoadingCrashed := False;
|
||||
AddRecentProjectFile(Project1.ProjectInfoFile);
|
||||
@ -7415,7 +7439,10 @@ begin
|
||||
// loaded in source editor
|
||||
Result:=SaveEditorFile(MainUnitInfo.OpenEditorInfo[0].EditorComponent,
|
||||
[sfProjectSaving]+[sfSaveToTestDir,sfCheckAmbiguousFiles]*Flags);
|
||||
if Result=mrAbort then exit;
|
||||
if Result=mrAbort then begin
|
||||
debugln(['Info: (lazarus) [SaveProjectInfo] SaveEditorFile MainUnitInfo failed "',DestFilename,'"']);
|
||||
exit;
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
// not loaded in source editor (hidden)
|
||||
@ -7425,7 +7452,10 @@ begin
|
||||
if (not SkipSavingMainSource) and (MainUnitInfo.Source<>nil) then
|
||||
begin
|
||||
Result:=SaveCodeBufferToFile(MainUnitInfo.Source, DestFilename);
|
||||
if Result=mrAbort then exit;
|
||||
if Result=mrAbort then begin
|
||||
debugln(['Info: (lazarus) [SaveProjectInfo] SaveEditorFile failed "',DestFilename,'"']);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user