[Lazarus] Trying FPDebug

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
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'.

Regards,

Joost.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
El 22/11/18 a las 11:08, Joost van der Sluis via lazarus escribió:

> 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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
On 22/11/2018 16:08, Santiago A. via lazarus wrote:
>
> 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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
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

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
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.

> 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.

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list


Martin Frb via lazarus wrote:

> 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
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list

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?

Dennis

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
Op 09-01-19 om 09:40 schreef Dennis via lazarus:

>
> 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.
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Trying FPDebug

Free Pascal - Lazarus mailing list
On 09/01/2019 11:20, Joost van der Sluis via lazarus wrote:
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...)


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.



--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus