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.
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.