diff options
author | Tom Tromey <tom@tromey.com> | 2025-01-31 11:28:48 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-02-19 17:57:15 -0700 |
commit | 2e8e54fc54c196f49f4b975dc88997b79bae92e9 (patch) | |
tree | 2b1f3a39a2a223a550ce653f2b3c217fc9cd4c38 /gdb | |
parent | e17e25351f1248cd791f54d17db6f81000301bec (diff) | |
download | binutils-2e8e54fc54c196f49f4b975dc88997b79bae92e9.zip binutils-2e8e54fc54c196f49f4b975dc88997b79bae92e9.tar.gz binutils-2e8e54fc54c196f49f4b975dc88997b79bae92e9.tar.bz2 |
Move producer_is_realview to producer.c
This moves the producer_is_realview to producer.c.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/dwarf2/frame.c | 1 | ||||
-rw-r--r-- | gdb/producer.c | 24 | ||||
-rw-r--r-- | gdb/producer.h | 4 | ||||
-rw-r--r-- | gdb/symtab.c | 25 | ||||
-rw-r--r-- | gdb/symtab.h | 4 |
5 files changed, 29 insertions, 29 deletions
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. */ |