From 6d0cf4464e0477db8c15b00a99df09d84d55cda4 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sun, 16 Feb 2020 21:43:33 +0100 Subject: [PATCH] Fix build with gcc-4.8.x Use an explicit conversion from unique_ptr 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' lvalue to 'std::unique_ptr&&' gdb: 2020-02-18 Bernd Edlinger * 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 | 10 ++++++++++ gdb/aarch64-tdep.c | 3 ++- gdb/amd64-tdep.c | 3 ++- gdb/arm-linux-tdep.c | 3 ++- gdb/i386-tdep.c | 3 ++- gdb/rs6000-tdep.c | 3 ++- gdb/s390-tdep.c | 3 ++- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f5c15bda69..ee7298b687 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2020-02-18 Bernd Edlinger + + * 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 * MAINTAINERS: Change palmer@sifive.com to palmer@dabbelt.com. diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index bfacfb05b2..31b90c89c7 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -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. */ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 9264fe4026..5c56a970d8 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -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 diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index ccb556babb..f60cb51763 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -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 diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 9771421c86..19876c3553 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -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 diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 513ce6a34f..2c41e1c858 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -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 diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 51d0203231..d8c28c72e4 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -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 -- 2.34.1