aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-tdep.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2020-12-02 11:29:30 -0300
committerLuis Machado <luis.machado@linaro.org>2020-12-04 11:17:00 -0300
commit5382f97180f5be551868449e411a4daaebf232fb (patch)
tree8cc4c6f8a8d23877ce212441c8946122c829c630 /gdb/aarch64-tdep.c
parent67748e0f666f0645d7f182e1365f4d9859e55f1d (diff)
downloadgdb-5382f97180f5be551868449e411a4daaebf232fb.zip
gdb-5382f97180f5be551868449e411a4daaebf232fb.tar.gz
gdb-5382f97180f5be551868449e411a4daaebf232fb.tar.bz2
Fix shifting of negative value
When UBSan is enabled, I noticed runtime errors complaining of shifting of negative numbers. This patch fixes this by reusing existing macros from the ARM port. It also removes unused macros from AArch64's port. gdb/ChangeLog: 2020-12-04 Luis Machado <luis.machado@linaro.org> * aarch64-tdep.c (submask, bit, bits): Remove. * arch/aarch64-insn.c (extract_signed_bitfield): Remove. (aarch64_decode_adr, aarch64_decode_b aarch64_decode_bcond) (aarch64_decode_cb, aarch64_decode_tb) (aarch64_decode_ldr_literal): Use sbits to extract a signed immediate. * arch/aarch64-insn.h (submask, bits, bit, sbits): New macros.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r--gdb/aarch64-tdep.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 2c1d888..680b53f 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -53,10 +53,6 @@
#include "opcode/aarch64.h"
#include <algorithm>
-#define submask(x) ((1L << ((x) + 1)) - 1)
-#define bit(obj,st) (((obj) >> (st)) & 1)
-#define bits(obj,st,fn) (((obj) >> (st)) & submask ((fn) - (st)))
-
/* A Homogeneous Floating-Point or Short-Vector Aggregate may have at most
four members. */
#define HA_MAX_NUM_FLDS 4