aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2019-11-26 12:12:04 -0500
committerSimon Marchi <simon.marchi@efficios.com>2019-11-26 14:29:21 -0500
commitcadc9cb88871b636a967b98a2ba86c30a759f544 (patch)
treedb99aca790dce59500bf5c49dc79df8584bb0632
parentd04afd58be9a490ab5ff0ea5ee6020f3d2781002 (diff)
downloadgdb-cadc9cb88871b636a967b98a2ba86c30a759f544.zip
gdb-cadc9cb88871b636a967b98a2ba86c30a759f544.tar.gz
gdb-cadc9cb88871b636a967b98a2ba86c30a759f544.tar.bz2
Fix declaration of sparc_xfer_wcookie
When building sparc-nat.c with -Wmissing-declarations, we get: CXX sparc-nat.o /home/smarchi/src/binutils-gdb/gdb/sparc-nat.c: In function ‘target_xfer_status sparc_xfer_wcookie(target_ops*, target_object, const char*, gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)’: /home/smarchi/src/binutils-gdb/gdb/sparc-nat.c:255:1: error: no previous declaration for ‘target_xfer_status sparc_xfer_wcookie(target_ops*, target_object, const char*, gdb_byte*, const gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)’ [-Werror=missing-declarations] sparc_xfer_wcookie (struct target_ops *ops, enum target_object object, ^~~~~~~~~~~~~~~~~~ Indeed, the declaration is not in sync with the definition, fix that. sparc_xfer_wcookie is used in sparc_target::xfer_partial. sparc_target is only used in the BSD sparc native files. The error above was obtained by running "make sparc-nat.o" on Linux with a cross-compiler for sparc64-linux-gnu. But I presume that if we were to build for real with a BSD/sparc compiler, we would end up with an undefined symbol. gdb/ChangeLog: * sparc-nat.c (sparc_xfer_wcookie): Sync declaration with definition. Change-Id: Id41e706e5516968ff6a49469ddc48eceb29dd3ea
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/sparc-nat.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ad0f981..79c09f9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2019-11-26 Simon Marchi <simon.marchi@efficios.com>
+ * sparc-nat.c (sparc_xfer_wcookie): Sync declaration with
+ definition.
+
+2019-11-26 Simon Marchi <simon.marchi@efficios.com>
+
* remote-sim.c (simulator_command): Make static, remove
declaration.
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 0905c57..9b76913 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -252,7 +252,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum)
TARGET_OBJECT_WCOOKIE. Fetch StackGhost Per-Process XOR cookie. */
enum target_xfer_status
-sparc_xfer_wcookie (struct target_ops *ops, enum target_object object,
+sparc_xfer_wcookie (enum target_object object,
const char *annex, gdb_byte *readbuf,
const gdb_byte *writebuf, ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len)