aboutsummaryrefslogtreecommitdiff
path: root/gdb/producer.h
diff options
context:
space:
mode:
authorWalfred Tedeschi <walfred.tedeschi@intel.com>2017-09-26 18:26:41 +0100
committerPedro Alves <palves@redhat.com>2017-09-26 18:26:41 +0100
commitb32b108aba2c0119d0e231d203d3284539da2379 (patch)
tree9c24604cc4997fcfe86628fb8a701bc8103f9a0f /gdb/producer.h
parent75352e283fb2b265d14c750859156943f6eb2693 (diff)
downloadgdb-b32b108aba2c0119d0e231d203d3284539da2379.zip
gdb-b32b108aba2c0119d0e231d203d3284539da2379.tar.gz
gdb-b32b108aba2c0119d0e231d203d3284539da2379.tar.bz2
Move GDB producer parsing routines to a separate file
gdb/ChangeLog: 2017-09-26 Walfred Tedeschi <walfred.tedeschi@intel.com> * Makefile.in (SFILES): Add producer.c. (COMMON_OBS): Add producer.o * amd64-tdep.c (producer.h): Add new include. * dwarf2read.c (producer.h): Add new include. * producer.c: New file. * producer.h: New file. * utils.c (producer_is_gcc, producer_is_gcc_ge_4): Move to producer.c. * utils.h (producer_is_gcc, producer_is_gcc_ge_4): Move to producer.h.
Diffstat (limited to 'gdb/producer.h')
-rw-r--r--gdb/producer.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/producer.h b/gdb/producer.h
new file mode 100644
index 0000000..143d4e1
--- /dev/null
+++ b/gdb/producer.h
@@ -0,0 +1,33 @@
+/* Producer string parsers for GDB.
+
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef PRODUCER_H
+#define PRODUCER_H
+
+/* Check for GCC >= 4.x according to the symtab->producer string. Return minor
+ version (x) of 4.x in such case. If it is not GCC or it is GCC older than
+ 4.x return -1. If it is GCC 5.x or higher return INT_MAX. */
+extern int producer_is_gcc_ge_4 (const char *producer);
+
+/* Returns nonzero if the given PRODUCER string is GCC and sets the MAJOR
+ and MINOR versions when not NULL. Returns zero if the given PRODUCER
+ is NULL or it isn't GCC. */
+extern int producer_is_gcc (const char *producer, int *major, int *minor);
+
+#endif