Recent

Author Topic: Console In/Output slow  (Read 7328 times)

jollytall

  • Sr. Member
  • ****
  • Posts: 376
Re: Console In/Output slow
« Reply #30 on: February 10, 2024, 05:33:22 pm »
Thanks. I double checked and indeed if I change the default debugger then it works.

I am still confused how this has an effect when I have debug info even switched off in the compiler options.
Also, in the past I had to change to fpDebug, because of a bug: https://forum.lazarus.freepascal.org/index.php/topic,63723.msg483152.html#msg483152. The good news that now, when I changed back the GDB, the error is gone.

Also, I tried to report this error in GitLab, but with a strange error it does not accept my logging in through GitHub, although I can easily log in to there. The error is
Email is not allowed for sign-up. Please use your regular email address. Check with your administrator.
I even tried to create a new user id for GitLab, but the same error.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Console In/Output slow
« Reply #31 on: February 10, 2024, 10:14:50 pm »
Please try with https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/47c34d2e7ea0356f0b101becc5df8cc311e8c4cd

You can copy and paste those changes into your current Lazarus. Definitely if you have 3.0, but 99% sure also if you have 2.2.x.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Console In/Output slow
« Reply #32 on: February 10, 2024, 10:23:26 pm »
the transition from gdb to fpdebug that stopped some of the "decorations" I added working.

If something stopped working, maybe it should be reported.

I noted (not done all that code myself) that fpdebug does not use the DbgIntfPseudoTerminal that is used by gdb. I don't know why though, nor if that has side effects.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8104
Re: Console In/Output slow
« Reply #33 on: February 10, 2024, 11:15:42 pm »
If something stopped working, maybe it should be reported.

Roger, I'll check and (if necessary) report within a couple of days.

I'm obviously an extremely minor contributor, but when I looked at this it was specifically in the context of 8-bit "extended ANSI" fonts as used for ALGOL/APL characters ** so there were a few things related to ISO-2047 etc. which were of interest. These were almost certainly things that debugger output etc. would have problems with, so I assumed that more experienced developers considered them to be more trouble than they were worth.

** There's at least two encodings, which might not have "official" codepage numbers, in addition to what's in Unicode's "Miscellaneous Technical" area.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jollytall

  • Sr. Member
  • ****
  • Posts: 376
Re: Console In/Output slow
« Reply #34 on: February 11, 2024, 11:14:29 am »
Please try with https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/47c34d2e7ea0356f0b101becc5df8cc311e8c4cd

You can copy and paste those changes into your current Lazarus. Definitely if you have 3.0, but 99% sure also if you have 2.2.x.

I failed big time. First I tried to paste the changes in my actual Lazaus and tried to rebuild the IDE. It immediately failed when reached fpdbglinuxclasses.pas, as it has in the uses FpDbgCpuX86 what was not in my files. So, I added that and the next one until I got an error inside the unit (i.e. it did not miss anything in the uses, still it failed). Then I gave up this route and installed Lazarus 3.0RC1. It took me some time, but now I have it with FPC 3.2.2.
According to SourceForge the file is from 2023-12-23, so obviously the latest changes were not in it. So, again I tried to update fpdbglinuxclasses with the latest commit, but it again misses FpDbgCpuX86. There I gave up. MAybe I will try later to download the whole set of the latest source files and build it again.

However, I found few things that are interesting to me.
In the new menu, under project options / compiler options / debugging there is a new checkbox "Run uses the debugger". I think this answers my earlier question why the debugger is relevant even if I do not compile with debugger information.
Also, under project options / debugger there is a new option for debugger backend, next to gdb, fpdebug and ide default, called project debugger. I know nothing about this, so I google-ed: 'lazarus "use project debugger"' and got one result with a source code, but nothing else. Is there a documentation somewhere?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Console In/Output slow
« Reply #35 on: February 11, 2024, 11:54:26 am »
Please try with https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/47c34d2e7ea0356f0b101becc5df8cc311e8c4cd

You can copy and paste those changes into your current Lazarus. Definitely if you have 3.0, but 99% sure also if you have 2.2.x.

