Recent

Author Topic: [SOLVED] the project does not write debug info in Dwarf format  (Read 1285 times)

kito

  • Jr. Member
  • **
  • Posts: 78
[SOLVED] the project does not write debug info in Dwarf format
« on: February 18, 2023, 03:18:47 pm »
Hello
I recently noticed this message( Please see the attachment) when I try to open an existing project created with a downgraded Lazarus version.
what is it ? how could affect my project?
what is the difference between the given options ?
_____________________
Lazarus 2.2.4
Fpc: 3.2.2
Win:11/ 64 bit
« Last Edit: February 19, 2023, 11:38:08 am by kito »
We can barely feel your presence, because of the depth of your silence

totya

  • Hero Member
  • *****
  • Posts: 720
Re: the project does not write debug info in Dwarf format
« Reply #1 on: February 18, 2023, 04:55:30 pm »
I suggest to you, use "search" function on the forum before ask anything. :)

https://forum.lazarus.freepascal.org/index.php/topic,60624

https://wiki.lazarus.freepascal.org/DWARF

kito

  • Jr. Member
  • **
  • Posts: 78
Re: the project does not write debug info in Dwarf format
« Reply #2 on: February 18, 2023, 09:05:07 pm »
Yes, indeed, I had to search before asking the question. I apologize to all forum members and Moderators. Thank you totya very much I really appreciate your answer.
« Last Edit: February 18, 2023, 09:39:36 pm by kito »
We can barely feel your presence, because of the depth of your silence

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: [SOLVED] the project does not write debug info in Dwarf format [SOLVED]
« Reply #3 on: February 18, 2023, 09:27:05 pm »
Please only change the font of text (size, color, etc.) when it's really necessary.

totya

  • Hero Member
  • *****
  • Posts: 720
Re: the project does not write debug info in Dwarf format
« Reply #4 on: February 18, 2023, 09:48:56 pm »
Yes, indeed, I had to search before asking the question. I apologize to all forum members and Moderators. Thank you totya very much I really appreciate your answer.

Perhaps first time use "search in topik subject" checked when search.

Wrong version:
Dwarf is new method for debug, this is replace for the old gdb. But on Windows x64 with Lazarus x64 with recent lazarus version you must use the old gdb debugger, because opendialog is freeze when open.

Corrected verson:
Dwarf is new method for debug information. With fpdebug on Windows x64 with Lazarus x64 with recent lazarus version you must use the old gdb debugger, because opendialog is freeze when open.
« Last Edit: February 18, 2023, 10:16:16 pm by totya »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: the project does not write debug info in Dwarf format
« Reply #5 on: February 18, 2023, 09:55:12 pm »
Dwarf is new method for debug, this is replace for the old gdb.

Wrong. DWARF is the debug information generated by the compiler. This is understood by both GDB and FpDebug. The former also supports the STABS debug format which is available for the 32-bit targets. The mentioned FpDebug is what is intended to replace GDB.

But on Windows x64 with Lazarus x64 with recent lazarus version you must use the old gdb debugger, because opendialog is freeze when open.

It depends on your usecase: if your project doesn't rely on dialogs (e.g. a console application) then using FpDebug is superior to using GDB in nearly all cases.

totya

  • Hero Member
  • *****
  • Posts: 720
Re: the project does not write debug info in Dwarf format
« Reply #6 on: February 18, 2023, 10:11:36 pm »
Dwarf is new method for debug, this is replace for the old gdb.
Wrong. DWARF is the debug information generated by the compiler. This is understood by both GDB and FpDebug. The former also supports the STABS debug format which is available for the 32-bit targets. The mentioned FpDebug is what is intended to replace GDB.

I wrote for beginners, but I already know it, some one of them professionals will correct my words :) Yes, you are right. Almost.

So, Martin_fr wrote: " If using gdb, ensure not to use "Dwarf 3", instead use "Dwarf with sets". I belive him. I think, this is mean, the Dwarf debug informations created mainly of the fpdebug.

Otherwise, if you check the debugger name in Ide Option / Debugger backend: FPDebug: internal Dwarf-debugger

But you are right anyway.  O:-)

kito

  • Jr. Member
  • **
  • Posts: 78
Re: the project does not write debug info in Dwarf format
« Reply #7 on: February 18, 2023, 10:28:54 pm »
Dwarf is new method for debug, this is replace for the old gdb.
Wrong. DWARF is the debug information generated by the compiler. This is understood by both GDB and FpDebug. The former also supports the STABS debug format which is available for the 32-bit targets. The mentioned FpDebug is what is intended to replace GDB.

I wrote for beginners, but I already know it, some one of them professionals will correct my words :) Yes, you are right. Almost.

So, Martin_fr wrote: " If using gdb, ensure not to use "Dwarf 3", instead use "Dwarf with sets". I belive him. I think, this is mean, the Dwarf debug informations created mainly of the fpdebug.

Otherwise, if you check the debugger name in Ide Option / Debugger backend: FPDebug: internal Dwarf-debugger

But you are right anyway.  O:-)

