Forum > Debugger

How to set HostApplication with a relative path or something similar?

<< < (4/4)

EMBarbosa:

--- Quote from: Martin_fr on December 29, 2022, 01:02:34 am ---2)

I just tested (Lazarus 2.3 - Win10), this works as host application:
$(ProjSrcPath)\..\foo\project1.exe

Search the IDE for "GlobalMacroList" and you should get all the macros that are added.

--- End quote ---
I need say this first: Well you are right. I didn't find it before, thank you.

This seems to solve my problem in OP, at least in Windows as "$(ProjSrcPath)\..\..\foo\project1.exe" translates to "c:\project1\..\..\foo\project1.exe".
Then this "semi relative" path ("c:\project1\..\..\foo\project1.exe") can be used with FileExists, and the error is not raised anymore.
So, I'm not sure we **really** need relative paths anymore.
How could we make this more visible in the IDE, Help and Wiki?

Anyway, this code in Main.pp:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---            // Check project build      ProgramFilename := MainBuildBoss.GetProjectTargetFilename(Project1);...      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]);        Exit;      end; Seems wrong to me. I mean not really wrong, but maybe in wrong place.

In my point of view (well, POV of someone not familiar with the IDE code), the responsibility of verify if the debugger can run the project build, should be of the debugger class.
So this code should be in "DebugBoss.InitDebugger" or in something like "DebugBoss.CheckPrerequisites".

Navigation

[0] Message Index

[*] Previous page

Go to full version