Fix build with gcc-4.8.x
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 16 Feb 2020 20:43:33 +0000 (21:43 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 18 Feb 2020 21:22:56 +0000 (22:22 +0100)
Use an explicit conversion from unique_ptr<T> to
displaced_step_closure_up to avoid a compiler bug
with gcc-4.8.4:

../../binutils-gdb/gdb/amd64-tdep.c:1514:10: error: cannot bind
   'std::unique_ptr<amd64_displaced_step_closure>' lvalue to
   'std::unique_ptr<amd64_displaced_step_closure>&&'

gdb:
2020-02-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>

* aarch64-tdep.c (aarch64_displaced_step_copy_insn): Use an explicit
conversion.
* amd64-tdep.c (amd64_displaced_step_copy_insn): Likewise.
* arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise.
* i386-tdep.c (i386_displaced_step_copy_insn): Likewise.
* rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise.
* s390-tdep.c (s390_displaced_step_copy_insn): Likewise.

gdb/ChangeLog
gdb/aarch64-tdep.c
gdb/amd64-tdep.c
gdb/arm-linux-tdep.c
gdb/i386-tdep.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c

index f5c15bda697c2c34d6076896fa25c61d7a46f41a..ee7298b68757d7ea153024dbb65509780ee26baf 100644 (file)
@@ -1,3 +1,13 @@
+2020-02-18  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Use an explicit
+       conversion.
+       * amd64-tdep.c (amd64_displaced_step_copy_insn): Likewise.
+       * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn): Likewise.
+       * i386-tdep.c (i386_displaced_step_copy_insn): Likewise.
+       * rs6000-tdep.c (ppc_displaced_step_copy_insn): Likewise.
+       * s390-tdep.c (s390_displaced_step_copy_insn): Likewise.
+
 2020-02-18  Simon Marchi  <simon.marchi@efficios.com>
 
        * MAINTAINERS: Change palmer@sifive.com to palmer@dabbelt.com.
index bfacfb05b213ca6e57a797743234d02406853bd3..31b90c89c7c79a7036ef4662c1333a4e41ea2490 100644 (file)
@@ -3053,7 +3053,8 @@ aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
       dsc = NULL;
     }
 
-  return dsc;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (dsc.release ());
 }
 
 /* Implement the "displaced_step_fixup" gdbarch method.  */
index 9264fe4026d44ec2349f8b5e1c16e0473ddac371..5c56a970d8c457db940a811dd7eddddd59cce242 100644 (file)
@@ -1511,7 +1511,8 @@ amd64_displaced_step_copy_insn (struct gdbarch *gdbarch,
       displaced_step_dump_bytes (gdb_stdlog, buf, len);
     }
 
-  return dsc;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (dsc.release ());
 }
 
 static int
index ccb556babb087c03207488fb1a8c457da5b8d43f..f60cb51763f1c5b14811494b646acf54b62d1f10 100644 (file)
@@ -1131,7 +1131,8 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
 
   arm_displaced_init_closure (gdbarch, from, to, dsc.get ());
 
-  return dsc;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (dsc.release ());
 }
 
 /* Implementation of `gdbarch_stap_is_single_operand', as defined in
index 9771421c86b1ea115a9033fbaf4f3bc42ef06230..19876c35535a07d5a3d2039d2624499a34b927bc 100644 (file)
@@ -831,7 +831,8 @@ i386_displaced_step_copy_insn (struct gdbarch *gdbarch,
       displaced_step_dump_bytes (gdb_stdlog, buf, len);
     }
 
-  return closure;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (closure.release ());
 }
 
 /* Fix up the state of registers and memory after having single-stepped
index 513ce6a34fcb404e2186def8562e4e0fa9ef86ca..2c41e1c858b491137c4c043ecae2674fa31d642f 100644 (file)
@@ -894,7 +894,8 @@ ppc_displaced_step_copy_insn (struct gdbarch *gdbarch,
       displaced_step_dump_bytes (gdb_stdlog, buf, len);
     }
 
-  return closure;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (closure.release ());
 }
 
 /* Fix up the state of registers and memory after having single-stepped
index 51d0203231f5af3db52c6365653128278f5ca6ec..d8c28c72e49c3015eacc2a4be3dacf3d0a70bd46 100644 (file)
@@ -477,7 +477,8 @@ s390_displaced_step_copy_insn (struct gdbarch *gdbarch,
       displaced_step_dump_bytes (gdb_stdlog, buf, len);
     }
 
-  return closure;
+  /* This is a work around for a problem with g++ 4.8.  */
+  return displaced_step_closure_up (closure.release ());
 }
 
 /* Fix up the state of registers and memory after having single-stepped
This page took 0.036412 seconds and 4 git commands to generate.