Haven't looked at any related code for some time...
The file that the debugger will run, is set in
unit DebugManager
function TDebugManager.InitDebugger(AFlags: TDbgInitFlags): Boolean;
...
if not(difInitForAttach in AFlags) then begin
...
else
GetLaunchPathAndExe(LaunchingCmdLine, LaunchingApplication, LaunchingParams, False);
...
if FDebugger <> nil
then FDebugger.FileName := LaunchingApplication;
But I haven't tracked where the values from the settings are retrieved.
Also, all of this code has been written for gdb (and much of it in the old days, for older gdb, and for really old Linux terminals).
Not sure how much of it was updated over time. And most of it want have been tested with FpDebug.
There are several issues debugging libraries, when it comes to setting breakpoints (including those internally set by the IDE to catch exceptions). IIRC There is a bit about it somewhere on the wiki.... It may work with current versions of gdb.
Currently my time goes to work on the debugger frontend and fpdebug for general debugging.
Depending what comes up, some fixes and work outside the debugger.
And then hopefully improve debugging of libraries. (fixing the breakpoint issue, and at that time - if not forgotten - look at the hosting app)