Recent

Author Topic: Lazarus Debugger error Linux mint 19 when using run parameters  (Read 5749 times)

Mladen

  • New Member
  • *
  • Posts: 30
Hello, after trying to use Lazarus on Linux Mint 19 or Ubuntu MATE 18.04, when using run parameters "/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)" to run my web application in terminal I get the following error.

The GDB command:
"info address main"
returned the error:
",msg="No symbol \"main\" in current context.""

On Linux Mint 18.3(Ubuntu 16.04) it worked fine and it had GDB version 7.11 installed.

GDB version is 8.1 now.

Cheers
Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #1 on: July 13, 2018, 12:33:32 pm »
It probably is the different xterm version.

You can try the "startup break method" (or similar name) from the property grid under Tools > Options > Debugger.  try the value "AddZero" instead.

But it may not help. And even if it can start it, it may not be able to debug it (eg set breakpoints). If so, you need to check if xterm may fork any sub processes, and if there are settings to prevent this. If not, then I do not know of any solution.

There is a window in the IDE showing your apps output: Menu View > Debug windows > console in/out


See also http://forum.lazarus-ide.org/index.php/topic,34922
« Last Edit: July 13, 2018, 12:35:34 pm by Martin_fr »

Mladen

  • New Member
  • *
  • Posts: 30
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #2 on: July 13, 2018, 12:51:42 pm »
It probably is the different xterm version.

You can try the "startup break method" (or similar name) from the property grid under Tools > Options > Debugger.  try the value "AddZero" instead.

But it may not help. And even if it can start it, it may not be able to debug it (eg set breakpoints). If so, you need to check if xterm may fork any sub processes, and if there are settings to prevent this. If not, then I do not know of any solution.

There is a window in the IDE showing your apps output: Menu View > Debug windows > console in/out


See also http://forum.lazarus-ide.org/index.php/topic,34922

Thank you for your answer. I will use console window from now on.

Cheers!
Using Lazarus 2.0.12 with FPC 3.2.2 on Linux Mint 20.2 Xfce

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #3 on: October 04, 2018, 09:08:22 pm »
I have the same problem with Lazarus 1.8.4 on Ubuntu 18.04 with KDE-Plasma Desktop. When I enable Menu "Run / Run Parameters / Use launching application" then on program start I get an error (see screenshot1):

Code: [Select]
The debugger could not set a breakpoint on the application's entry point.
This may be caused by missing debug info.

The GDB command:
"info address main"
returned the error:
",msg="No symbol \"main\" in current context.""

I spent a couple of time searching at google and in this forum for that problem, but I found no solution. Often was recommended to disable the debugger. But in Lazarus 1.8.4 I found no setting to do this (maybe I'm blind? ;-). So please can somebody describe how exactly I can disable the debugger - thanks a lot.

Also I tried to set Menu Tools / Options / Debugger / General / InternalStartBreak to gdsbAddZero, but nothing changed. Please see attached my debugger options.

My program is a simple "Hello world". I created it via Menu "File / New / Simple Program".

As "launching application" I can choose between 3 predefined possibilities:

/usr/bin/konsole -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)
/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)
/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'

I tried all 3 but no difference. All 3 console programs exist and do start in the above path.

I tried Menu "View / Debug Windows / Terminal Output" but found so many disadvantages that I don't want to really use it.
I would be very happy if one of the debugger experts could help me.
Thanks a lot in advance.

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #4 on: October 04, 2018, 09:40:20 pm »
You disable the debugger via Tools->Options
In IDE Options dialog select Debugger in the treeview on the left, and set the first dropdown in the "Debugger type and path" section to "(none)".

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #5 on: October 04, 2018, 10:23:13 pm »
Thank you for helping me. I tried
   (none)
   none
   "(none)"
but in all 3 cases I get a 1st error when clicking on OK and a 2nd error when starting the program (see screenshots).
I use Lazarus 1.8.4 on Ubuntu 18.04. Did you try your suggestion with Linux?

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: Lazarus Debugger error Linux mint 19 when using run parameters
« Reply #6 on: October 07, 2018, 01:40:36 pm »
I got a solution. With the following "launching application" it works on my PC:
Code: [Select]
/usr/bin/python3 /usr/bin/gnome-terminal -t 'Lazarus Run Output' -- $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)
   
"gnome-terminal" is the default terminal on Ubuntu 18.04 (which comes with gnome-desktop).

And 2 more informations:
 - you can disable the debugger permanently via Menu "Tools / Options / Debugger / General": select "(none)" in the combo-box directly below the text "Debugger type and path" - don't type it into the text field below.
 - you can disable the debugger temporary via Menu "Run / Run without debugging"

 

TinyPortal © 2005-2018