On Fri, 2025-02-28 at 10:09 +0100, Mathieu Othacehe wrote: > > Hello Richard, > > > One of the reasons this has stayed as pending was this messy argument > > passing, which I appreciate is pre-existing code. I've sent a patch > > which cleans it up a bit and this patch will need rebasing on top of > > it. That should at least make things cleaner. > > OK, noted. > > > I'm still a bit unsure what to do with the stripping changes this patch > > makes. One concern I worry about is having "magic" options users need > > to know to set. The other is whether there is really a binutils type > > bug underlying this and that there really should be a fix made > > somewhere else. I don't know enough about the issue to be sure whether > > there is an underlying issue though... > > I think that this can be seen in a more generic way. To get a backtrace, > libunwind supports multiple methods on ARM: > > --8<---------------cut here---------------start------------->8--- > /* unwinding method selection support */ > #define UNW_ARM_METHOD_ALL 0xFF > #define UNW_ARM_METHOD_DWARF 0x01 > #define UNW_ARM_METHOD_FRAME 0x02 > #define UNW_ARM_METHOD_EXIDX 0x04 > #define UNW_ARM_METHOD_LR 0x08 > --8<---------------cut here---------------end--------------->8--- > > The default one UNW_ARM_METHOD_EXIDX only supports partial backtraces, > as explained in the GCC thread[1]. Then, the UNW_ARM_METHOD_DWARF method > that provides complete backtraces operates on the ELF .debug_frame. By > always stripping that section, and offering no way of keeping this > section, we are preventing the user to use that unwinding method > altogether. > > That is true for ARM but for other architectures as well. It can very be > that one might want to keep the .debug_frame around on x86_64 so that > the same unwinding method is used across all the architectures supported > for a given image. > > Maybe going for the v2 approach allowing to keep any ELF section, would > feel less magical than the v1 approach that was targeting specifically > the .debug_frame section. > > Finally, the .debug_frame based unwinding was a bit broken on libunwind, > it this now fixed[2], so it would be great to be able to use it in > Yocto.
Thanks for the info, this helps but I guess I still have a question. You're using this with minidebuginfo so does it not make sense to add this as one of the debug sections injected there with the rest of the minidebug info? The option users would would then see would be whether to include frame information in the minidebuginfo section and we'd benefit from compression. Whether the tools support accessing it from such a section, I don't know. We may also need to make the sections preserved architecture dependent as I think good unwinding varies by architecture based on what you said previously. My main concern here is how to expose this in a way which users can understand and use. Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#212057): https://lists.openembedded.org/g/openembedded-core/message/212057 Mute This Topic: https://lists.openembedded.org/mt/110989612/21656 Group Owner: openembedded-core+ow...@lists.openembedded.org Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-