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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,666 次查看
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 项奖励
回复
1 解答
2,516 次查看
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 项奖励
回复
5 回复数
2,617 次查看
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 项奖励
回复
2,610 次查看
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 项奖励
回复
2,573 次查看
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 项奖励
回复
2,533 次查看
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 项奖励
回复
2,517 次查看
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 项奖励
回复