Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Martin Frb

On 26/04/2020 20:58, Mattias Gaertner via fpc-pascal wrote:

On Sat, 25 Apr 2020 15:49:30 +0200
Martin Frb  wrote:


On 23/04/2020 22:10, Joost van der Sluis wrote:

But maybe it should become a separate package now. Lazarus can use
is as a dependency. We'll see.

That would then reverse the burden

As it is part of bigide, it must be shipped with the installer.
And also having it in the Lazarus repro means that there is no issue
with version incompatibilities.

Good point.

Maybe fppkg or fpcupdelux can support a more granular lazarus.


Having a package in the Lazarus svn, or outside makes quite a difference.

The debugger packages in the IDE relay sometimes on the exact revision 
of fpdebug (and I assume codetool is not so different in that).

Sometimes the interface between them will have to change. [1]

People using trunk IDE then need to always know the correct revision of 
fpdebug.
But even if they can use older/newer versions => see below what happens 
if they are not bound to one fixed correct version.



For installation packages (release installers), someone would need to 
rewrite the build scripts. But that is not all.
Currently the next version is getting tested in trunk. All testers test 
with the correct package version mix.
Once we can no longer be sure that trunk users used the correct version 
of externals, we need a lot more testing of the release builds.
(This is not just some external package, the stability of the IDE itself 
depends on it)



Further more, it is not only the IDE that relies on fpdebug.
fpdebug relies on the Lazarus packages DebuggerIntf and LclBase.

Given the above, taking fpdebug out of the Lazarus svn would (as it is 
currently) would probably make it more fragile.


===
[1]
I can foresee a few things about PascalBuilder.
Currently the entire formatting of values happens in fpdebug (not even 
LazDebuggerFp, but fpdebug).

However, some part of the formatting belong in the frontend.
Example: A watch of an integer, can be shown decimal or hex. That is 
something the frontend should do. It currently happens in fpdebug.

There is probably more.

Of course this poses a problem for external projects, which face the 
reverse problem.

But either one side needs to use specific revisions. Or a fork is needed.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Mattias Gaertner via fpc-pascal
On Sat, 25 Apr 2020 15:49:30 +0200
Martin Frb  wrote:

> On 23/04/2020 22:10, Joost van der Sluis wrote:
> > But maybe it should become a separate package now. Lazarus can use
> > is as a dependency. We'll see.  
> 
> That would then reverse the burden
> 
> As it is part of bigide, it must be shipped with the installer.
> And also having it in the Lazarus repro means that there is no issue 
> with version incompatibilities.

Good point.

Maybe fppkg or fpcupdelux can support a more granular lazarus.

Mattias


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Joost van der Sluis

Op 25-04-2020 om 15:49 schreef Martin Frb:

On 23/04/2020 22:10, Joost van der Sluis wrote:
But maybe it should become a separate package now. Lazarus can use is 
as a dependency. We'll see.


That would then reverse the burden


Yes, indeed.


As it is part of bigide, it must be shipped with the installer.
And also having it in the Lazarus repro means that there is no issue 
with version incompatibilities.


Well, actually Ryan is asking the same thing for the Codetools in 
another thread. And we already have had the problem with the 
virtual-treeview.


Having two big bundles of Pascal-packages (Fpc and Lazarus) is just not 
a good idea. But we have to deal with it.


A start could be to distribute those packages through fppkg, and let the 
Lazarus installer and build-system install those packages in a 
fppkg-compatible way.
There are a lot of use-cases that users have nowadays though, that need 
adaptations. Which is gonna be a lot of work. (It gives me headaches to 
solve the issues with users who are using a second configuration path...)


Other workaround is to 'fork' them, as Mattias hinted upon. Or add them 
with a different name to fppkg. (Comparable to what we did with 
virtual-treeview). But maybe we should then rename the units, or give 
them a dotted prefix.


Well, thoughts for the future. First try to get something to work.

Regards,

Joost.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-25 Thread Martin Frb

On 25/04/2020 16:07, Ryan Joseph via fpc-pascal wrote:



On Apr 24, 2020, at 3:10 AM, Joost van der Sluis  wrote:

I'm working on the support of the debug-adapter-protocol for fpDebug. It's 
quite easy to implement, as there already is a json-based tcp/ip interface. 
(https://microsoft.github.io/debug-adapter-protocol)

I use the debugger in VSCode and while LLDB works pretty well, short strings 
are always a problem. I've never used fpDebug though so I can't say if it's 
better than LLDB (I thought it was no very mature).


FpDebug has the advantage that it knows "fpc".

That is on top of what is specified by the dwarf info, fpdebug does look 
for other info.

Of course only, if it the dwarf info contains the producer = fpc.

ShortString (depending on dwarf version) is IIRC encoded as record. So 
any debugger will show this. But fpdebug looks for some details in how 
fpc writes various dwarf entries. And then detects it as shortstring. 
Though this works for known fpc versions only.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-25 Thread Ryan Joseph via fpc-pascal


> On Apr 24, 2020, at 3:10 AM, Joost van der Sluis  wrote:
> 
> I'm working on the support of the debug-adapter-protocol for fpDebug. It's 
> quite easy to implement, as there already is a json-based tcp/ip interface. 
> (https://microsoft.github.io/debug-adapter-protocol)

I use the debugger in VSCode and while LLDB works pretty well, short strings 
are always a problem. I've never used fpDebug though so I can't say if it's 
better than LLDB (I thought it was no very mature).

Regards,
Ryan Joseph

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-25 Thread Martin Frb

On 23/04/2020 22:10, Joost van der Sluis wrote:
But maybe it should become a separate package now. Lazarus can use is 
as a dependency. We'll see.


That would then reverse the burden

As it is part of bigide, it must be shipped with the installer.
And also having it in the Lazarus repro means that there is no issue 
with version incompatibilities.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-23 Thread Joost van der Sluis

Hi all,

I didn't want to share this yet, but it is related to the Pascal 
Language Server so maybe some of you might be interested.


I'm working on the support of the debug-adapter-protocol for fpDebug. 
It's quite easy to implement, as there already is a json-based tcp/ip 
interface. (https://microsoft.github.io/debug-adapter-protocol)


I want to use it to debug fpc-applications with Visual Studio Code.

It's a little bit difficult as fpDebug is in the Lazarus repository. It 
was placed there because fpc's releases were not often enough. But maybe 
it should become a separate package now. Lazarus can use is as a 
dependency. We'll see.


Regards,

Joost.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal