Hello, On typical VxWorks environments, WindRiver integrated tools are used as much if not more than gdb for debugging purposes.
These evolve at an industrial pace, traditionally not as fast as GCC regarding the support of latest dwarf standards. As of today, in our experience, the best compromise to let WRS debugging tools work fine and have negligible effect on gdb's experience for this target is to enforce strict dwarf-2 debugging info by default. We have been doing this in our production compilers for a while and find it really useful, so we're happy to contribute here, in case this is deemed more generally appropriate. The attached patch achieves this in two mini steps: - Allow to distinguish between a dwarf version picked by default by the compiler and one provided on the command line that happens to match the default, which is useful to make sure we don't override a request for an explicit level on the command line. This is achieved by initializing dwarf_version to -1 instead of 2 from common.opt, then pick 2 as a default from toplev.c:process_options, similar to the scheme in place for dwarf_strict already. - Default to dwarf_strict = 1 && dwarf_version = 2 for VxWorks via vxworks_override_options. Sanity checked on mainline for powerpc-wrs-vxworks and bootstrapped on x86_64-pc-linux-gnu. Thanks in advance for your feedback, With Kind Regards, Olivier 2012-04-13 Olivier Hainque <hain...@adacore.com> * common.opt (gdwarf-): Initialize dwarf_version to -1 instead of 2. * toplev.c (process_options): Default to dwarf_version 2. * config/vxworks.c (vxworks_override_options): Default to strict-dwarf and dwarf_version 2.
vxdwarf.dif
Description: video/dv