Recent

Author Topic: Debugger Problems  (Read 2247 times)

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Debugger Problems
« on: December 16, 2020, 10:46:29 am »
I'm using Lazarus 2.1.0 and FPC 3.3.1 and I've having lots of problems with the debugger.

On windows 10 (64bit) the debugger is pretty likely to hang and take down the IDE (or render it unable to debug). This tends to happen if I have a break point on a memory management related routine, particulary in destructors, and more likely if I'm in a thread, but it can happen any time - I F7/F8/F9, and then nothing happens for maybe 15-20 secs, and then an access violation

On Linux (ubuntu 20.04), I have an exception that happens OK outside the debugger, but if it happens while I am running the program under the debugger, ubuntu itself totally freezes, and I haven't found a way to recover it other than turning it off.

I'm using the beta FpDebug in both cases, but I don't seem to have any choice of picking something else - nothing else I can choose works at all. I don't know whether I should pursue that, or do something to investigate?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger Problems
« Reply #1 on: December 16, 2020, 03:03:28 pm »
How recent a version of 2.1.0 do you use? (Which revision? / There where important fixes a month ago 12th Nov)

Please try to generate a log
https://forum.lazarus.freepascal.org/index.php/topic,42869.0.html

Also please ensure you rebuild (menu Tools > Configure build IDE) your IDE with
-Criot -gh -gw -gl -gt -Sa -O1


Quote
On Linux (ubuntu 20.04), I have an exception that happens OK outside the debugger, but if it happens while I am running the program under the debugger, ubuntu itself totally freezes, and I haven't found a way to recover it other than turning it off.

Would that be in any System-event? E.g. during painting, or key-down/up/press handling, or mouse... ?
Some Linux Desktops do hang the entire system, if any up does not return from such an event (hanging on a breakpoint, means it does not return). Afaik that is an issue of the desktop, and happens with any debugger.

In Lazarus, you could set the breakpoint properties: disable "break", so the breakpoint will continue running. Take a snapshot, and then later look at the debugger history window to see some values (only top frame...)
This may need a fix in fpdebug https://bugs.freepascal.org/view.php?id=38219

Quote
I'm using the beta FpDebug in both cases, but I don't seem to have any choice of picking something else - nothing else I can choose works at all. I don't know whether I should pursue that, or do something to investigate?
Out of interest, what goes wrong when using gdb?



Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Re: Debugger Problems
« Reply #2 on: December 17, 2020, 08:26:40 am »
which version - r64099 on windows, and 64179 on linux.

Windows: If I choose plain gdb as the debugger, and leave things as the default, I get libiconv-2.dll was not found. If I drop that in place, it works ok.

Linux, the debugger is actually GDB, not fpdebug. Changing to fpdebug gets me the error 'The name of the external debugger contains 'gdb'. The currently selected FPDebug-debugger cannot work in combination with GDB. the debugger will most likely fail to start.  ok cool, it doesn't start  -- but it doesn't tell me what to do instead....

I'll pursue the others later

Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Debugger Problems
« Reply #3 on: December 17, 2020, 08:44:31 am »
For fpdebug you can submit bug reports on Mantis. It is still in its infancy but getting better all the time. Note that I can only use fpdebug with dwarf2/3 and sometimes better than gdb and sometimes less so.
Specialize a type, not a var.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Debugger Problems
« Reply #4 on: December 17, 2020, 09:41:00 am »
On Linux (ubuntu 20.04), I have an exception that happens OK outside the debugger, but if it happens while I am running the program under the debugger, ubuntu itself totally freezes, and I haven't found a way to recover it other than turning it off.

I've seen that sort of thing on 64-bit Debian, but I put it down to the fact that I was trying to debug a UI event and that KDE/Qt didn't like what I was doing.

You should find that if you do a <Ctrl><Alt><F1> it will take you to a non-graphical login. Login as yourself, get root access via sudo, and you should then be able to kill the program being debugged and if necessary gdb and Lazarus (in that order). Logout so as not to leave a root shell active, and return to the GUI (probably) using <Ctrl><Alt><F7>

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

devEric69

  • Hero Member
  • *****
  • Posts: 648
Re: Debugger Problems
« Reply #5 on: December 17, 2020, 10:31:17 am »
For information, when I launch Lazarus in a root terminal (not recommended, however), I have never observed this problem (freezing of the OS) with Lazarus 2.0.4, fpc 3.0.4, fpDebug, and Ubuntu 20.04.
« Last Edit: December 17, 2020, 10:42:22 am by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger Problems
« Reply #6 on: December 17, 2020, 05:26:53 pm »
Changing to fpdebug gets me the error 'The name of the external debugger contains 'gdb'. The currently selected FPDebug-debugger cannot work in combination with GDB. the debugger will most likely fail to start.  ok cool, it doesn't start  -- but it doesn't tell me what to do instead....

Wrong package. You are using "fpdebug server". Not sure if Joost worked on that, if not then it is not even implemented.

package LazDebuggerFp is needed.
And then check for the none server version in the drop down

Grahame Grieve

  • Sr. Member
  • ****
  • Posts: 365
Re: Debugger Problems
« Reply #7 on: December 18, 2020, 11:13:34 pm »
well, now that I have the right fpdebugger (oops, and thanks), ubuntu no longer hangs ;-)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger Problems
« Reply #8 on: December 20, 2020, 02:30:36 pm »
I just added another important fix for linux. (only affects svn trunk / release was not broken at all). Consider svn up, if you are on trunk

 

TinyPortal © 2005-2018