Unwanted debugging -gdwarf-4 option set automatically in library projects by MCUXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unwanted debugging -gdwarf-4 option set automatically in library projects by MCUXpresso

Jump to solution
2,658 Views
stefanct
Contributor IV

Building headless (via CDT's generic org.eclipse.cdt.managedbuilder.core.headlessbuild application) or opening a project's properties in the GUI adds the -gdwarf-4 option to the com.crt.advproject.gcc.lib.release.option.debugging.other setting of the currently active configuration in library projects.

While this setting also seems to be the default for executables, it does not get re-added there and I am not sure if it has the same effects when linking as with libraries. But with static libraries the resulting binaries are actually different as the debug info gets embedded into the object files that end up in the library, which is obviously unwanted.

0 Kudos
Reply
1 Solution
2,508 Views
AdrianOltean
NXP Employee
NXP Employee

I got your point. I'll recheck the way the Dwarf-related flag is enforced and do some improvements based on your inputs. We'll see if this fits in the upcoming IDE v11.10.0 release.

Thanks,

Adrian

View solution in original post

0 Kudos
Reply
5 Replies
2,609 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @stefanct 

For better resolve your issue, please tell us your chip number. And detail steps about how to reproduce you issue. 

 

BR

Alice

0 Kudos
Reply
2,602 Views
jackking
Senior Contributor I

I have this issue as well. 

On Mac OS Sonoma Version 14.2.1 with MCUXpresso IDE v11.9.0 [Build 2144] [2024-01-05] and MCUXpresso SDK Version 2.15.00 (801 2024-01-15) for MIMXRT1060-EVKB.

Any new SDK Example project has the -gdwarf-4 debug option set in the IDE even though this flag is not specified in the config of the example (XML) or in the .cproject file.

SCR-20240426-gdmw.png

0 Kudos
Reply
2,565 Views
AdrianOltean
NXP Employee
NXP Employee

Indeed, the IDE changes the implicit Dwarf format used by GCC. As you noticed, Dwarf 4 is now used instead of the default Dwarf 5. Long story short, this should not affect the actual code that's being generated, only the debug information is affected. We decided to enforce Dwarf 4 for debugging purposes, because of the many issues we've encountered with GDB, not being able to fully interpret Dwarf 5 (for now). If you want, you can always specify "-gdwarf-5" in the "Other debugging flags" field and the IDE will not change it in this case.

Regards,

Adrian

0 Kudos
Reply
2,525 Views
stefanct
Contributor IV
The problem is that this actually enforces debug information to be present in the binary (no matter what the other "Debug level" is set to), which is undesired in our case. Software overriding developers is never a good idea. A warning would be more appropriate IMHO. Checking the "Debug level" for non-"none" before setting the value would also improve things (for my case at least).
0 Kudos
Reply
2,509 Views
AdrianOltean
NXP Employee
NXP Employee

I got your point. I'll recheck the way the Dwarf-related flag is enforced and do some improvements based on your inputs. We'll see if this fits in the upcoming IDE v11.10.0 release.

Thanks,

Adrian

0 Kudos
Reply