aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/ChangeLog
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-08-29 19:56:25 +0200
committerJoel Brobecker <brobecker@adacore.com>2014-09-10 06:32:00 -0700
commiteb47903935f507a11b6367d4a997b8ac95068c4c (patch)
tree05da6daeb7a4ba032a48b66c123bcc9b4706d421 /gdb/testsuite/ChangeLog
parentdeede10c775af571f72a37efa5b763b45334b19e (diff)
downloadgdb-eb47903935f507a11b6367d4a997b8ac95068c4c.zip
gdb-eb47903935f507a11b6367d4a997b8ac95068c4c.tar.gz
gdb-eb47903935f507a11b6367d4a997b8ac95068c4c.tar.bz2
Ada: Print bounds/length of pointer to array with dynamic bounds
Trying to print the bounds or the length of a pointer to an array whose bounds are dynamic results in the following error: (gdb) p foo.three_ptr.all'first Location address is not set. (gdb) p foo.three_ptr.all'length Location address is not set. This is because, after having dereferenced our array pointer, we use the type of the resulting array value, instead of the enclosing type. The former is the original type where the bounds are unresolved, whereas we need to get the actual array bounds. Similarly, trying to apply those attributes to the array pointer directly (without explicitly dereferencing it with the '.all' operator) yields the same kind of error: (gdb) p foo.three_ptr'first Location address is not set. (gdb) p foo.three_ptr'length Location address is not set. This is caused by the fact that the dereference was done implicitly in this case, and perform at the type level only, which is not sufficient in order to resolve the array type. This patch fixes both issues, thus allowing us to get the expected output: (gdb) p foo.three_ptr.all'first $1 = 1 (gdb) p foo.three_ptr.all'length $2 = 3 (gdb) p foo.three_ptr'first $3 = 1 (gdb) p foo.three_ptr'length $4 = 3 gdb/ChangeLog: * ada-lang.c (ada_array_bound): If ARR is a TYPE_CODE_PTR, dereference it first. Use value_enclosing_type instead of value_type. (ada_array_length): Likewise. gdb/testsuite/ChangeLog: * gdb.dwarf2/dynarr-ptr.exp: Add 'first, 'last and 'length tests.
Diffstat (limited to 'gdb/testsuite/ChangeLog')
-rw-r--r--gdb/testsuite/ChangeLog4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ebb7e6a..66b50a9 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2014-09-10 Joel Brobecker <brobecker@adacore.com>
+ * gdb.dwarf2/dynarr-ptr.exp: Add 'first, 'last and 'length tests.
+
+2014-09-10 Joel Brobecker <brobecker@adacore.com>
+
* gdb.dwarf2/dynarr-ptr.exp: Add subscripting tests.
2014-09-10 Joel Brobecker <brobecker@adacore.com>