Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-11

Trying FPDebug

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Santiago A.

Hello:

I would like to fiddle a little with FPdebug, but I'm a little confused. I have lazarus 1.8.4 on window 7 32 bits

I have installed the next packages

FpDebug 0.0
lazdebuggerfp

But that is not enough, it is still using GDB. isn't it? I have tried to install lazdebuggerfpdserver, but it needs baselinux and I am in win32.

any tutorial or howto?

Saludos Santiago A.

Reply by email

Joost van der Sluis
to Santiago A.

Op 22-11-18 om 11:00 schreef Santiago A. via lazarus:

Show quoted text 8 lines
I would like to fiddle a little with FPdebug, but I'm a little confused. I have lazarus 1.8.4 on window 7 32 bits I have installed the next packages FpDebug 0.0 lazdebuggerfp

- Once you have installed lazdebuggerfp you have to go to the IDE-options. (not the package or project options, but the IDE-options)
- Then select 'Debugger' on the left
- Select 'FpDebug internal Dwarf-debugger (beta)' on the right

Then you're done. Note that you have to select an executable, but this executable is never used by FpDebug, so you can leave it on 'gdb'.

Regards,

Joost.

Reply by email

Santiago A.
to Joost van der Sluis
Joost van der Sluis wrote 17 lines
Op 22-11-18 om 11:00 schreef Santiago A. via lazarus: > > I would like to fiddle a little with FPdebug, but I'm a little > confused. I have lazarus 1.8.4 on window 7 32 bits > > I have installed the next packages > > FpDebug 0.0 > lazdebuggerfp - Once you have installed lazdebuggerfp you have to go to the IDE-options. (not the package or project options, but the IDE-options) - Then select 'Debugger' on the left - Select 'FpDebug internal Dwarf-debugger (beta)' on the right Then you're done. Note that you have to select an executable, but this executable is never used by FpDebug, so you can leave it on 'gdb'.

Ok. Thanks. I was puzzled looking for a FpDebug Executable.

By the way, I see "FpDebug internal Dwarf-debugger (alpha)". An (Alpha) version, not (beta) version as you said. Is there a newer version, a (beta), or did you mean (alpha)?

Saludos Santiago A.

Reply by email

Martin Frb
to Santiago A.
Santiago A. wrote 5 lines
By the way, I see "FpDebug internal Dwarf-debugger (alpha)". An (Alpha) version, not (beta) version as you said. Is there a newer version, a (beta), or did you mean (alpha)?

As part of Lazarus 2.0RC it is beta.

Reply by email

Dennis
to Martin Frb

I am using Lazarus 1.9.0, FPC 3.1.1
I am testing fpDebug.

When there an exception is raised during debug, the following dialog popped up.
I tried to click the "Ignore this exception type" then then click 'continue' but the debugger does not add the exception to the Language Exception list, so it keeps stopping at this exception type.

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190101/71dfd33e/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: kemmamphpdgkdgml.png
Type: image/png
Size: 5350 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190101/71dfd33e/attachment.png>

Reply by email

Martin Frb
to Dennis
Dennis wrote
I am using Lazarus 1.9.0, FPC 3.1.1

You need either 2.1 or fixes 2.0

It works for me.

I do not remember that it did not add it... but I know it did not ignore the ones that had been added. revision 59655

Anyway it works in latest trunk.

Show quoted text 8 lines
I am testing fpDebug. When there an exception is raised during debug, the following dialog popped up. I tried to click the "Ignore this exception type" then then click 'continue' but the debugger does not add the exception to the Language Exception list, so it keeps stopping at this exception type.

Reply by email

Dennis
to Martin Frb
Martin Frb wrote 11 lines
On 01/01/2019 11:08, Dennis via lazarus wrote: > I am using Lazarus 1.9.0, FPC 3.1.1 You need either 2.1 or fixes 2.0 It works for me. I do not remember that it did not add it... but I know it did not ignore the ones that had been added. revision 59655 Anyway it works in latest trunk.

It is fine if it has been fixed.
By the way, I want to express my gratitude toward fpDebug. It is so much faster than GDB and the inline variable inspection seems to work better as well.
Good jobs guys.

Dennis

Reply by email

Dennis
to Joost van der Sluis: Op 22-11-18 om 11:00 schreef Santiago A. via lazarus: - Once you have installed…
Joost van der Sluis wrote 15 lines
Op 22-11-18 om 11:00 schreef Santiago A. via lazarus: > > I would like to fiddle a little with FPdebug, but I'm a little > confused. I have lazarus 1.8.4 on window 7 32 bits > > I have installed the next packages > > FpDebug 0.0 > lazdebuggerfp - Once you have installed lazdebuggerfp you have to go to the IDE-options. (not the package or project options, but the IDE-options) - Then select 'Debugger' on the left - Select 'FpDebug internal Dwarf-debugger (beta)' on the right

