aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@linaro.org>2021-12-30 10:45:11 -0300
committerLuis Machado <luis.machado@linaro.org>2022-01-14 11:30:25 -0300
commit2cf167f926836d7e40931e064ed4441208b7b38f (patch)
treea2c8ed6467640aba65721bed94cb98126d4605e8
parentc9a3a5c7042c1301e17aa0e6e401af76db9132b1 (diff)
downloadgdb-2cf167f926836d7e40931e064ed4441208b7b38f.zip
gdb-2cf167f926836d7e40931e064ed4441208b7b38f.tar.gz
gdb-2cf167f926836d7e40931e064ed4441208b7b38f.tar.bz2
Preserve tag when passing pointers/capabilities as parameters
Fix a bug where Morello GDB wasn't setting the capability tag when calling a function by hand, and said function received a pointer/capability as parameter. This was observed when attempting to call strlen by hand and passing the argv[] entries.
-rw-r--r--gdb/aarch64-tdep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 5371cb7..587ccf5 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2086,7 +2086,8 @@ pass_in_c (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the argument to the capability register. */
regcache->raw_write (regnum, tmpbuf);
- if (type->contains_capability ())
+ if (type->contains_capability () || type->code () == TYPE_CODE_CAPABILITY
+ || TYPE_CAPABILITY (type))
{
/* We need to read the tags from memory. */
gdb::byte_vector cap = target_read_capability (address);