I use the executable file demo.axf of the project in STM32F4xx_DFP.2.15.0, execute readelf -S demo.axf on the command line and find that demo.axf has .debug.str, but when I compile this project, I find .debug. str disappeared.
My development environment is: keil5.36 MDK, my goal is to extract variable names from .debug.str.
Hi lex
I have moved your question to the Keil forum where someone may be able to help you.
Thanks
Oli from the Community team
You may check if you have enabled the option "Options for Target - Output - Debug Information":
https://www.keil.com/support/man/docs/uv4/uv4_dg_adsout.htm
Moreover, check which compiler toolchain version you are using.
On my side, a Blinky example project from the STM32F4xx_DFP.2.15 is built with Armclang v6.16 in MDK v5.36 and I got the .debug_str section in the axf image
Thank you ChenTang
I have solved problem as you said,but I get the DWARF version is 4,so,how to set DWARF version 3
Thank you very nuch
you can use this compiler command line option -g, -gdwarf-2, -gdwarf-3, -gdwarf-4 (armclang)
developer.arm.com/.../-g---gdwarf-2---gdwarf-3---gdwarf-4--armclang-
Thank you,Chen Tang,the problem is solved,while,I have another quesion,why I use compiler 5,there is no .debug_str in axf,and I use compiler 6,,there is .debug_str in axf.whether It is necessary to add parameter in keil.keil parameter setting is here:developer.arm.com/.../Compiler-Command-line-Options
armcc v5.x compiler seems to only support up to dwarf3. I'm not an expert of dwarf standard. Maybe this plays a role? On the other hand, unlike armclang v6.x, armcc v5.x compiler is not based on LLVM or clang, which might be the reason why the section name for debug info might be different.