Recent

Author Topic: IDE behavior after upgrading Lazarus/FPC  (Read 1130 times)

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
IDE behavior after upgrading Lazarus/FPC
« on: December 12, 2022, 11:55:00 pm »
On a Debian 11 system after upgrading

from Lazarus 2.0.10 / FPC 3.2.0
to Lazarus 2.2.4 / FPC 3.2.2

I get some unexpected behavior:

1) When I try to open a project from a .lpi file, it will open the last project not the choosen one.

2) When trying to debug (F9) I get the message:

The project does not write debug info in Dwarf format.
The "FpDebug internal Dwarf-debugger" supports only Dwarf.

It gives me 3 options to add dwarf, but how is it different from the debugger of my previous Lazarus version?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #1 on: December 13, 2022, 12:22:02 am »
I don't know about point 1...

2) When trying to debug (F9) I get the message:

The project does not write debug info in Dwarf format.
The "FpDebug internal Dwarf-debugger" supports only Dwarf.

It gives me 3 options to add dwarf, but how is it different from the debugger of my previous Lazarus version?

In short, choose "dwarf 3".

The choice is, if you plan to switch back and forth between the new and the old, then it would be "dwarf 2 with sets".


The long answer is: For the past decades the debugger in the IDE used gdb as backend. The IDE just did the displaying. (well and trying to work around some problems).
"some problems" => Because gdb is more C/C++ centric, debugging Pascal lead to hick ups.

The new debugger is called "FpDebug" and it is written in Pascal, and deals better with Pascal.

If need you can toggle between FpDebug and GDB in menu: Tools > Options, on the page: Debugger > Debugger Backend.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #2 on: December 13, 2022, 12:14:26 pm »
OK for point 1)

But for point 2) under "IDE options > IDE startup > Project to Open or Create" why is there no option for starting the selected .lpi file? Was it intended this way?

Thaddy

  • Hero Member
  • *****
  • Posts: 14364
  • Sensorship about opinions does not belong here.
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #3 on: December 13, 2022, 01:13:07 pm »
It is called "Open".....
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #4 on: December 13, 2022, 02:07:08 pm »
Thaddy,
it's precisely what doesn't behave as expected!
With Debian 11.5 (Gnome desktop) by clicking on the .lpi file of the desired project and then right click > open with Lazarus, I get either the last opened project or a new project depending on the settings in the IDE startup options window.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #5 on: December 13, 2022, 03:21:35 pm »
But for point 2) under "IDE options > IDE startup > Project to Open or Create" why is there no option for starting the selected .lpi file? Was it intended this way?
Quote
by clicking on the .lpi file of the desired project and then right click > open with Lazarus,

Ups, lost in translation?
"starting the selected .lpi file" => Probably a lot of readers interpret as "Automatically Run(F9) that project, when the IDE opens".

You may have meant "starting with the selected lpi file". But even then, the reader had to infer that "selected" referred to a selection outside the IDE, in the file explorer/desktop.


Anyway, if that should work, independent of the settings that you mentioned.  Otherwise it is a bug.

The "Project to open or Create" setting, defines what happens when the IDE is started from it's own icon (i.e. not clicking any lpi in the file explorer).

For completeness sake, could you test this (double click an lpi) with the various options for "Opening Files from OS" (new/running/not-multiple instance)?
(Again it should work in any of them, but best to know which one may be the issue...)


And lastly, to see if the OS shortcuts are correctly set up:
Open a terminal/console and run
Code: Text  [Select][+][-]
  1. lazarus  /path/to/project.lpi
as well as
Code: Text  [Select][+][-]
  1. startlazarus  /path/to/project.lpi

The first one may give warnings....


tetrastes

  • Sr. Member
  • ****
  • Posts: 481
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #6 on: December 13, 2022, 08:18:01 pm »
I noticed this issue at Ubuntu 22.04 after installation of Lazarus 2.2.4 (don't remember about Lazarus 2.2.2), but thought that this was a problem of Nautilus.
So, tested at Ubuntu 22.04 with Lazarus 2.2.4:

For completeness sake, could you test this (double click an lpi) with the various options for "Opening Files from OS" (new/running/not-multiple instance)?
(Again it should work in any of them, but best to know which one may be the issue...)

None works.

And lastly, to see if the OS shortcuts are correctly set up:
Open a terminal/console and run
Code: Text  [Select][+][-]
  1. lazarus  /path/to/project.lpi

Works.

as well as
Code: Text  [Select][+][-]
  1. startlazarus  /path/to/project.lpi

Doesn't work.
« Last Edit: December 13, 2022, 08:20:24 pm by tetrastes »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #7 on: December 13, 2022, 09:16:27 pm »
as well as
Code: Text  [Select][+][-]
  1. startlazarus  /path/to/project.lpi

Doesn't work.

ok.

"startlazarus" is used to find the "correct lazarus" and execute it. It should forward all the parameters.

=> "correct lazarus" :
You more than likely installed some packages. And that meant your lazarus was rebuild. And because you run the IDE as user, when you install the packages, the rebuild lazarus executable can not be saved in the original installation path (needs root permission, and would also affect other user accounts, if there were any)

If you would search for
Code: Bash  [Select][+][-]
  1. find ~/.lazarus --name lazarus
you should find a lazarus executable. And that is the one that you are actually running. "startlazarus" finds and executes this one.

When you tested "lazarus  /path/to/project.lpi" you checked the original and unmodified lazarus as it was installed.

But when you tested "startlazarus  /path/to/project.lpi" you tested
- does start lazarus forward the argument (according to my test: no)
- does the rebuild work (probably yes)




I did a test with my Windows install of 2.2.4. (as well as current 2.3)
And indeed "startlazarus" does not forward the argument.


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9857
  • Debugger - SynEdit - and more
    • wiki
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #9 on: December 13, 2022, 09:35:16 pm »
Btw, if you know that it used to work with an earlier 2.2.x (or even 2.0.x) version, then you can use the "startlazarus" from that. (if you still have it / or can do a dummy install to get it)

bonmario

  • Sr. Member
  • ****
  • Posts: 346
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #10 on: December 14, 2022, 01:55:15 pm »

MaxCuriosus

  • Full Member
  • ***
  • Posts: 136
Re: IDE behavior after upgrading Lazarus/FPC
« Reply #11 on: December 14, 2022, 04:54:12 pm »
Martin_fr #5,
thank you for the corrections.

Taking into account your suggestions I've tried the following on the same Debian 11.5 system (terminal in the project folder):

Code: [Select]
lazarus project.lpi   # command not found

startlazarus project.lpi  # command found, but doesn't work

/usr/share/lazarus/2.2.4/lazarus  project.lpi   # command found, works

/usr/share/lazarus/2.2.4/lazarus/startlazarus  project.lpi  # command found, but doesn't works

If I remember correctly the misbehavior started after the "fpspreadsheet" package installation. It used to work with Lazarus 2.0.10.

(to facilitate these tests I've changed the settings in "Project to Open or Create" to "Simple Program")

Copying the file "startlazarus" from another Debian 11 system that has Lazarus 2.0.10. installed, to the the folder "/usr/share/lazarus/2.2.4/lazarus/" (with the proper ownership and permissions) solved the problem.

Thank you Martin_fr for the workaround.

 

TinyPortal © 2005-2018