Recent

Author Topic: [SOLVED] Dwarf in Lazarus 2.2.0?  (Read 4301 times)

Hopestation

  • Full Member
  • ***
  • Posts: 181
[SOLVED] Dwarf in Lazarus 2.2.0?
« on: April 04, 2022, 06:20:03 pm »
Hi.

I have just downloaded and installed Lazarus
Version:2.2.0
Date: 2022-01-02
FPC Version 3.2.2
Revision: Lazarus_2_2_0
x86_-win64-win32/win64.

I tried to compile a project produced in an earlier version of Lazarus and got a window I have never seen before saying:

Enable Dwarf (-gw)?

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

There are 4 buttons:

Enable Dwarf with 2 sets, Enable Dwarf 2 (-gw), Enable Dwarf 3 (-gw), and Cancel.

I am completely mystified, I've never heard of Dwarf in any previous versions if Lazarus.

What is it?

How do I use it

Which button should I select?



« Last Edit: April 05, 2022, 05:37:35 pm by Hopestation »

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Dwarf in Lazarus 2.2.0?
« Reply #1 on: April 04, 2022, 06:38:14 pm »
There is a debugger board here, which you can browse to discover more.
But basically in order to debug any program the debugger needs lots and lots of information about it, such as its variables' names and addresses etc. etc. This data has to be produced by the compiler and stored in some  format or other, and Dwarf is one option. Like most data formats Dwarf has evolved over time.
Try Dwarf3.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Dwarf in Lazarus 2.2.0?
« Reply #2 on: April 04, 2022, 07:29:38 pm »
https://forum.lazarus.freepascal.org/index.php/topic,58745.0.html

I promoted the existing thread on the topic.
« Last Edit: April 04, 2022, 07:38:27 pm by Martin_fr »

Hopestation

  • Full Member
  • ***
  • Posts: 181
Re: Dwarf in Lazarus 2.2.0?
« Reply #3 on: April 05, 2022, 11:10:44 am »
Thanks for your replies.

I tried howardpc's link but didn't find a dashboard. It took me to a query from rcmz, who had a similar question  to mine, and Martin_fr's reply. Martin_fr's link took me to the same page.

This compared Dwarf to GDB and it appears that at present GDB may be better.

I've used GDB since I first started using Lazarus. I know it does occaisionaly crash but I can live with it.

Do I have the option to change my debugger back to GDB?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Dwarf in Lazarus 2.2.0?
« Reply #4 on: April 05, 2022, 12:38:07 pm »
At present GDB is better for some corner cases.

- Needing stack traces for functions in the OS kernel.
- debugging on "machine code" (assembler) level
- using old style objects: "type TFoo = object ..." (this is NOTHING to do with "type TFoo = class...")


Yes you can switch: Tools > Options > Debugger > Backend

You can also switch per project, in the project options

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Dwarf in Lazarus 2.2.0?
« Reply #5 on: April 05, 2022, 12:55:09 pm »
« Last Edit: April 05, 2022, 01:48:19 pm by Martin_fr »

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Dwarf in Lazarus 2.2.0?
« Reply #6 on: April 05, 2022, 01:23:21 pm »
This compared Dwarf to GDB and it appears that at present GDB may be better.

As someone who regularly debugs the compiler: FpDebug is definitely performing better there than GDB, especially on Windows.

Also DWARF has nothing to do with the decision whether you use GDB or not. DWARF is a debug format and it's the only format supported by FpDebug and one of multiple supported by GDB. And usually DWARF will be better with GDB as well than e.g. Stabs (which only exists for 32-bit systems anyway).

Hopestation

  • Full Member
  • ***
  • Posts: 181
Re: [SOLVED] Dwarf in Lazarus 2.2.0?
« Reply #7 on: April 05, 2022, 05:38:15 pm »
Thanks for all your replies.

Rinzwind

  • Newbie
  • Posts: 6
Re: [SOLVED] Dwarf in Lazarus 2.2.0?
« Reply #8 on: May 21, 2022, 07:04:07 am »
From the linked thread:

Dwarf 2": this is the minimum. It has no advantages. E.g., it can not display watches for "set of". IMHO, no reason to use at all.

"Dwarf 2 with sets": Use this if:
 - you work with variants (not yet avail in dwarf 3, will be fixed at some point)
 - you need to often switch between the new FpDebug and the old GDB
    -> pro: GDB currently has the better disassembler, and gdb currently often has better stack WHILE your app is in the Win-Kernel
    -> contra: GDB occasionally crashes.

"Dwarf 3": Best setting, unless one of the above condition applies to you.



And because I can not reply to the other topic for whatever reason... please make the 'best' setting the default. As is now, the 'worst' option is selected by default...

PaulANormanNZ

  • Full Member
  • ***
  • Posts: 115
Re: [SOLVED] Dwarf in Lazarus 2.2.0?
« Reply #9 on: June 24, 2022, 07:36:00 am »
Thank you for sharing that information I was a bit surprised and at a loos to know where to go with this one, had to Google it and eventually ended up here..

I introduced Lazarus to a friend recently, and I think given the wealth of contemporary choices, he might be showing himself distracted from using more of Lazarus by these sort of things happening with little or no explanation; unless you read right through changes logs and so on -- which I tend to do myself when I have time, having started back in pre-Windows DOS — compile your own linux.XWindows days :-)

Been thinking that it would be marvelous to incorporate either a Forum item id number to a permanent posting to search on come to for more information, or even a More Information live link, in these types of dialogue boxes throughout Lazarus linking either to the Forum website or an appropriate entry in a Lazarus help CHM ...?

Especially during actual IDE installation questions/issues — a live web link on choices and resolutions!



 

TinyPortal © 2005-2018