I downloaded Lazarus 2.1 with FPC 3.0.4 win 64 bit.

When I tried to debug with fpdebug, it asked me

Which one should I choose?

Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190109/e2b29460/attachment.html> -------------- next part --------------
A non-text attachment was scrubbed...
Name: fohhccohhilcefhe.png
Type: image/png
Size: 6901 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190109/e2b29460/attachment.png>

Reply by email

Joost van der Sluis
to Dennis

Op 09-01-19 om 09:40 schreef Dennis via lazarus:

Show quoted text 25 lines
Joost van der Sluis via lazarus wrote: > Op 22-11-18 om 11:00 schreef Santiago A. via lazarus: >> >> I would like to fiddle a little with FPdebug, but I'm a little >> confused. I have lazarus 1.8.4 on window 7 32 bits >> >> I have installed the next packages >> >> FpDebug 0.0 >> lazdebuggerfp > > - Once you have installed lazdebuggerfp you have to go to the > IDE-options. (not the package or project options, but the IDE-options) > - Then select 'Debugger' on the left > - Select 'FpDebug internal Dwarf-debugger (beta)' on the right > I downloaded Lazarus 2.1 with FPC 3.0.4 win 64 bit. When I tried to debug with fpdebug, it asked me Which one should I choose?

I saw this screen also, and was quite confused. As far as I know fpc uses Dwarf as default now. But Martin probably had a reason to add this.

Select -gw3. It basically means that the compiler is allowed to use Dwarf-3 specific functions. (In practice: proper string indexing, so 1-based instead of 0-based.) Older versions of Gdb did not handle those properly.

Otoh, it could be that Martin added work-arounds for the string issues with Dwarf-2. But this all has to be tested. ;)

So I would say, use the newest version, Dwarf 3, -gw3.

Regards,

Joost.

Reply by email

Martin Frb
to Joost van der Sluis
Joost van der Sluis wrote 7 lines
Op 09-01-19 om 09:40 schreef Dennis via lazarus: > When I tried to debug with fpdebug, it asked me > > Which one should I choose? I saw this screen also, and was quite confused. As far as I know fpc uses Dwarf as default now. But Martin probably had a reason to add this.

Fpc 3.0.4 with -g on win 32bit => stabs

The IDE makes no assumption what -g means. So it asks. It also asks, if you have no debug info switched on at all. (Despite that is only the project, and packages might have dbg info...)

Show quoted text 5 lines
Select -gw3. It basically means that the compiler is allowed to use Dwarf-3 specific functions. (In practice: proper string indexing, so 1-based instead of 0-based.) Older versions of Gdb did not handle those properly.

New versions of gdb still crash with PAnsiString under dwarf3 (But that  is gdb and off topic)

Otoh, it could be that Martin added work-arounds for the string issues with Dwarf-2. But this all has to be tested. ;)

Only for cases that can be detected => that is short string AnsiString are handled as pchar => #0 terminated  (there is on diff in the dbg info, so not possible to determine)
AnsiString[n] returns 2 results: 0 and 1 based

So I would say, use the newest version, Dwarf 3, -gw3.

Yes Dwarf 3 is recommended for fpdebug (You also get the benefit of identifiers NOT being all uppercased)

A few notes:

Evaluating of local var and param while paused on procedure/function begin or end line may cause crashes. (especially with Dwarf 3) This applies to Locals/Watches/Evaluate/... views. Currently the problem is know for variable len type data (string/dyn array), including structures containing such types. See https://bugs.freepascal.org/view.php?id=34746
A *workaround *(for currently known cases) is present. (r59895)

(Any Dwarf version) Strings and Arrays are limited to a max len of 5000 / 3000. Currently this is not configurable. Sometimes less. Nested arrays are limited to just the first few items.
This is partly an "out of mem" protection, and also a limit needed by the lldb-fp debugger for Mac (reading huge mem takes long time)

PChar, WideStrings, (maybe AnsiString in Dwarf 2) may be cut off, even if below there max len limit. The Debugger sees WideString as PWideCHar and has to guess how far to look for the terminating #0. The guess is adjusted in steps, and may miss the correct len
=> For WideString fpc does not yet use the dwarf3 encoding with length.

With Dwarf 2 all strings are #0 terminated (strings are pchar). Except shortstring, which are encoded as record, but recognized by fpdebug and displayed correctly.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190109/b2e654dc/attachment.html>

Reply by email