Move producer_is_realview to producer.c
This moves the producer_is_realview to producer.c.
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
index 17f3932..c11e45b 100644
--- a/gdb/dwarf2/frame.c
+++ b/gdb/dwarf2/frame.c
@@ -32,6 +32,7 @@
#include "value.h"
#include "record.h"
#include "extract-store-integer.h"
+#include "producer.h"
#include "complaints.h"
#include "dwarf2/frame.h"
diff --git a/gdb/producer.c b/gdb/producer.c
index 2ca701f..ad3a354 100644
--- a/gdb/producer.c
+++ b/gdb/producer.c
@@ -195,6 +195,30 @@ producer_is_clang (const char *producer, int *major, int *minor)
return false;
}
+/* See producer.h. */
+
+bool
+producer_is_realview (const char *producer)
+{
+ static const char *const arm_idents[] = {
+ "ARM C Compiler, ADS",
+ "Thumb C Compiler, ADS",
+ "ARM C++ Compiler, ADS",
+ "Thumb C++ Compiler, ADS",
+ "ARM/Thumb C/C++ Compiler, RVCT",
+ "ARM C/C++ Compiler, RVCT"
+ };
+
+ if (producer == NULL)
+ return false;
+
+ for (const char *ident : arm_idents)
+ if (startswith (producer, ident))
+ return true;
+
+ return false;
+}
+
#if defined GDB_SELF_TEST
namespace selftests {
namespace producer {
diff --git a/gdb/producer.h b/gdb/producer.h
index 5cdb7ee..1f85bda 100644
--- a/gdb/producer.h
+++ b/gdb/producer.h
@@ -50,4 +50,8 @@ extern bool producer_is_llvm (const char *producer);
Sets MAJOR and MINOR accordingly, if not NULL. */
extern bool producer_is_clang (const char *producer, int *major, int *minor);
+/* Return true if the supplied producer string matches the ARM
+ RealView compiler (armcc). */
+extern bool producer_is_realview (const char *producer);
+
#endif /* GDB_PRODUCER_H */
diff --git a/gdb/symtab.c b/gdb/symtab.c
index c8bcab7..e6f6a99 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -6636,31 +6636,6 @@ main_language (void)
return info->language_of_main;
}
-/* Return 1 if the supplied producer string matches the ARM RealView
- compiler (armcc). */
-
-bool
-producer_is_realview (const char *producer)
-{
- static const char *const arm_idents[] = {
- "ARM C Compiler, ADS",
- "Thumb C Compiler, ADS",
- "ARM C++ Compiler, ADS",
- "Thumb C++ Compiler, ADS",
- "ARM/Thumb C/C++ Compiler, RVCT",
- "ARM C/C++ Compiler, RVCT"
- };
-
- if (producer == NULL)
- return false;
-
- for (const char *ident : arm_idents)
- if (startswith (producer, ident))
- return true;
-
- return false;
-}
-
/* The next index to hand out in response to a registration request. */
diff --git a/gdb/symtab.h b/gdb/symtab.h
index cd9220c..7927380 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -2750,10 +2750,6 @@ extern struct block_symbol
const char *name,
const domain_search_flags domain);
-/* Return 1 if the supplied producer string matches the ARM RealView
- compiler (armcc). */
-bool producer_is_realview (const char *producer);
-
extern unsigned int symtab_create_debug;
/* Print a "symtab-create" debug statement. */