Recent

Author Topic: Impractically slow debugger  (Read 3979 times)

hakelm

  • Full Member
  • ***
  • Posts: 153
Impractically slow debugger
« on: November 19, 2021, 04:06:45 pm »
Recently my Lazarus debugger (GDB) has become very slow even when there are no breakpoints, so slow that it is impractical to use.
What can I look for or do?
I am using Lazarus 2.0.11 and GDB 7.11.1 under Ubuntu 16.04

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: Impractically slow debugger
« Reply #1 on: November 19, 2021, 04:16:42 pm »
try to us a newer Lazarus and fpDebug. See https://wiki.freepascal.org/FpDebug
regards
Andreas

hakelm

  • Full Member
  • ***
  • Posts: 153
Re: Impractically slow debugger
« Reply #2 on: November 19, 2021, 05:00:13 pm »
Thanks, the fpdebugger did the trick.
But was has happened to the GDB?
H

ccrause

  • Hero Member
  • *****
  • Posts: 845
Re: Impractically slow debugger
« Reply #3 on: November 19, 2021, 05:32:43 pm »
But was has happened to the GDB?

Not sure why you experienced a sudden slowdown using gdb.  I have also experienced it occasionally on Linux Mint. I can further vouch that fpdebug is generally quicker than gdb, especially when debugging Lazarus itself.  This is at least partially due to fpdebug being compiled into Lazarus and not called as an external program (in my opinion).

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: Impractically slow debugger
« Reply #4 on: November 19, 2021, 05:40:41 pm »
Yes. +1
The GDB experience always depended on its version, other libs involved, the OS, IPC etc.
I am happy that FpDebug is usable now. It is already faster and it will get better over time. Eventually it will support property getter methods when FPC adds support for it.
I understood FpDebug does not work on every platform yet. Where it works it is the nro 1. choice now.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Impractically slow debugger
« Reply #5 on: November 19, 2021, 06:05:21 pm »
To try and find out why it got slower, more info is needed.

Is that for all projects? Including "hello world" style sample projects?

First of all, I have to be sure if there  was an update to the gdb you are using?
Or any other changes, you are aware off?
- Did it get slower when you update Lazarus? (Can you get the faster experience with the old Lazarus)?
- Did this include a change in fpc version
- Did you change "project options" => stabs, dwarf-2, dwarf-3, .....
- Did you recompile packages (or fpc rtl) with debug info (so there is now more debug info)?

Is this just stepping, or other things too?

Does it help if you do *ALL* of the below:
- IMPORTANT: Open the history window, and use the power button to switch it off)
- clear the watches (or use the power button to switch it off)
- close locals window
- close the stack window



The issue with using GDB has always been: speed vs correctness.

To evaluate a watch, so that a meaningful result is displayed (and pascal input is understood) the debugger must sent lots of commands to gdb, that takes time.

There were a few updates to stepping, but nothing to major that I could remember.
E.g. Stepping F7/F8 over exceptions (when the debugger does not stop for the exception) would not pause at the end of the step, but just keep running. This was fixed, it does sent some extra commands to gdb, but in my tests was not noticeable slowing it down.
Not sure how far back that was added, but its not been that recent.



 

TinyPortal © 2005-2018