Recent

Author Topic: Moving away from GDB  (Read 6863 times)

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Moving away from GDB
« Reply #30 on: September 02, 2023, 03:16:08 pm »
However I've just discovered problems trying to do a complete Lazarus 2.2.4 build using my DWARF3-enabled FPC.
What versions are you trying to mix?
I just tried complete recompile of fpc3.2.2 and laz2.2.4 with switch -gl -gw3 and that works fine.
But normally I do all trunk.

BTW. Why are you still using 2.2.4 and not 2.2.6 with all the changes? (Any special reasons?)
FPC 3.2.2 still defaults to DWARF 2 (so a complete recompile is needed for FPC to get all 3).

Quote
readelf | head for ~/dev/fpc/bin/ppcx64
   Version:       3 Unit         : si_prc.pp
   Version:       3 Unit         : pp.pas
   Version:       3 Unit         : system.pp
   Version:       3 Unit         : ../inc/lnfodwrf.pp
   Version:       3 Unit         : ../inc/exeinfo.pp
   Version:       3 Unit         : ../inc/strings.pp
   Version:       3 Unit         : ../objpas/objpas.pp
   Version:       3 Unit         : catch.pas
   Version:       3 Unit         : globals.pas
   Version:       3 Unit         : compiler.pas
   Version:       3 Unit         : ../unix/baseunix.pp
   Version:       3 Unit         : ../unix/unix.pp
   Version:       3 Unit         : verbose.pas
   Version:       3 Unit         : ../unix/unixtype.pp
   Version:       3 Unit         : ../unix/unixutil.pp
   Version:       3 Unit         : ../unix/syscall.pp
   Version:       3 Unit         : ../unix/sysutils.pp
--
readelf | head for ~/dev/lazarus/lazarus
   Version:       3 Unit         : si_c.pp
   Version:       3 Unit         : lazarus.pp
   Version:       3 Unit         : system.pp
   Version:       3 Unit         : ../inc/lnfodwrf.pp
   Version:       3 Unit         : ../inc/exeinfo.pp
   Version:       3 Unit         : ../inc/strings.pp
   Version:       3 Unit         : ../inc/fpintres.pp
   Version:       3 Unit         : ../objpas/objpas.pp
   Version:       3 Unit         : ../unix/cthreads.pp
   Version:       3 Unit         : rtl-extra/src/unix/clocale.pp
   Version:       3 Unit         : ../unix/sysutils.pp
   Version:       3 Unit         : interfaces.pas
   Version:       3 Unit         : ideinstances.pas
   Version:       3 Unit         : forms.pp
   Version:       3 Unit         : lclproc.pas
   Version:       3 Unit         : ideoptionsintf.pas
   Version:       3 Unit         : lazconf.pp

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #31 on: September 02, 2023, 03:50:02 pm »
First problem was that as soon as I tried to switch to fpdebug it presented me with a dialogue telling me to specify a DWARF version. One of the options was DWARF 2, which I thought (and still think) I was using. At that point I started looking at determining what was actually in the binary...

However I've just discovered problems trying to do a complete Lazarus 2.2.4 build using my DWARF3-enabled FPC. I'll be back once I know what I'm looking at...

Well, the dialogue is the best we currently have.

The alternative is to set the default project (and package) options to -gw2 (or maybe -gw3).

But it can't be told, if there are any targets (like embedded) where that would not work. And it wouldn't fix existing projects. (nor existing packages, and the info used for the RTL is currently completely unknown to the IDE).


The dialog isn't ideal either. But at least it creates awareness.

The alternative would be just to hope that -g will produce dwarf. But then if FpDebug starts, and no breakpoints work, no values in watches.... => the user has no idea at all.

That currently is the case for packages (if ever -g would not be dwarf). But at least users would see that the project code works in the debugger. So some clue that the debugger is not entirely broken.



MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #32 on: September 02, 2023, 03:54:10 pm »
However I've just discovered problems trying to do a complete Lazarus 2.2.4 build using my DWARF3-enabled FPC.
What versions are you trying to mix?
I just tried complete recompile of fpc3.2.2 and laz2.2.4 with switch -gl -gw3 and that works fine.
But normally I do all trunk.

BTW. Why are you still using 2.2.4 and not 2.2.6 with all the changes? (Any special reasons?)
FPC 3.2.2 still defaults to DWARF 2 (so a complete recompile is needed for FPC to get all 3).

FPC 3.2.2 built clean with -gl -gw3. Attempting to use that for Lazarus 2.2.4

Code: Text  [Select][+][-]
  1. $ make LCL_PLATFORM=gtk2 bigide
  2.  

or alternatively qt5. Result is

Code: Text  [Select][+][-]
  1. (9022) Compiling resource ../units/x86_64-linux/nogui/lazbuild.or
  2. (9015) Linking ../lazbuild
  3. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/lcl/units/x86_64-linux/intfgraphics.o: in function `.La16':
  4. intfgraphics.pas:(.debug_info+0x8975): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
  5. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/lcl/units/x86_64-linux/intfgraphics.o: in function `.La18':
  6. intfgraphics.pas:(.debug_info+0x8a04): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
  7. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/lcl/units/x86_64-linux/graphics.o: in function `.La151':
  8. graphics.pp:(.debug_info+0x1db3e): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
  9. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/lcl/units/x86_64-linux/graphics.o: in function `.La152':
  10. graphics.pp:(.debug_info+0x1dbff): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
  11. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/lcl/units/x86_64-linux/imagelistcache.o: in function `.La1':
  12. imagelistcache.pas:(.debug_info+0x184): undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'
  13. /usr/bin/ld: /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/components/ideintf/units/x86_64-linux/nogui/idehelpintf.o:idehelpintf.pas:(.debug_info+0xc29): more undefined references to `DBG2_$SYSTEM_$$_IUNKNOWN' follow
  14. /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/ide/lazbuild.lpr(1878,1) Error: (9013) Error while linking
  15. /usr/local/share.lazarus/lazarus-2.2.4+3.2.2/ide/lazbuild.lpr(1878,1) Fatal: (10026) There were 1 errors compiling module, stopping
  16. Fatal: (1018) Compilation aborted
  17. make[2]: *** [Makefile:4673: lazbuild] Error 1
  18. make[2]: Leaving directory '/usr/local/share.lazarus/lazarus-2.2.4+3.2.2/ide'
  19. make[1]: *** [Makefile:5112: lazbuilder] Error 2
  20. make[1]: Leaving directory '/usr/local/share.lazarus/lazarus-2.2.4+3.2.2/ide'
  21. make: *** [Makefile:3820: lazbuild] Error 2
  22.  

I'd missed the announcement of 2.2.6. The combination of... well, certain users... has had the result of my spending far less time logged into the forum than I used to, and I gave up tracking trunk when svn was abandoned.

Above appears reproducible, depending entirely on whether FPC 3.2.2 is built with -gw2 (OK) or -gw3 (fails).

I'll take a look at 2.2.6 later in case it improves things, but I'm resigned to being told that it's Debian's problem and no effort will be put into fixing it.

Updated: fix unclosed quote. Apologies to the community for fouling that up.

MarkMLl
« Last Edit: September 03, 2023, 10:33:05 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #33 on: September 02, 2023, 03:58:27 pm »
First problem was that as soon as I tried to switch to fpdebug it presented me with a dialogue telling me to specify a DWARF version. One of the options was DWARF 2, which I thought (and still think) I was using. At that point I started looking at determining what was actually in the binary...

However I've just discovered problems trying to do a complete Lazarus 2.2.4 build using my DWARF3-enabled FPC. I'll be back once I know what I'm looking at...

Well, the dialogue is the best we currently have.

The alternative is to set the default project (and package) options to -gw2 (or maybe -gw3).

