Fix GDB sparc build
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 14 Jun 2018 01:57:10 +0000 (21:57 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 14 Jun 2018 01:57:55 +0000 (21:57 -0400)
Cross-compiling for sparc64 bumped into a few issues, fixed by this
patch.

1. Include target.h in sparc-nat.h fixes:

/home/emaisin/src/binutils-gdb/gdb/sparc-nat.h:45:8: error: ‘target_xfer_status’ does not name a type
 extern target_xfer_status sparc_xfer_wcookie (enum target_object object,

2. Remove extra semi-colon at sparc64-linux-nat.c:40 fixes:

/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c:41:3: error: expected unqualified-id before ‘{’ token
   { sparc_store_inferior_registers (this, regcache, regnum); }

3. Remove "this" argument fixes:

/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c: In member function ‘virtual void sparc64_linux_nat_target::fetch_registers(regcache*, int)’:
/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c:38:59: error: cannot convert ‘sparc64_linux_nat_target*’ to ‘regcache*’ for argument ‘1’ to ‘void sparc_fetch_inferior_registers(regcache*, int)’
   { sparc_fetch_inferior_registers (this, regcache, regnum); }
                                                           ^
/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c: In member function ‘virtual void sparc64_linux_nat_target::store_registers(regcache*, int)’:
/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c:41:59: error: cannot convert ‘sparc64_linux_nat_target*’ to ‘regcache*’ for argument ‘1’ to ‘void sparc_store_inferior_registers(regcache*, int)’
   { sparc_store_inferior_registers (this, regcache, regnum); }
                                                           ^
4. Use sparc64_forget_process instead of sparc_forget_process fixes:

/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c: In member function ‘virtual void sparc64_linux_nat_target::low_forget_process(pid_t)’:
/home/emaisin/src/binutils-gdb/gdb/sparc64-linux-nat.c:47:30: error: ‘sparc_forget_process’ was not declared in this scope
   { sparc_forget_process (pid); }
                              ^

gdb/ChangeLog:

* sparc-nat.h: Include target.h.
* sparc64-linux-nat.c (class sparc64_linux_nat_target)
<fetch_registers>: Remove this argument in function call.
<store_registers>: Remove this argument in function call, remove
extra semicolon.
<low_forget_process>: Call sparc64_forget_process instead of
sparc_forget_process.

gdb/ChangeLog
gdb/sparc-nat.h
gdb/sparc64-linux-nat.c

index 42995df..0da732a 100644 (file)
@@ -1,3 +1,13 @@
+2018-06-13  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * sparc-nat.h: Include target.h.
+       * sparc64-linux-nat.c (class sparc64_linux_nat_target)
+       <fetch_registers>: Remove this argument in function call.
+       <store_registers>: Remove this argument in function call, remove
+       extra semicolon.
+       <low_forget_process>: Call sparc64_forget_process instead of
+       sparc_forget_process.
+
 2018-06-13  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * procfs.c (_initialize_procfs): Use add_inf_child_target.
index b564c01..6a8b4a0 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef SPARC_NAT_H
 #define SPARC_NAT_H 1
 
+#include "target.h"
+
 struct sparc_gregmap;
 struct sparc_fpregmap;
 
index ba9397e..4a206b4 100644 (file)
@@ -35,16 +35,16 @@ class sparc64_linux_nat_target final : public linux_nat_target
 public:
   /* Add our register access methods.  */
   void fetch_registers (struct regcache *regcache, int regnum) override
-  { sparc_fetch_inferior_registers (this, regcache, regnum); }
+  { sparc_fetch_inferior_registers (regcache, regnum); }
 
-  void store_registers (struct regcache *regcache, int regnum) override;
-  { sparc_store_inferior_registers (this, regcache, regnum); }
+  void store_registers (struct regcache *regcache, int regnum) override
+  { sparc_store_inferior_registers (regcache, regnum); }
 
   /* Override linux_nat_target low methods.  */
 
   /* ADI support */
   void low_forget_process (pid_t pid) override
-  { sparc_forget_process (pid); }
+  { sparc64_forget_process (pid); }
 };
 
 static sparc64_linux_nat_target the_sparc64_linux_nat_target;