Forum > Debugger

32bit debugging

(1/3) > >>

A bug only shows in the linux 32bit version of my app. So, I built a 32bit VM, install FPC and Laz Fixes 3.0 but I find the debugger will not step through LCL code (where the problem exists IMHO).

So, I went back to my Build VM, a 64bit one with appropriate cross compiler to 32bit. Again, trying to step through a 64bit binary, we skip over any LCL code. Step through my code, not LCL. But, exactly the same settings except a 64bit target, step through everything, just as I would expect. Seems to me, being a 32bit binary means no step through.

So, before I delve any deeper, thought I had better check, is it expected the debugger works with LCL code and a 32bit intel binary ? Why not ?

gtk2, normal debug settings, "Generate info for the debugger.." set but "Use external debug symbols file" NOT set.
OS : Debian 12; Ubuntu 20.04
Debuger : FpDebug internal Dwarf-debugger.
Debug data : Dwarf 2 with sets.


Maybe the LCL is build with debug info type "stabs"? Project settings will not affect packages.

You can use package options, or in the project setting "addition and overrides" (see wiki).

Hmm, Martin, I suspect its simpler than that, the i386 object files are not being built with any debug info

--- Code: ---dbannon@u2004MnewBuild:~/bin/Lazarus/lazarus-fixes_3_0$ file ./lcl/units/i386-linux/gtk2/gtk2wscomctrls.o ./lcl/units/i386-linux/gtk2/gtk2wscomctrls.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
dbannon@u2004MnewBuild:~/bin/Lazarus/lazarus-fixes_3_0$ file ./lcl/units/x86_64-linux/gtk2/gtk2wscomctrls.o ./lcl/units/x86_64-linux/gtk2/gtk2wscomctrls.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped

--- End code ---

For clarity, just the right most end of the lines -

--- Code: ---$> file ./lcl/units/i386-linux/gtk2/gtk2wscomctrls.o  ELF 32-bit LSB relocatable, Intel 80386, .. not stripped
$> file ./lcl/units/x86_64-linux/gtk2/gtk2wscomctrls.o ELF 64-bit LSB relocatable, x86-64, .., with debug_info, not stripped

--- End code ---

Now, those i386 object files are being rebuilt if I do a clean up and rebuild for example but remain without debugging info (in the case of the 32bit build). Here is the project options debugging screen. I understand that should ensure all rebuilt files get debug info ?



--- Quote from: dbannon on November 18, 2023, 12:53:00 pm ---Hmm, Martin, I suspect its simpler than that, the i386 object files are not being built with any debug info

--- End quote ---

Well, same thing. Your project options only affect the files in your project:

No file of any package is affected.
Exception "Additions and Overrides" can affect packages.

Or open the package (I think you need LclBase for those files), and go to Options (from the toolbar of the package window) and turn on debug info there.

Or go to menu Tools > Configure Build IDE
and add under custom: -gw3
(this should affect the base packages, but I don't know if it will auto rebuild them, or if you need to trigger via rebuild IDE)

Hmm, yes, makes sense. But does seems strange that, out of the box, 64bit has LCL built with debugging info, 32bit does not .

I opened the lazarus.lpi project, it includes the gtk2 interface files as as a "Required Packages" (although I don't see the interfaces files as part of a package). That project did have debugging turned on, -gw3 was set, the gtk2 files were rebuilt with a "Clean up and Rebuild" but still without debugging. I am guessing that is because they are "Packages of the project"  in this context. Even though they do not present as part of a package ??

But I setting -gw3 in IDE rebuild options did the trick. But, in my mind, I don't see why that is necessary in a 32bit install but not necessary in a 64bit install.  In both cases, built from lazarus fixes 3.0 source. One gets debugging, the other does not.

Thanks Martin, your help greatly appreciated. I can get my debugging done now but suspect its much further upstream ....



[0] Message Index

[#] Next page

Go to full version