From 824a2b3d8cb18e80ed11231ed57b4bf67134fcd0 Mon Sep 17 00:00:00 2001 From: Olivier Hainque Date: Wed, 22 Nov 2017 17:30:07 +0000 Subject: [PATCH] vxworks.c (vxworks_override_options): Pick default dwarf version from macro value, VXWORKS_DWARF_VERSION_DEFAULT. 2017-11-22 Olivier Hainque * config/vxworks.c (vxworks_override_options): Pick default dwarf version from macro value, VXWORKS_DWARF_VERSION_DEFAULT. * config/vxworks.h: Define VXWORKS_DWARF_VERSION_DEFAULT and DWARF_GNAT_ENCODINGS_DEFAULT. * config/vxworksae.h: Likewise. From-SVN: r255069 --- gcc/ChangeLog | 8 ++++++++ gcc/config/vxworks.c | 8 +++++--- gcc/config/vxworks.h | 10 ++++++++++ gcc/config/vxworksae.h | 9 +++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f80012097ca..74acbccc58a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-11-22 Olivier Hainque + + * config/vxworks.c (vxworks_override_options): Pick default + dwarf version from macro value, VXWORKS_DWARF_VERSION_DEFAULT. + * config/vxworks.h: Define VXWORKS_DWARF_VERSION_DEFAULT and + DWARF_GNAT_ENCODINGS_DEFAULT. + * config/vxworksae.h: Likewise. + 2017-11-22 Marc Glisse PR tree-optimization/83104 diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c index 944cc1d239b..1d903689de1 100644 --- a/gcc/config/vxworks.c +++ b/gcc/config/vxworks.c @@ -150,11 +150,13 @@ vxworks_override_options (void) if (flag_pic && !TARGET_VXWORKS_RTP) error ("PIC is only supported for RTPs"); - /* Default to strict dwarf-2 to prevent potential difficulties observed with - non-gdb debuggers on extensions > 2. */ + /* VxWorks comes with non-gdb debuggers which only support strict + dwarf up to certain version. Default dwarf control to friendly + values for these. */ + if (!global_options_set.x_dwarf_strict) dwarf_strict = 1; if (!global_options_set.x_dwarf_version) - dwarf_version = 2; + dwarf_version = VXWORKS_DWARF_VERSION_DEFAULT; } diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 62149d45e21..29a6cb01e18 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -202,3 +202,13 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority); /* The diab linker does not handle .gnu_attribute sections. */ #undef HAVE_AS_GNU_ATTRIBUTE + +/* Default dwarf control values, for non-gdb debuggers that come with + VxWorks. */ + +#undef VXWORKS_DWARF_VERSION_DEFAULT +#define VXWORKS_DWARF_VERSION_DEFAULT (TARGET_VXWORKS7 ? 4 : 2) + +#undef DWARF_GNAT_ENCODINGS_DEFAULT +#define DWARF_GNAT_ENCODINGS_DEFAULT \ + (TARGET_VXWORKS7 ? DWARF_GNAT_ENCODINGS_MINIMAL : DWARF_GNAT_ENCODINGS_ALL) diff --git a/gcc/config/vxworksae.h b/gcc/config/vxworksae.h index 3b0b6529b8a..8caa7ddaf96 100644 --- a/gcc/config/vxworksae.h +++ b/gcc/config/vxworksae.h @@ -75,3 +75,12 @@ along with GCC; see the file COPYING3. If not see #undef VXWORKS_OVERRIDE_OPTIONS #define VXWORKS_OVERRIDE_OPTIONS vxworks_override_options () extern void vxworks_override_options (void); + +/* Default dwarf control values, for non-gdb debuggers that come with + VxWorks. */ + +#undef VXWORKS_DWARF_VERSION_DEFAULT +#define VXWORKS_DWARF_VERSION_DEFAULT 2 + +#undef DWARF_GNAT_ENCODINGS_DEFAULT +#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_ALL -- 2.30.2