But to the best of my knowledge the project was already using DWARF 2 since that's what FPC had been built for.

What was the dialogue trying to tell me: I assumed that it meant that that the binary was in the wrong format, but was it actually just trying to say that the project options should specify an explicit debugger version? And if so what does FpDebug want?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #34 on: September 02, 2023, 04:04:52 pm »
First problem was that as soon as I tried to switch to fpdebug it presented me with a dialogue telling me to specify a DWARF version. One of the options was DWARF 2, which I thought (and still think) I was using. At that point I started looking at determining what was actually in the binary...

However I've just discovered problems trying to do a complete Lazarus 2.2.4 build using my DWARF3-enabled FPC. I'll be back once I know what I'm looking at...

Well, the dialogue is the best we currently have.

The alternative is to set the default project (and package) options to -gw2 (or maybe -gw3).

But to the best of my knowledge the project was already using DWARF 2 since that's what FPC had been built for.

What was the dialogue trying to tell me: I assumed that it meant that that the binary was in the wrong format, but was it actually just trying to say that the project options should specify an explicit debugger version? And if so what does FpDebug want?

MarkMLl

The IDE only knows that the project settings are "-g"  (well and package settings, but lets stick to the project).

The IDE does not know, what fpc does when it gets a "-g".
So for the IDE the setting must be explicit.

If the IDE could foretell what -g means to fpc => great. Then in a lot of cases the dialog would not be needed.


Of course, it would be possible to
- first build (even if -g is given)
- then check, and report only if it went bad.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Moving away from GDB
« Reply #35 on: September 02, 2023, 04:07:24 pm »
But to the best of my knowledge the project was already using DWARF 2 since that's what FPC had been built for.

What was the dialogue trying to tell me: I assumed that it meant that that the binary was in the wrong format, but was it actually just trying to say that the project options should specify an explicit debugger version? And if so what does FpDebug want?
The -g switch is default in Lazarus (when automatic) and that compiles a default depending on the FPC version.
(or is it not certain that DWARF gets included in that case?)

FPC 3.2.2 (even compiled with -gw3) will generate version 2 for the actual unit.
But it includes all needed units in the version for which FPC was compiled itself (resulting in a mix of 2/3).

So compiling 3.2.2 with -gw3, will result in all versions 3 except your own unit (when compiled with -g).

FPC 3.3.1 (trunk) will default to -gw3 and everything will be DWARF 3 anyway.

Of course... Lazarus could just scan the compiler and could know which DWARF was used for your compiler version.

But I not sure if mixing 2 and 3 might lead to problems?

Edit:
Quote
-g     Generate debug information (default format for target)
What are the defaults for which target?
According to this switch lazarus should now what target and debug info was used.
« Last Edit: September 02, 2023, 04:13:14 pm by rvk »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #36 on: September 03, 2023, 12:36:13 pm »
Starting off with FPC 3.2.2 built using

Code: Text  [Select][+][-]
  1. $ make NO_GDB=1 OVERRIDEVERSIONCHECK=1 OPT='-V3.2.2 -O- -gl -gw3 -Xs- -vt' all |/usr/local/bin/fpc-filter-vt
  2.  

where the filter script https://github.com/MarkMLl/fpclaz_build_scripts/blob/main/fpc-filter-vt "pretty-prints" the file relationships.

If I compile Lazarus using

Code: Text  [Select][+][-]
  1. $ make LCL_PLATFORM=qt5 FPCOPT='-gl -gw3' bigide
  2.  

