Recent

Author Topic: Testers wanted: FpDebug on Linux and Windows  (Read 9320 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Testers wanted: FpDebug on Linux and Windows
« on: October 13, 2019, 05:59:40 pm »
It is time to get some feedback on how FpDebug behaves in the wild.

If you want to test it, you need:
- Lazarus 2.1  revision 62049 (dated 13 Oct 2019) or higher/later
- Fpc any version that above Lazarus works with.
  If you use FPC trunk, you should aim for revision 43183 or higher.
     earlier trunk will cause bad results inspecting bitpacked arrays
     3.0.4 is fine
     3.2 may depend on what gets merged when, and FpDebug may need amendments if certain fpc fixes are merged.

As for what to expect:  https://wiki.lazarus.freepascal.org/FpDebug

It is recommended to test this with DWARF-3
However DWARF-2 is also supported. Please mention which one you tested.

When reporting back:
- Your Lazarus and FPC version/revision.
- Your OS (with version and 32 or 64 bit)
- Your IDE is 32 or 64 bit
- Your FPC is 32 or 64 bit
- Your target app is 32 or 64 bit (and indicate if it was cross compiled, by an FPC with different bitness)
- In case something failed, log output of (or preferably, a reproducible testcase)
  lazarus.exe   --debug-log=file   --log-enable=DBG_STATE,DBG_DATA_MONITORS,DBG_ERRORS,DBG_VERBOSE,DBG_WARNINGS,DBG_BREAKPOINTS,DBG_FPDEBUG_VERBOSE,FPDBG_BREAKPOINT_ERRORS,FPDBG_BREAKPOINTS

Thank you

« Last Edit: October 13, 2019, 06:04:43 pm by Martin_fr »

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #1 on: October 13, 2019, 06:13:05 pm »
Will do for 3.2 and trunk.
Specialize a type, not a var.

ccrause

  • Hero Member
  • *****
  • Posts: 845
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #2 on: October 13, 2019, 09:18:35 pm »
I'll start using it on Linux 64 with FPC 3.0.4 and trunk.

Are there any plans to expand FpDebug to support remote debugging (gdb remote serial protocol) of AVR? I guess the key additions would be a remote communication layer and an AVR disassembler.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #3 on: October 13, 2019, 09:42:13 pm »
Are there any plans to expand FpDebug to support remote debugging (gdb remote serial protocol) of AVR? I guess the key additions would be a remote communication layer and an AVR disassembler.

No, no plans for gdb protocol.

Other CPU... Probably depend on contribution.

A FpDebug Server (for remote debugging to platform on which fpdebug runs....) will probably come. There already is some code that was started ages ago. But then the FpDebug Server must run on the target.
Also this will be a while... Plenty of other stuff before.

Same for a command line interface. Some prove of concept code exists, but may need to be fixed to be able to compile.

---------------------
About gdb...

There is LazDebuggerFpGDBMI.
Which is gdb, but watches and locals are done by fpdebug (using gdb to read the memory).

Since the fpdebug engine (and all the dwarf for watches) is a package of its own, anyone who wants can start a debugger that implements the gdb protocol and uses the fpdebug classes to handle dwarf.

Or translate LazDebuggerFpGDBMI to use gdbserver.
That should be easy, since it just needs to insert the commands to gdb that set the remote.... (and maybe async gdb commands)
« Last Edit: October 13, 2019, 09:43:49 pm by Martin_fr »

ccrause

  • Hero Member
  • *****
  • Posts: 845
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #4 on: October 14, 2019, 01:54:38 pm »
Or translate LazDebuggerFpGDBMI to use gdbserver.
That should be easy, since it just needs to insert the commands to gdb that set the remote.... (and maybe async gdb commands)
My preference is to move away from gdb since it needs a patch (which has been around since 2016) to work properly with the separate memory spaces of avr.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #5 on: October 14, 2019, 02:14:58 pm »
My preference is to move away from gdb since it needs a patch (which has been around since 2016) to work properly with the separate memory spaces of avr.
Moved to https://forum.lazarus.freepascal.org/index.php/topic,47073.msg336382.html#msg336382

devEric69

  • Hero Member
  • *****
  • Posts: 648
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #6 on: October 17, 2019, 01:42:28 pm »
Sorry, but I'm discovering FpDebug. So, hoping to be able to participate to its test:
- I've installed its package (components\fpdebug\fpdebug.lpk, version 0.0), in Lazarus 2.0.2 + FPC 3.0.4.
- in my project options, I use "Dwarf 3".

==> now, my stupid questions:
a) in the environment options, debugger, I must select "LLDB debugger (with fpdebug beta)" ?
b) below, do I leave "$(LazarusDir)\mingw\$(TargetCPU)-$(TargetOS)\bin\gdb.exe" ?

Thank you for the clarifications.
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: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #7 on: October 17, 2019, 06:35:25 pm »
On Linux / Windows

You need to install the package LazDebuggerFp
and then you find "fpdebug .... " in the list. and you do not need gdb (nor any other external exe)

Note that in 2.0.x you can use it, but it has known bugs. And is slower. Testing should be done with Lazarus trunk


On Mac, the standalone fp debug does not work, but you can install LazdebuggerFPlldb, and then change from gdb to lldb
« Last Edit: October 17, 2019, 06:37:56 pm by Martin_fr »

devEric69

  • Hero Member
  • *****
  • Posts: 648
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #8 on: October 18, 2019, 08:41:50 am »
Thank you.
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #9 on: October 19, 2019, 09:30:41 am »
Not so detailed test but it works pretty good (and much faster than gdb).
One small problem: when program finished there's no dialog "Execution stopped" like it popup when stop program with gdb as debugger.
EDIT: Fedora 29, 64bit, fpc-3.0.4 + lazarus trunk r62073

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #10 on: October 25, 2019, 03:00:52 pm »
One small problem: when program finished there's no dialog "Execution stopped" like it popup when stop program with gdb as debugger.
I just tested (on windows though) and the dialog appears.

Have you checked in the Tools > Options > Debugger > General, that the checkbox is set? (this is not part of the backend config)

EDIT:
On Fedora 28 it works too
« Last Edit: October 25, 2019, 03:13:34 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #11 on: December 08, 2019, 06:02:43 pm »
I put together a feature/status list (according to memory):
https://wiki.lazarus.freepascal.org/Debugger_Status

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #12 on: December 09, 2019, 03:53:42 pm »
I put together a feature/status list (according to memory):
https://wiki.lazarus.freepascal.org/Debugger_Status

Thanks! Really much appreciated   :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #13 on: March 06, 2020, 01:32:54 pm »
Does not work in 32bit Lazarus debugging 64bit App.
With gdb i could set the 64bit gdb in the options.

But this is obvius as the debugger is integrated in the 32bit Lazarus App!
A message dialog would be nice in this case ;-) Instead of doing nothing!

Pascal
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9791
  • Debugger - SynEdit - and more
    • wiki
Re: Testers wanted: FpDebug on Linux and Windows
« Reply #14 on: March 06, 2020, 01:47:55 pm »
Does not work in 32bit Lazarus debugging 64bit App.

Yes, that is known. At some time in the future an external/remote fpdebug.exe may be created.

 

TinyPortal © 2005-2018