On 09/21/2017 05:19 PM, Walfred Tedeschi wrote:
+
+
+
Spurious spaces.
/* Check whether the producer field indicates either of GCC < 4.6, or the
Intel C/C++ compiler, and cache the result in CU. */
@@ -12853,8 +12869,8 @@ check_producer (struct dwarf2_cu *cu)
cu->producer_is_gxx_lt_4_6 = major < 4 || (major == 4 && minor < 6);
cu->producer_is_gcc_lt_4_3 = major < 4 || (major == 4 && minor < 3);
}
- else if (startswith (cu->producer, "Intel(R) C"))
- cu->producer_is_icc = 1;
+ else if (producer_is_icc (cu->producer, &major, &minor))
+ cu->producer_is_icc_lt_14 = major < 14;
Bad formatting.
--- a/gdb/producer.c
+++ b/gdb/producer.c
@@ -22,9 +22,15 @@
#include "defs.h"
#include "dyn-string.h"
#include <ctype.h>
+
#include "common/common-types.h"
#include "common/common-exceptions.h"
#include "common/common-utils.h"
+
+#if defined GDB_SELF_TEST
+#include "selftest.h"
+#endif
+
#include "utils.h"
/* See documentation in the producer.h file. */
@@ -124,3 +130,80 @@ producer_is_icc (const char *producer, int *major, int *minor)
}
return FALSE;
}
+
+#if defined GDB_SELF_TEST
+namespace selftests {
+namespace dwarf2utils {
Stale namespace name.
+
+static void
+dwarf_producer ()
Stale function name.
+
+/* Provide a prototype to silence -Wmissing-prototypes. */
+extern initialize_file_ftype _initialize_dwarf2utils;
John just removed these declarations throughout.
+
+void
+_initialize_dwarf2utils (void)
Stale function name. "(void)" -> "()".
+{
+#if defined GDB_SELF_TEST
+ selftests::register_test ("dwarf-producer", selftests::dwarf2utils::dwarf_producer);
+#endif
+}
Thanks,
Pedro Alves