binutils-gdb/include
Victor Do Nascimento 5b1c70bfe0 aarch64: Remove asserts from operand qualifier decoders [PR31595]
Given that the disassembler should never abort when decoding
(potentially random) data, assertion statements in the
`get_*reg_qualifier_from_value' function family prove problematic.

Consider the random 32-bit word W, encoded in a data segment and
encountered on execution of `objdump -D <obj_name>'.

If:

  (W & ~opcode_mask) == valid instruction

Then before `print_insn_aarch64_word' has a chance to report the
instruction as potentially undefined, an attempt will be made to have
the qualifiers for the instruction's register operands (if any)
decoded.  If the relevant bits do not map onto a valid qualifier for
the matched instruction-like word, an abort will be triggered and the
execution of objdump aborted.

As this scenario is perfectly feasible and, in light of the fact that
objdump must successfully decode all sections of a given object file,
it is not appropriate to assert in this family of functions.

Therefore, we add a new pseudo-qualifier `AARCH64_OPND_QLF_ERR' for
handling invalid qualifier-associated values and re-purpose the
assertion conditions in qualifier-retrieving functions to be the
predicate guarding the returning of the calculated qualifier type.
If the predicate fails, we return this new qualifier and allow the
caller to handle the error as appropriate.

As these functions are called either from within
`aarch64_extract_operand' or `do_special_decoding', both of which are
expected to return non-zero values, it suffices that callers return
zero upon encountering `AARCH64_OPND_QLF_ERR'.

Ar present the error presented in the hypothetical scenario has been
encountered in `get_sreg_qualifier_from_value', but the change is made
to the whole family to keep the interface consistent.

Bug: https://sourceware.org/PR31595
2024-04-17 11:18:55 +01:00
..
aout Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
cgen Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
coff riscv64-pei uninitialised data writing relocs 2024-01-25 08:41:14 +10:30
elf RISC-V: Add TLSDESC reloc definitions. 2024-02-29 15:02:49 +08:00
gdb Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
mach-o Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
opcode aarch64: Remove asserts from operand qualifier decoders [PR31595] 2024-04-17 11:18:55 +01:00
sim sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read,write} 2024-01-22 14:22:30 +01:00
som Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
vms Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
alloca-conf.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ansidecl.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
bfdlink.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
binary-io.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
bout.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ChangeLog gdb: ignore -Wregister instead of -Wdeprecated-register 2024-04-07 22:57:39 -04:00
ChangeLog-0415 binutils ChangeLog rotation 2016-01-01 22:59:17 +10:30
ChangeLog-2016 ChangeLog rotation 2017-01-02 13:55:05 +10:30
ChangeLog-2017 ChangeLog rotation 2018-01-03 17:49:42 +10:30
ChangeLog-2018 ChangeLog rotation 2019-01-01 21:25:40 +10:30
ChangeLog-2019 ChangeLog rotation 2020-01-01 18:12:08 +10:30
ChangeLog-2020 ChangeLog rotation 2021-01-01 10:31:02 +10:30
ChangeLog-9103 Add copyright notices 2012-12-10 12:48:03 +00:00
collectorAPI.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
COPYING
COPYING3
ctf-api.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
ctf.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
demangle.h Import gcc commit 65388b28656d65595bdaf191df85af81c35ca63 which adds support for explicit object member function mangling. 2024-01-17 12:06:48 +00:00
diagnostics.h gdb: ignore -Wregister instead of -Wdeprecated-register 2024-04-07 22:57:39 -04:00
dis-asm.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
dwarf2.def Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
dwarf2.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
dyn-string.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
environ.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
fibheap.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
filenames.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
floatformat.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
fnmatch.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
fopen-bin.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
fopen-same.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
fopen-vms.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
gcc-c-fe.def Synchronize GCC compile plugin headers 2024-02-29 15:34:38 -07:00
gcc-c-interface.h Synchronize GCC compile plugin headers 2024-02-29 15:34:38 -07:00
gcc-cp-fe.def Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
gcc-cp-interface.h Synchronize GCC compile plugin headers 2024-02-29 15:34:38 -07:00
gcc-interface.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
getopt.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
hashtab.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
hp-symtab.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
leb128.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libcollector.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libfcollector.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
libiberty.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
longlong.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
lto-symtab.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
MAINTAINERS Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
md5.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
oasys.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
objalloc.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
obstack.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
os9k.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
partition.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
plugin-api.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
safe-ctype.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
sframe-api.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
sframe.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
sha1.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
simple-object.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
sort.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
splay-tree.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
symcat.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
timeval-utils.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
vtv-change-permission.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xregex2.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xregex.h
xtensa-config.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xtensa-dynconfig.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xtensa-isa-internal.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30
xtensa-isa.h Update year range in copyright notice of binutils files 2024-01-04 22:58:12 +10:30