...or for gtk2, version 2.2.6 appears OK while 2.2.4 fails with errors relating to undefined reference to `DBG2_$SYSTEM_$$_IUNKNOWN'.

I can verify using readelf that all constituents of the lazarus binary are now DWARF 3.

Changing the 2.2.4 build option to FPCOPT='-gl -gw2' doesn't fix this.

My plans are to revert FPC 3.2.2 to DWARF 2 (possibly also trying -godwarfsets and then -godwarfcpp) so that I can get back to a working Lazarus 2.2.4, test it, then to switch my day-to-day use to Lazarus 2.2.6+3.2.2.

I'll report back separately on any further build issues with 2.2.4 (i.e. whether either of the DWARF 2 suboptions has an effect) and on the behaviour of gdb and FpDebug with DWARF 3.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #37 on: September 04, 2023, 11:56:26 am »
My plans are to revert FPC 3.2.2 to DWARF 2 (possibly also trying -godwarfsets and then -godwarfcpp) so that I can get back to a working Lazarus 2.2.4, test it, then to switch my day-to-day use to Lazarus 2.2.6+3.2.2.

I've identified a trivial bit of code in one of my projects where 2.2.4+3.2.2 using DWARF 2 barfs.

Using GDB. Build FPC 3.2.2 with -godwarfsets. Build Lazarus 2.2.4 with default options, app still barfs. Build Lazarus 2.2.4 with FPCOPT='gw2  -godwarfsets', app still barfs. Rather than relying on IDE default, build app with explicit selection of DWARF2 and then DWARF 2 with sets, app still barfs even after explicitly cleaning up the working directory.

Using FpDebug. FPC 3.2.2 built for DWARF 2 with -godwarfsets, Lazarus 2.2.4 built with FPCOPT='gw2  -godwarfsets'. App built for DWARF 2 (note: explicit setting rather than relying on default). Can progress past the point at which GDB barfed.

Revert FPC 3.2.2 to defaults (i.e. only -gl) since that's what everything else I've got here expects. Build Lazarus 2.2.4 with defaults. That's basically got 2.2.4+3.2.2 back to where I started, but (a) I'm now fairly confident that I can get better debugging from FpDebug than GDB, (b) I know that the FpDebug dialogue only means "tell the IDE to use some version of DWARF, don't rely on defaults", (c) we've collectively worked out how to use readelf to inspect the DWARF version of every unit hence (d) we can see fairly clearly where the IDE etc. is getting its understanding of the DWARF version to be used from the compiler.

Note that I'm not complaining now that I understand where we're at, but that initial "Set a DWARF version, stupid!" dialogue could possibly use readelf etc. to determine what version of DWARF was currently being defaulted to, so could be more like "You're already inheriting DWARF 2 from the compiler but I'd like it set explicitly please".

I might in practice add -godwarfsets to my FPC build once the dust has settled, but would appreciate anybody's experience on this.

All in all Kudos to Martin et al. for their hard work on FpDebug and related areas.

Quote
I'll report back separately on any further build issues with 2.2.4 (i.e. whether either of the DWARF 2 suboptions has an effect) and on the behaviour of gdb and FpDebug with DWARF 3.

I think the best way of summing that up is that without additional options 2.2.4 builds with an FPC compiled to generate DWARF 2, but not if FPC has been built to generate DWARF 3.

However since 2.2.6 is now current and builds correctly with both cases, further investigation of 2.2.4 is pointless other than insofar as it will help anybody getting here via Google etc. Hopefully, what I've condensed above is adequate to satisfy that requirement.

-----

Using my standard FPC 3.2.2 (i.e. compiled with -gl only implying DWARF 2) building Lazarus 2.2.6 with default options (i.e. inheriting DWARF 2) and using GDB gives me the same debugger problem as before. Rebuilding Lazarus with FPCOPT='-gw3' doesn't change this since the program I'm debugging is non-GUI. Telling Lazarus to build the app using DWARF 3 results in a mix of v2 and v3 which still causes problems.

Building FPC 3.2.2 with explicit -gl -gw3 then using that to build Lazarus 2.2.6 fails as before, i.e. the DWARF 3 setting isn't propagating (which I think was seen earlier). Building Lazarus 2.2.6 with explicit FPCOPT='-gw3' and trying to debug the same program crashes GDB as soon as it hits the breakpoint rather than at a subsequent "step into". I can confirm that all units are showing DWARF 3. Fortunately, FpDebug appears more robust.

I would not have been at all surprised if the version of GDB with Debian "Bookworm" (i.e. the recently-released "stable") had been robust with DWARF 3, i.e. it was basically a distro problem. Unfortunately this appears not to be the case, instead there's apparently something agley in Lazarus's handling of recent (e.g. v13.1) output compared with its handling of older (e.g. v10.1 from Debian "Bullseye").

MarkMLl
« Last Edit: September 04, 2023, 02:13:34 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #38 on: September 04, 2023, 12:20:11 pm »
Quote
app still barfs.
App or GDB? I assume GDB.

Btw, does gdb give a specific error? (The IDE dialog has a "more" button).

Quote
but that initial "Set a DWARF version, stupid!" dialogue could possibly use readelf etc. to determine what version of DWARF was currently being defaulted to,
Well, it could get the info using the build in dwarf reader (that comes with fpdebug).

The difference is, that this can only happen *after* the build.

If you debug a project the size of the IDE, then you wait more than a minute only to be told: Sorry, but we just noticed the settings for that build were wrong. Please change them and wait another minute.

----------
The ideal case would be an "automatic by IDE" setting, where the IDE decides what it thinks to be best. I.e. you change the debugger, and the IDE may change the setting for you.

That would work for the project.

But packages like LCL, may be build via makefile (or maybe its just lazbuild? I have no idea, I don't usually do much with those Makefiles).
In the Makefiles, that decision can't be embedded.

So if we ship a prebuild in an installer, that still needs to be set to some fixed dwarf setting. Or, alternatively, the first debug session might rebuild the entire LCL (imagine you are a first time user, your first hello world, and it takes over a minute to start.)

Yes, ok the dialogue isn't great for a first time user either. But it is meant to be "if you don't know, press ok"

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #39 on: September 04, 2023, 12:24:11 pm »
Debug info on the RTL isn't a "new user" problem => the default in the installer does not have any debug info for the RTL.

For LCL and such packages: It is an issue, and unsolved.

Especially since any default is somewhat bad:
- Dwarf 2 gives a less good experience if using FpDebug
- Dwarf 3 may be more troublesome with GDB.

Ultimately, the user needs to be made aware at some point.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #40 on: September 04, 2023, 02:35:59 pm »
Debug info on the RTL isn't a "new user" problem => the default in the installer does not have any debug info for the RTL.

Presumably you mean sudo make install... there. But if I look at /usr/local/lib/fpc/3.2.2/ppcx64 I can still get the DWARF versions of the individual units that went into it... also if I single out e.g. system.o I can see it's not stripped.

However the issue in that dialogue isn't so much that it's failing to pick up the DWARF version that the target of the current project is carrying around (if any), it's that it's unclear whether it's saying "you need an explicit setting in the IDE, not just -g" or "your existing binaries are all broken in some way" at which point it's of considerable interest to be able to inspect existing binaries to find out what's going on (hence the kerfuffle about readelf).

And the problem with using -g appears to be that in at least some cases it implies -gw2, even if the compiler was consistently built using the -gw3 option (which it /should/ be able to determine).

MarkMLl

p.s. I'll take a bit more of a look at error messages etc. (i.e. your other message) in a few minutes. But I'm still annoyed from having somebody criticise me in court a few days ago for "spending all my time playing with obsolete languages on obsolete hardware".
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #41 on: September 04, 2023, 03:06:11 pm »
Debug info on the RTL isn't a "new user" problem => the default in the installer does not have any debug info for the RTL.

Presumably you mean sudo make install... there.
Nope, the download able installer (rpm, dep, inno setup,...)

Quote
But if I look at /usr/local/lib/fpc/3.2.2/ppcx64 I can still get the DWARF versions of the individual units that went into it... also if I single out e.g. system.o I can see it's not stripped.
I haven't checked the rpm/dep, but the inno setup has an fpc build without any dwarf.

Quote
However the issue in that dialogue isn't so much that it's failing to pick up the DWARF version that the target of the current project is carrying around (if any), it's that it's unclear whether it's saying "you need an explicit setting in the IDE, not just -g" or "your existing binaries are all broken in some way" at which point it's of considerable interest to be able to inspect existing binaries to find out what's going on (hence the kerfuffle about readelf).
Does the average user really assume that the "binaries" differ from the "settings"?

Also, (again) at the time of the dialog, the binaries don't exist. The project hasn't been compiled yet.

At best, the ppu of packages and rtl exist (and those ppu can have different info than the fpc exe. I use a fully optimized fpc/ppc, but have an RTL with debug info and -O1 // but then that is not an average setup)

At current, the IDE only pays attention to the debug info of the project (units that are part of the project).
Yes, that is an issue, packages should be checked too. But I haven't got any good idea how to do that (other than rewriting half of the IDE build system, and that is not currently an option).

Quote
And the problem with using -g appears to be that in at least some cases it implies -gw2, even if the compiler was consistently built using the -gw3 option (which it /should/ be able to determine).
Yes, and the IDE doesn't know (in advance) when that is the case and when it isn't.

I am still not clear how to improve the wording on the dialog.

Maybe other than adding "if uncertain, then use DWARF 3" (or maybe "DWARF 2" ? Because if that user ever switches to gdb .....)

I don't think that a text like
"The IDE doesn't know what the compiler will do with your current settings, so please help it by specifying a more concrete setting"
will be better?





IMHO the entire underlaying concept isn't suitable.
But that is a lot of work, and currently not on the horizon (not fitting on my todo list)


If you think you have a better text, well the text is easy to be changed.


MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #42 on: September 04, 2023, 03:29:41 pm »
Quote
app still barfs.
App or GDB? I assume GDB.

GDB while debugging app, i.e. as distinct from anything that happened while building Lazarus or the compiler.

OK, FPC 3.2.2 built from scratch with $ make NO_GDB=1 OVERRIDEVERSIONCHECK=1 OPT='-V3.2.2 -O- -gl -gw2 -godwarfsets -Xs- -vt' all |/usr/local/bin/fpc-filter-vt and Lazarus 2.2.4 built with $ make LCL_PLATFORM=gtk2 FPCOPT='-gl -gw2 -godwarfsets' bigide.

I've got a breakpoint on a specific procedure call in my app. Doing a "Step into" at that point I get a gdb dialogue, and using "More" I get

Code: Text  [Select][+][-]
  1. While executing the command:
  2. "TGDBMIDebuggerInstruction: "ptype RESULT", [ifRequiresThread, ifRequiresStackFrame, ifRequiresMemLimit, ifRequiresArrayLimit] Thr=1 Frm=0"
  3. gdb reported:
  4. "&"A fatal error internal to GDB has been detected, further\ndebugging is not possible.  GDB will now terminate.\n\n"
  5. &"This is a bug, please report it.""
  6.  

I'm fairly sure this is reproducible, and if necessary I could bundle up the entire project with test files etc.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Moving away from GDB
« Reply #43 on: September 04, 2023, 04:00:18 pm »
I'm fairly sure this is reproducible, and if necessary I could bundle up the entire project with test files etc.

Not necessary...

I was just curious, some gdb print a full assertion message, indicating what there problem is. Even then, little to be done.


Those gdb crashes can be caused by either gdb or fpc.

That is, gdb may (and observed by me: has) crashed on valid dwarf info.

But fpc has/had bugs, writing incorrect dwarf info.
(In that case fpc fixes may help)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: Moving away from GDB
« Reply #44 on: September 04, 2023, 06:14:50 pm »
But fpc has/had bugs, writing incorrect dwarf info.
(In that case fpc fixes may help)

Using today's fixes AKA 3.2.3, no change unfortunately.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018