Recent

Author Topic: changed behaviour from gdb to Fpdebug ?  (Read 2766 times)

Paolo

  • Hero Member
  • *****
  • Posts: 510
changed behaviour from gdb to Fpdebug ?
« on: January 14, 2022, 01:47:37 pm »
hello,

installed both laz 2.012 fpc 3.2.0 and laz  2.2.0 fpc 3.2.2.

now using "default" mode I see what is reported in the picture in, what wrong I have done ? Esssentially the variable DeltaF is identified but its value not diplayed in the hint

(mostrly standard installation, even if in one pc all went fine whereas in this pc the installer asked where to find FpDebug or something like that  I apply a sort of restore to default - I do not remember exactly), I have toc heck in the other PC.

OS = win 10-pro.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: changed behaviour from gdb to Fpdebug ?
« Reply #1 on: January 14, 2022, 03:10:09 pm »
32 or 64 bit? (IDE and compiled app have the same bitness, or cross compiled?)?

The variable is indeed "double"? Not by some setting "extended" (e.g. type double = extended;)?

What kind of variable is DeltaF? Local, global, Field (of object / record), ...?

What debug type info is used ? (dwarf, dwarf-3, stabs)? 
If this is in a package, what is used for the package?


Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: changed behaviour from gdb to Fpdebug ?
« Reply #2 on: January 14, 2022, 03:15:57 pm »
whereas in this pc the installer asked where to find FpDebug or something like that  I apply a sort of restore to default -

Without the exact error, I can't tell what may have happened...

Try at least to do a "clean build" of the IDE (in case there is any "memory" of a previous install in another location):
1) Menu: Package > open package from file
   Open the following packages (from the install directory of this IDE)
   components/fpdebug/fpdebug.lpk
   components/lazdebuggers/lazdebuggerfp/lazdebuggerfp.lpk
2) Menu: Tools > Configure build Lazarus
   Radio-button "clean all" => build => restart IDE.

Check Tools > Options > Debugger Backend


Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #3 on: January 14, 2022, 03:31:51 pm »
Hi Martin,

Quote
32 or 64 bit? (IDE and compiled app have the same bitness, or cross compiled?)?

64 bit

Quote
The variable is indeed "double"? Not by some setting "extended" (e.g. type double = extended;)?

Yes it is, normal double;

Quote
What kind of variable is DeltaF? Local, global, Field (of object / record), ...?
local
Code: Pascal  [Select][+][-]
  1. procedure xxx;
  2. var
  3.   DeltaF : double;
  4.  

Quote
What debug type info is used ? (dwarf, dwarf-3, stabs)?

dwarf with set

Quote
If this is in a package, what is used for the package?

no, a procedure in a unit used only for this project (*.pas).


Please note that with the settings "Debug" mode DeltaF is correctly displayed.

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #4 on: January 14, 2022, 03:40:30 pm »
Quote
Without the exact error, I can't tell what may have happened..

see the attached screen shot, at very first start the tab shown in the picture hileghted a problem, something to be corrected, and then I click on the button "Restore fppkg configuration"

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #5 on: January 14, 2022, 03:49:51 pm »
reloaunched two times startlazarus.exe, and now all works fine

(that what I did:
startlazarus and selected a path in the dropdown menu, then run the IDE, now even worse something like : "no debug... etc..."
startlazarus again -> start IDE -> now all fine !)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: changed behaviour from gdb to Fpdebug ?
« Reply #6 on: January 14, 2022, 03:56:50 pm »
Ah "Fppkg" => Free Pascal Packager manager. Nothing to do with debugging (and nothing I can help with, sorry / but applying default conf should be ok)

Quote
Please note that with the settings "Debug" mode DeltaF is correctly displayed.

As in (Menu: Project) "Project Options" (or the "options/gear" button in the main toolbar),
and then the button "Build Modes" / "..." > "Create Debug and Release modes".

And then selecting the "Debug" build mode and it works?

Or some other "Debug mode" ?




In the "Release" mode it is not expected to work.
Though, some detail is missing here. You picture shows the "blue dots" at the left of the editor. Those should only be there in debug mode.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: changed behaviour from gdb to Fpdebug ?
« Reply #7 on: January 14, 2022, 03:58:07 pm »
reloaunched two times startlazarus.exe, and now all works fine

(that what I did:
startlazarus and selected a path in the dropdown menu, then run the IDE, now even worse something like : "no debug... etc..."
startlazarus again -> start IDE -> now all fine !)

What does it show in

Tools > Options > Debug > Debugger Backend ?

In the toolbar at the top, is a drop down button, that either has
- .... (FpDebug)
- .... (gdb)

Which does it have?

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #8 on: January 14, 2022, 04:29:29 pm »
Now I am confused, the menu Tools > Options > Debug > Debugger Backend show gdb as debugger !
but I am sure that it was initially set to FPDebug even because it ask me for setting it ! (see picture), I select the first choice (), and I saw it in project > debugging menu.

How can I proceed "in a correct way" to set Fpdebug ?

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #9 on: January 14, 2022, 04:30:45 pm »
the missed image

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #10 on: January 14, 2022, 04:35:37 pm »
Now set FpDebug and the problem raises again

Paolo

  • Hero Member
  • *****
  • Posts: 510
Re: changed behaviour from gdb to Fpdebug ?
« Reply #11 on: January 14, 2022, 04:43:25 pm »
to work I have to downgrade the default from -o2 to -o1  %)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9913
  • Debugger - SynEdit - and more
    • wiki
Re: changed behaviour from gdb to Fpdebug ?
« Reply #12 on: January 14, 2022, 05:05:59 pm »
Ok, yes the image: That is normal. And you can select any of the 3  options (other than cancel)

"dwarf 2" => is rather limited, and has NO advantages. It is a subset of "dwarf with sets"

"dwarf with sets" => works well / identifiers are all uppercased.

"dwarf 3" => works well, but if you switch back to gdb, you should go to project options and switch to "dwarf with sets"
"dwarf 3" => has an issue with "variant" variables. If you need those "dwarf with sets"


to work I have to downgrade the default from -o2 to -o1  %)

-O2 is not suitable for debugging. It may sometimes work. But that is just luck. Also, it may lead to WRONG values shown.

This is not an issue of the debugger. FPC does not provide info to the debugger about the optimizations, and values that for example went into registers can not be accessed (due to the missing info).


Even "-O1" can in rare cases, lead to incorrect values shown in the debugger. (Usually the value is update when stepping a 2nd time after it was assigned)
« Last Edit: January 14, 2022, 05:07:40 pm by Martin_fr »

 

TinyPortal © 2005-2018