Recent

Author Topic: Lazarus error after OS upgrade  (Read 1039 times)

jollytall

  • Sr. Member
  • ****
  • Posts: 377
Lazarus error after OS upgrade
« on: June 20, 2023, 02:36:41 pm »
I have just upgraded from Debian 10 to 12 (it two steps, without errors). Everything upgraded (I think). Lazarus remained untouched (2.012, with FPC 3.2.0). It loads, edit, build works, but when I try to run, I get a sequence of errors:
Code: [Select]
GDB has encountered an internal error
Code: [Select]
While executing the command:
"TGDBMIDebuggerInstruction: "ptype Shortstring", [ifRequiresMemLimit, ifRequiresArrayLimit]"
gdb reported:
"&"A fatal error internal to GDB has been detected, further\ndebugging is not possible.  GDB will now terminate.\n\n""
The compiled program runs normally outside of Lazarus.
Any idea where to look for a solution? (Google found nothing.)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12010
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus error after OS upgrade
« Reply #1 on: June 20, 2023, 03:01:16 pm »
Change to "FpDebug" https://wiki.freepascal.org/Debugger_Setup

Though, 2.0.12 is quite old. And FpDebug had lots of fixes since then. (The gdb support hasn't had many changes / and the error you had is afaik a bug in gdb)


If you do want to stay with gdb, find a different version of GDB. (May have to be an older one / Don't know what has been fixed in the very latest, but some things were broken in between.)
« Last Edit: June 20, 2023, 03:03:00 pm by Martin_fr »

jollytall

  • Sr. Member
  • ****
  • Posts: 377
Re: Lazarus error after OS upgrade
« Reply #2 on: June 20, 2023, 04:22:27 pm »
Thank you.
Actually in 2.0.12 I did not find the backend option, so - if I anyway spent so-much time on upgrading the OS - I also updated Lazarus (2.2.6) and FPC (3.2.2). Now, by default I have FpDebug. And it works with some problems:

The first problem I have is that every project complains for the first time that the project does not write debug info in Dwarf format. I have 4 options, I always chose Enable Dwarf3 (-gw3) and it is OK. I tried "old" projects, and also brand new ones and it is always the same. Two questions:
- What is it exactly?
- How can I set it to be default, so I do not need it every time?

The second is, that in the past pressing F7 started the debugging step-by-step. Now the Step Into menu item is grey in the menu, but pressing F7 still does something. It gets into debug mode (debugging in the title bar), but not doing anything more. As most of the debug options are grey, Ctrl-F2 does not work, so to get out of debug mode is difficult (e.g. do Build and that can interrupt debugging).
Is it a bug or a "feature"?

Thanks,

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12010
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus error after OS upgrade
« Reply #3 on: June 20, 2023, 04:35:30 pm »
The first problem I have is that every project complains for the first time that the project does not write debug info in Dwarf format. I have 4 options, I always chose Enable Dwarf3 (-gw3) and it is OK. I tried "old" projects, and also brand new ones and it is always the same. Two questions:
- What is it exactly?
- How can I set it to be default, so I do not need it every time?
In the project options, lower left corner is a checkbox "save as default ..." (for other projects). Change your debug info to dwarf3 and save it, with that checkbox.

DWARF is a document format for debugging (like pdf or docx are for text). And it defines how the compiler can encode infos that the debugger needs.
There is also "stabs", but that is very very old....

Quote
The second is, that in the past pressing F7 started the debugging step-by-step. Now the Step Into menu item is grey in the menu, but pressing F7 still does something. It gets into debug mode (debugging in the title bar), but not doing anything more. As most of the debug options are grey, Ctrl-F2 does not work, so to get out of debug mode is difficult (e.g. do Build and that can interrupt debugging).
Is it a bug or a "feature"?

Mostly a bug. "Reset debugger" from the run menu gets you out of it.

FpDebug does not support the F7/F8 to start. You need to set a breakpoint

You can instead now use "run to cursor". Place your cursor where you want to go, and "run to cursor".

Mind "RUN", not "STEP". => "Step to cursor" is something else.

jollytall

  • Sr. Member
  • ****
  • Posts: 377
Re: Lazarus error after OS upgrade
« Reply #4 on: June 20, 2023, 05:05:49 pm »
Thanks. Solved.

Btw. it is sad with F7/F8. It is so much in my fingers. I will have to le-learn it.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12010
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus error after OS upgrade
« Reply #5 on: June 20, 2023, 06:10:00 pm »
Should be fixed in Lazarus 2.4

 

TinyPortal © 2005-2018