This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[pushed 1/2] gdbserver: include linux-arm-tdesc.h in linux-arm-tdesc.c
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Sun, 12 Jan 2020 15:23:00 -0500
- Subject: [pushed 1/2] gdbserver: include linux-arm-tdesc.h in linux-arm-tdesc.c
When building with -Wmissing-declarations, I get:
CXX linux-arm-tdesc.o
/binutils-gdb/gdb/gdbserver/linux-arm-tdesc.c:29:1: error: no previous declaration for 'const target_desc* arm_linux_read_description(arm_fp_type)' [-Werror=missing-declarations]
29 | arm_linux_read_description (arm_fp_type fp_type)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/binutils-gdb/gdb/gdbserver/linux-arm-tdesc.c:49:1: error: no previous declaration for 'arm_fp_type arm_linux_get_tdesc_fp_type(const target_desc*)' [-Werror=missing-declarations]
49 | arm_linux_get_tdesc_fp_type (const target_desc *tdesc)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Include linux-arm-tdesc.h in linux-arm-tdesc.c to fix it. And because
linux-arm-tdesc.h uses the arm_fp_type, it should include arch/arm.h as
well.
gdb/gdbserver/ChangeLog:
* linux-arm-tdesc.c: Include linux-arm-tdesc.h.
* linux-arm-tdesc.h: Include arch/arm.h.
---
gdb/gdbserver/ChangeLog | 5 +++++
gdb/gdbserver/linux-arm-tdesc.c | 3 +++
gdb/gdbserver/linux-arm-tdesc.h | 2 ++
3 files changed, 10 insertions(+)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 83be63c393e8..67d39beba5b8 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-12 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * linux-arm-tdesc.c: Include linux-arm-tdesc.h.
+ * linux-arm-tdesc.h: Include arch/arm.h.
+
2020-01-12 Simon Marchi <simon.marchi@polymtl.ca>
* linux-aarch64-low.c (aarch64_write_goto_address): Make static.
diff --git a/gdb/gdbserver/linux-arm-tdesc.c b/gdb/gdbserver/linux-arm-tdesc.c
index 5af1f90070b8..2c9fac83cd5b 100644
--- a/gdb/gdbserver/linux-arm-tdesc.c
+++ b/gdb/gdbserver/linux-arm-tdesc.c
@@ -16,6 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "server.h"
+
+#include "linux-arm-tdesc.h"
+
#include "tdesc.h"
#include "arch/arm.h"
#include <inttypes.h>
diff --git a/gdb/gdbserver/linux-arm-tdesc.h b/gdb/gdbserver/linux-arm-tdesc.h
index bc782e13320a..5e8c6a3be57a 100644
--- a/gdb/gdbserver/linux-arm-tdesc.h
+++ b/gdb/gdbserver/linux-arm-tdesc.h
@@ -18,6 +18,8 @@
#ifndef GDBSERVER_LINUX_ARM_TDESC_H
#define GDBSERVER_LINUX_ARM_TDESC_H
+#include "arch/arm.h"
+
/* Return the Arm target description with fp registers FP_TYPE. */
const target_desc * arm_linux_read_description (arm_fp_type fp_type);
--
2.24.1