Author Topic: Debugging in a real terminal on Linux (Lazarus 4.99)  (Read 507 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12715
  • Debugger - SynEdit - and more
    • wiki
Debugging in a real terminal on Linux (Lazarus 4.99)
« on: August 11, 2026, 02:59:09 pm »
Testers needed. The below should work with FpDebug and the gdb based backend.

Preparation: Open the project $(LazarusDir)/tools/unix_dbg_targetstarter/lazdebugtargetstarter.lpi and compile it. It should create an executable in its parent directory $(LazarusDir)/tools by the name of  (all lowercase) "lazdebugtargetstarter". This app must be present, and it must be in that directory.


If you use "Run parametern" (from menu "Run"), and check "Use launching application" and set it to your favourite terminal (should work for any terminal, if it can be started with an app to be run in it)
E.g.:
Code: Text  [Select][+][-]
  1. /usr/bin/gnome-terminal -t 'Lazarus Run Output' -- $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)

Important: It must have the "$(LazarusDir)/tools/runwait.sh" part. It wont work without that exact part. And, the project to be debugged must be the very next part on the command line.

In that case the debugger should open that terminal, and debug your app running in that terminal.
« Last Edit: August 11, 2026, 04:31:27 pm by Martin_fr »

Aruna

  • Hero Member
  • *****
  • Posts: 824
Re: Debugging in a real terminal on Linux (Lazarus 4.99)
« Reply #1 on: August 19, 2026, 02:26:08 am »
Testers needed. The below should work with FpDebug and the gdb based backend.

Preparation: Open the project $(LazarusDir)/tools/unix_dbg_targetstarter/lazdebugtargetstarter.lpi and compile it. It should create an executable in its parent directory $(LazarusDir)/tools by the name of  (all lowercase) "lazdebugtargetstarter". This app must be present, and it must be in that directory.


If you use "Run parametern" (from menu "Run"), and check "Use launching application" and set it to your favourite terminal (should work for any terminal, if it can be started with an app to be run in it)
E.g.:
Code: Text  [Select][+][-]
  1. /usr/bin/gnome-terminal -t 'Lazarus Run Output' -- $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)

Important: It must have the "$(LazarusDir)/tools/runwait.sh" part. It wont work without that exact part. And, the project to be debugged must be the very next part on the command line.

In that case the debugger should open that terminal, and debug your app running in that terminal.
That works perfectly on my end. I have attached a screenshot for reference. Thank you all so much for your incredible work on this!

 

TinyPortal © 2005-2018