I don't deserve a wrong answer either.  :(     besides since when there is an answer for beginners and an answer for professionals?  8-)
We can barely feel your presence, because of the depth of your silence

totya

  • Hero Member
  • *****
  • Posts: 720
Re: the project does not write debug info in Dwarf format
« Reply #8 on: February 18, 2023, 10:36:16 pm »
I don't deserve a wrong answer either.  :(     besides since when there is an answer for beginners and an answer for professionals?  8-)

You got two links on reply #1 from me.

Quote
Dwarf is new method for debug, this is replace for the old gdb.

As I wrote "debugger name in Ide Option / Debugger backend: FPDebug: internal Dwarf-debugger"

My logic was:
Dwarf -> fpdebug
Dwarf -> new method :)

Perhaps PascalDragon are correct, but then the FPDebug name in the options (see above) can be misunderstood.

kito

  • Jr. Member
  • **
  • Posts: 78
Re: the project does not write debug info in Dwarf format
« Reply #9 on: February 18, 2023, 10:57:39 pm »
I don't deserve a wrong answer either.  :(     besides since when there is an answer for beginners and an answer for professionals?  8-)

You got two links on reply #1 from me.

Quote
Dwarf is new method for debug, this is replace for the old gdb.

As I wrote "debugger name in Ide Option / Debugger backend: FPDebug: internal Dwarf-debugger"

My logic was:
Dwarf -> fpdebug
Dwarf -> new method :)

Perhaps PascalDragon are correct, but then the FPDebug name in the options (see above) can be misunderstood.

Frankly,  your answer for the second time is evidence that you are a wonderful person. You did not want to leave the question without giving a simplified idea. I am glad that there are many people like you in this forum.
until now I didn't go deep into the debuggers sub I had a busy day exploring this mystery, thanks again totya   I really appreciate your time
We can barely feel your presence, because of the depth of your silence

kito

  • Jr. Member
  • **
  • Posts: 78
Re: the project does not write debug info in Dwarf format
« Reply #10 on: February 18, 2023, 11:07:54 pm »
Dwarf is new method for debug, this is replace for the old gdb.

Wrong. DWARF is the debug information generated by the compiler. This is understood by both GDB and FpDebug. The former also supports the STABS debug format which is available for the 32-bit targets. The mentioned FpDebug is what is intended to replace GDB.

But on Windows x64 with Lazarus x64 with recent lazarus version you must use the old gdb debugger, because opendialog is freeze when open.

It depends on your usecase: if your project doesn't rely on dialogs (e.g. a console application) then using FpDebug is superior to using GDB in nearly all cases.
thank you for the clarifications
We can barely feel your presence, because of the depth of your silence

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: [SOLVED] the project does not write debug info in Dwarf format [SOLVED]
« Reply #11 on: February 18, 2023, 11:13:02 pm »
There have been 1 or 2 occurrences were "DWARF" has been mistaken as another word for "FpDebug". But it is not.

DWARF is a format (like PDF, xml, docx, png, ....). Only DWARF is used to write "debug info", which is the compiler providing info for the debugger. Such as, what variables are used, and at which address in memory the variable is. Or where in memory the machine code is that represents a line of Pascal code.

There are other such formats, and in the past "STABS" was used. (Delphi uses yet another format).

Then there is "GDB", which is a program, and a debugger. GDB can be used from the command line, with lots of cryptic commands. Or GDB can be used from an IDE (or other GUI interface). Lazarus has done that in the past, and still can do that. But GDB is primary for C. It does have support for Pascal, but that is limited.
Using GDB the IDE could only show limited information during debugging.
GDB can read STABS and DWARF. Some versions of GDB have problems with certain bits of DWARF 3 (probably because those are not written by common C compilers, but FPC does).

FpDebug is like GDB a debugger. But it does not exist as a stand-alone executable. It only exists as part of the IDE. And in the majority of cases gives a much better debugging experience.
FpDebug only reads DWARF.


As for FpDebug and the "File Open dialog". I have feedback from 2 people that there was an issue (already fixed in the git main branch of Lazarus).

The exact trigger is not clear. It could be a Windows 11 issue (potentially also some Windows 10 with certain updates).
But it could also be some other software that is installed. Many programs install items into the explorer menu. In some cases, this is done by using dll, and those dll will run in every app that uses a File-Open Dialog.

So you should use FpDebug, unless/until you experience your File Open dialog hang.
(According to reports, you then need to forcefully log-off, but I suspect it may be enough to force a taskmanager ctr-alt-del, and kill all instance of "explorer", then start a new one / But that has not been tested).

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9792
  • Debugger - SynEdit - and more
    • wiki
Re: the project does not write debug info in Dwarf format
« Reply #12 on: February 18, 2023, 11:16:36 pm »
So, Martin_fr wrote: " If using gdb, ensure not to use "Dwarf 3", instead use "Dwarf with sets". I belive him. I think, this is mean, the Dwarf debug informations created mainly of the fpdebug.

"Dwarf with sets" is also DWARF. It is just based on version 2 of DWARF.

STABS is way inferior than DWARF for almost all use cases.

 

TinyPortal © 2005-2018