diff options
-rw-r--r-- | bfd/version.h | 2 | ||||
-rw-r--r-- | gdb/progspace.c | 8 | ||||
-rw-r--r-- | gdb/riscv-tdep.c | 13 | ||||
-rw-r--r-- | gdb/testsuite/Makefile.in | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-missing-objfile.exp | 10 | ||||
-rw-r--r-- | opcodes/riscv-opc.c | 16 |
6 files changed, 34 insertions, 20 deletions
diff --git a/bfd/version.h b/bfd/version.h index 2e4741a..053a6d6 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20250429 +#define BFD_VERSION_DATE 20250501 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/progspace.c b/gdb/progspace.c index 569dfc8..eda6379 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -202,12 +202,14 @@ program_space::exec_close () if (ebfd != nullptr) { /* Removing target sections may close the exec_ops target. - Clear ebfd before doing so to prevent recursion. */ - bfd *saved_ebfd = ebfd.get (); + Clear ebfd before doing so to prevent recursion. We + move it to another ref_ptr instead of saving it to a raw + pointer to avoid it looking like possible use-after-free. */ + gdb_bfd_ref_ptr saved_ebfd = std::move (ebfd); ebfd.reset (nullptr); ebfd_mtime = 0; - remove_target_sections (saved_ebfd); + remove_target_sections (saved_ebfd.get ()); m_exec_filename.reset (); } diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index a735c09..8998a29 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -4884,7 +4884,7 @@ try_read (struct regcache *regcache, int regnum, ULONGEST &addr) if (regcache->raw_read (regnum, &addr) != register_status::REG_VALID) { - warning (_("Can not read at address %lx"), addr); + warning (_("Can not read at address %s"), hex_string (addr)); return false; } return true; @@ -5270,8 +5270,8 @@ private: || try_save_pc_rd_mem (ival, regcache)) return !has_error (); - warning (_("Currently this instruction with len 4(%lx) is unsupported"), - ival); + warning (_("Currently this instruction with len 4(%s) is unsupported"), + hex_string (ival)); return false; } @@ -5380,8 +5380,8 @@ private: || !save_mem (addr + offset, 4) || set_ordinary_record_type ()); } - warning (_("Currently this instruction with len 2(%lx) is unsupported"), - ival); + warning (_("Currently this instruction with len 2(%s) is unsupported"), + hex_string (ival)); return false; } @@ -5415,7 +5415,8 @@ public: are not defined yet, so just ignore it. */ gdb_assert (m_length > 0 && m_length % 2 == 0); - warning (_("Can not record unknown instruction (opcode = %lx)"), ival); + warning (_("Can not record unknown instruction (opcode = %s)"), + hex_string (ival)); return false; } diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 0d5ad90..4a6665d 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -440,14 +440,15 @@ expect-read1 expect-readmore: # function, making it read one byte at a time. Running the testsuite # with this catches racy tests. read1.so: lib/read1.c - $(ECHO_CC) $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC $(CFLAGS) + $(ECHO_CC) $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC \ + $(filter-out -fsanitize=%,$(CFLAGS)) # Build the readmore.so preload library. This overrides the `read' # function, making it try harder to read more at a time. Running the # testsuite with this catches racy tests. readmore.so: lib/read1.c $(ECHO_CC) $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC \ - $(CFLAGS) -DREADMORE + $(filter-out -fsanitize=%,$(CFLAGS)) -DREADMORE # Build the read1 machinery. .PHONY: read1 readmore diff --git a/gdb/testsuite/gdb.python/py-missing-objfile.exp b/gdb/testsuite/gdb.python/py-missing-objfile.exp index e4a1b3f..29bc555 100644 --- a/gdb/testsuite/gdb.python/py-missing-objfile.exp +++ b/gdb/testsuite/gdb.python/py-missing-objfile.exp @@ -79,6 +79,16 @@ proc setup_debugdir { dirname files } { # executable (when EXEC_LOADED is true) and/or the library (when LIB_LOADED # is true). proc check_loaded_debug { exec_loaded lib_loaded } { + set re_warn \ + [string_to_regexp \ + "Warning: the current language does not match this frame."] + set cmd "set lang c" + gdb_test_multiple $cmd "" { + -re -wrap "${cmd}(\r\n$re_warn)?" { + pass $gdb_test_name + } + } + if { $exec_loaded } { gdb_test "whatis global_exec_var" "^type = volatile struct exec_type" diff --git a/opcodes/riscv-opc.c b/opcodes/riscv-opc.c index e07f72b..6f49fdb 100644 --- a/opcodes/riscv-opc.c +++ b/opcodes/riscv-opc.c @@ -907,8 +907,8 @@ const struct riscv_opcode riscv_opcodes[] = {"feq.h", 0, INSN_CLASS_ZFH_INX, "d,S,T", MATCH_FEQ_H, MASK_FEQ_H, match_opcode, 0 }, {"flt.h", 0, INSN_CLASS_ZFH_INX, "d,S,T", MATCH_FLT_H, MASK_FLT_H, match_opcode, 0 }, {"fle.h", 0, INSN_CLASS_ZFH_INX, "d,S,T", MATCH_FLE_H, MASK_FLE_H, match_opcode, 0 }, -{"fgt.h", 0, INSN_CLASS_ZFH_INX, "d,T,S", MATCH_FLT_H, MASK_FLT_H, match_opcode, 0 }, -{"fge.h", 0, INSN_CLASS_ZFH_INX, "d,T,S", MATCH_FLE_H, MASK_FLE_H, match_opcode, 0 }, +{"fgt.h", 0, INSN_CLASS_ZFH_INX, "d,T,S", MATCH_FLT_H, MASK_FLT_H, match_opcode, INSN_ALIAS }, +{"fge.h", 0, INSN_CLASS_ZFH_INX, "d,T,S", MATCH_FLE_H, MASK_FLE_H, match_opcode, INSN_ALIAS }, {"fcvt.l.h", 64, INSN_CLASS_ZFH_INX, "d,S", MATCH_FCVT_L_H|MASK_RM, MASK_FCVT_L_H|MASK_RM, match_opcode, 0 }, {"fcvt.l.h", 64, INSN_CLASS_ZFH_INX, "d,S,m", MATCH_FCVT_L_H, MASK_FCVT_L_H, match_opcode, 0 }, {"fcvt.lu.h", 64, INSN_CLASS_ZFH_INX, "d,S", MATCH_FCVT_LU_H|MASK_RM, MASK_FCVT_LU_H|MASK_RM, match_opcode, 0 }, @@ -990,8 +990,8 @@ const struct riscv_opcode riscv_opcodes[] = {"feq.s", 0, INSN_CLASS_F_INX, "d,S,T", MATCH_FEQ_S, MASK_FEQ_S, match_opcode, 0 }, {"flt.s", 0, INSN_CLASS_F_INX, "d,S,T", MATCH_FLT_S, MASK_FLT_S, match_opcode, 0 }, {"fle.s", 0, INSN_CLASS_F_INX, "d,S,T", MATCH_FLE_S, MASK_FLE_S, match_opcode, 0 }, -{"fgt.s", 0, INSN_CLASS_F_INX, "d,T,S", MATCH_FLT_S, MASK_FLT_S, match_opcode, 0 }, -{"fge.s", 0, INSN_CLASS_F_INX, "d,T,S", MATCH_FLE_S, MASK_FLE_S, match_opcode, 0 }, +{"fgt.s", 0, INSN_CLASS_F_INX, "d,T,S", MATCH_FLT_S, MASK_FLT_S, match_opcode, INSN_ALIAS }, +{"fge.s", 0, INSN_CLASS_F_INX, "d,T,S", MATCH_FLE_S, MASK_FLE_S, match_opcode, INSN_ALIAS }, {"fcvt.l.s", 64, INSN_CLASS_F_INX, "d,S", MATCH_FCVT_L_S|MASK_RM, MASK_FCVT_L_S|MASK_RM, match_opcode, 0 }, {"fcvt.l.s", 64, INSN_CLASS_F_INX, "d,S,m", MATCH_FCVT_L_S, MASK_FCVT_L_S, match_opcode, 0 }, {"fcvt.lu.s", 64, INSN_CLASS_F_INX, "d,S", MATCH_FCVT_LU_S|MASK_RM, MASK_FCVT_LU_S|MASK_RM, match_opcode, 0 }, @@ -1049,8 +1049,8 @@ const struct riscv_opcode riscv_opcodes[] = {"feq.d", 0, INSN_CLASS_D_INX, "d,S,T", MATCH_FEQ_D, MASK_FEQ_D, match_opcode, 0 }, {"flt.d", 0, INSN_CLASS_D_INX, "d,S,T", MATCH_FLT_D, MASK_FLT_D, match_opcode, 0 }, {"fle.d", 0, INSN_CLASS_D_INX, "d,S,T", MATCH_FLE_D, MASK_FLE_D, match_opcode, 0 }, -{"fgt.d", 0, INSN_CLASS_D_INX, "d,T,S", MATCH_FLT_D, MASK_FLT_D, match_opcode, 0 }, -{"fge.d", 0, INSN_CLASS_D_INX, "d,T,S", MATCH_FLE_D, MASK_FLE_D, match_opcode, 0 }, +{"fgt.d", 0, INSN_CLASS_D_INX, "d,T,S", MATCH_FLT_D, MASK_FLT_D, match_opcode, INSN_ALIAS }, +{"fge.d", 0, INSN_CLASS_D_INX, "d,T,S", MATCH_FLE_D, MASK_FLE_D, match_opcode, INSN_ALIAS }, {"fmv.x.d", 64, INSN_CLASS_D, "d,S", MATCH_FMV_X_D, MASK_FMV_X_D, match_opcode, 0 }, {"fmv.d.x", 64, INSN_CLASS_D, "D,s", MATCH_FMV_D_X, MASK_FMV_D_X, match_opcode, 0 }, {"fcvt.l.d", 64, INSN_CLASS_D_INX, "d,S", MATCH_FCVT_L_D|MASK_RM, MASK_FCVT_L_D|MASK_RM, match_opcode, 0 }, @@ -1109,8 +1109,8 @@ const struct riscv_opcode riscv_opcodes[] = {"feq.q", 0, INSN_CLASS_Q_INX, "d,S,T", MATCH_FEQ_Q, MASK_FEQ_Q, match_opcode, 0 }, {"flt.q", 0, INSN_CLASS_Q_INX, "d,S,T", MATCH_FLT_Q, MASK_FLT_Q, match_opcode, 0 }, {"fle.q", 0, INSN_CLASS_Q_INX, "d,S,T", MATCH_FLE_Q, MASK_FLE_Q, match_opcode, 0 }, -{"fgt.q", 0, INSN_CLASS_Q_INX, "d,T,S", MATCH_FLT_Q, MASK_FLT_Q, match_opcode, 0 }, -{"fge.q", 0, INSN_CLASS_Q_INX, "d,T,S", MATCH_FLE_Q, MASK_FLE_Q, match_opcode, 0 }, +{"fgt.q", 0, INSN_CLASS_Q_INX, "d,T,S", MATCH_FLT_Q, MASK_FLT_Q, match_opcode, INSN_ALIAS }, +{"fge.q", 0, INSN_CLASS_Q_INX, "d,T,S", MATCH_FLE_Q, MASK_FLE_Q, match_opcode, INSN_ALIAS }, {"fcvt.l.q", 64, INSN_CLASS_Q_INX, "d,S", MATCH_FCVT_L_Q|MASK_RM, MASK_FCVT_L_Q|MASK_RM, match_opcode, 0 }, {"fcvt.l.q", 64, INSN_CLASS_Q_INX, "d,S,m", MATCH_FCVT_L_Q, MASK_FCVT_L_Q, match_opcode, 0 }, {"fcvt.lu.q", 64, INSN_CLASS_Q_INX, "d,S", MATCH_FCVT_LU_Q|MASK_RM, MASK_FCVT_LU_Q|MASK_RM, match_opcode, 0 }, |