I failed big time. First I tried to paste the changes in my actual Lazaus and tried to rebuild the IDE. It immediately failed when reached fpdbglinuxclasses.pas, as it has in the uses FpDbgCpuX86 what was not in my files.

Ok, I should have been more precise. Copy the one method/function and replace the existing. Or even just the affected lines.


Quote
installed Lazarus 3.0RC1. It took me some time, but now I have it with FPC 3.2.2.
3.0.RC1 is old, 3.0 is already out.

But the change is currently in trunk (main branch) only.
So no release, and also not the 3-fixes branch

Quote
However, I found few things that are interesting to me.
In the new menu, under project options / compiler options / debugging there is a new checkbox "Run uses the debugger". I think this answers my earlier question why the debugger is relevant even if I do not compile with debugger information.
Enable/Disable debug info just means the debugger will be able to show variables and the current line. Or it will not, and you get only assembler.

Without debug info you can still run in the debugger.

Historically the "run (F9)" in the "run" menu, would always start the debugger (except if - in tools > options - you had no debugger backend configured at all. (Because then obviously it can't).
That meant, that if you had release and debug modes, your release mode, with F9 would still be started in the debugger.

Of course - historically - you could use "run without debugger" from the run menu, but that did not react to F9.

Now you can toggle what F9 should do.

Quote
Also, under project options / debugger there is a new option for debugger backend, next to gdb, fpdebug and ide default, called project debugger. I know nothing about this, so I google-ed: 'lazarus "use project debugger"' and got one result with a source code, but nothing else. Is there a documentation somewhere?
If you press F1 in that dialog, you should get to
https://wiki.freepascal.org/IDE_Window:_Project_Options_-_Debugger_Backend

You can configure additional backends in the project settings. This is useful if you use a remote debugger, that needs to be configured to connect to a specific other PC. But also if you need any other option of the debugger config to be different, just for the one project.

jollytall

  • Sr. Member
  • ****
  • Posts: 376
Re: Console In/Output slow
« Reply #36 on: February 11, 2024, 12:51:44 pm »
Thanks,

3.0.RC1 is old, 3.0 is already out.

That might be another small issue. On the https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.0/ page it indeed says 3.0.0, but when I installed it, the about box still says 3.0RC1. Maybe that was simply not updated when promoted to stable.

MarkMLl

  • Hero Member
  • *****
  • Posts: 8104
Re: Console In/Output slow
« Reply #37 on: February 11, 2024, 01:36:02 pm »
Roger, I'll check and (if necessary) report within a couple of days.

I'm obviously an extremely minor contributor, but when I looked at this it was specifically in the context of 8-bit "extended ANSI" fonts as used for ALGOL/APL characters ** so there were a few things related to ISO-2047 etc. which were of interest. These were almost certainly things that debugger output etc. would have problems with, so I assumed that more experienced developers considered them to be more trouble than they were worth.

** There's at least two encodings, which might not have "official" codepage numbers, in addition to what's in Unicode's "Miscellaneous Technical" area.

Could somebody eyeball the "Console In/Output" window please, and report whether the "Decorations" pane is usable or greyed-out. On all the versions I've got here it's greyed-out, I don't think it's anything I've done locally and there's a possibility that it was disabled after I submitted the patch (I suspect that was in the Lazarus 1.8 era, but don't know my way around the post-Mantis management system).

"Output Style" works as expected, although it could possibly be usefully revisited by somebody who's got useful ideas of what characters to use for the upper part of the codepages. "Line limit" as as I left it, I was never able to work out how to get rid of those underscores.

I'm obviously not that bothered about the decorations: the line numbers might be useful but the C0/C1 stuff is really relevant only to somebody who's writing a terminal emulator (or getting unexpected parity errors from a serial device, etc.).

I'll happily raise a bug report if anybody thinks it's worth it, but I don't want to add to the clutter if it's not.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

cdbc

  • Hero Member
  • *****
  • Posts: 1775
    • http://www.cdbc.dk
Re: Console In/Output slow
« Reply #38 on: February 11, 2024, 01:47:55 pm »
Hi
Laz 3.0
Quote
Could somebody eyeball the "Console In/Output" window please, and report whether the "Decorations" pane is usable or greyed-out.
On my install it's 'Greyed'.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

MarkMLl

  • Hero Member
  • *****
  • Posts: 8104
Re: Console In/Output slow
« Reply #39 on: February 11, 2024, 02:06:41 pm »
Hi
Laz 3.0
Quote
Could somebody eyeball the "Console In/Output" window please, and report whether the "Decorations" pane is usable or greyed-out.
On my install it's 'Greyed'.
Regards Benny

Thanks for that. I'll try to find time to see what happens if it's un-greyed, at least on v2.

I admit that I've not got to v3 yet, mostly because I missed the announcement due to the amount of wibble in the "Announcements" part of the forum.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Hartmut

  • Hero Member
  • *****
  • Posts: 891
Re: Console In/Output slow
« Reply #40 on: February 11, 2024, 05:55:46 pm »
Btw, off topip, but
1)
"Additional search path" https://wiki.lazarus.freepascal.org/IDE_Window:_DebuggerGeneralOptionsFrame (should open on F1)
Quote
If the IDE needs to find the sources
"sources" => pascal sources that are not in the project folder, or any folder configured by the project, nor any folder of a package used (in other words sources you added by manually specifying them to the compiler, bypassing the IDE).

So "/usr/bin/gdb" wont help here.

Thank you Martin_fr for that explanations. I set this field now to empty.

Quote
2)
If you have an Intel/Amd cpu, then on the backend (your 2nd image) you may consider trying "FpDebug internal Dwarf debugger".  For most people it gives a much better debugging experience. (even in 2.2.6 / certainly in 3.0)
Except of course, potentially for the problem reported here on the "cut off" output window (if it turns out to be caused by FpDebug)

I switched to "FpDebug internal Dwarf debugger" and from that moment I see only 461 lines Output in the Console-Output-Window from Lazarus (see screenshot), as you already wrote in reply #29.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Console In/Output slow
« Reply #41 on: February 11, 2024, 06:28:43 pm »
I switched to "FpDebug internal Dwarf debugger" and from that moment I see only 461 lines Output in the Console-Output-Window from Lazarus (see screenshot), as you already wrote in reply #29.

And if you try the patch?

Hartmut

  • Hero Member
  • *****
  • Posts: 891
Re: Console In/Output slow
« Reply #42 on: February 12, 2024, 08:27:23 am »
I switched to "FpDebug internal Dwarf debugger" and from that moment I see only 461 lines Output in the Console-Output-Window from Lazarus (see screenshot), as you already wrote in reply #29.

And if you try the patch?

I want to test the patch for you. Because I have never applied a patch and my newest Lazarus is 2.2.4 it would be the easiest for me if I could install Lazarus trunk via fpcupdeluxe. Is your patch meanwhile included in Lazarus trunk?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 10668
  • Debugger - SynEdit - and more
    • wiki
Re: Console In/Output slow
« Reply #43 on: February 12, 2024, 10:17:24 am »
It is in trunk, yes. Just not in fixes.

You don't need to apply it as patch, using the patch program. You con open the file from your lazarus in an editor, and you will find the same procedure that is show on gitlab, just che few lines to replace.

Hartmut

  • Hero Member
  • *****
  • Posts: 891
Re: Console In/Output slow
« Reply #44 on: February 12, 2024, 03:11:29 pm »
Is your patch meanwhile included in Lazarus trunk?

It is in trunk, yes. Just not in fixes.

I had problems to install Laz+FPC trunk, because FPC trunk seems to be broken currently because of https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40762

I understood you, that your patch is included in *Lazarus* trunk, so I installed Lazarus trunk = main_3_99-1434-g76da2aad75 with FPC 3.2.2-r0d122c49 (release).

With FPDebug I see only 461 lines. If I switch to GDB, I see 1000 lines. So this patch does not work here.

As said, I'm on Linux Ubuntu 22.04 64-bit with GTK2.

 

TinyPortal © 2005-2018