summaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-07-01 18:27:25 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-07-01 18:27:25 +0000
commit1307076d2bb7313f7791c511b6ee8f781eb92870 (patch)
treea318f4ef50ed55167789f9b1ee6036566a4cda52 /gdb/ada-valprint.c
parent0c9ea96084d9c595cf6b5cdb51ce1bf155cf82fe (diff)
downloadgdb-1307076d2bb7313f7791c511b6ee8f781eb92870.tar.gz
Fix printing address of packed array
When trying to print the address of a non-packed array, GDB correctly prints the type name and address: (gdb) print &var $2 = (access pa.var) 0xbffff1d8 However, it is behaving differently when dealing with a packed array: (gdb) p &var (access array (4 .. 8) of boolean <packed: 1-bit elements>) (4 => false, false, false, true, false) The type description isn't all that bad, but GDB shouldn't be printing the array value! This patch fixes the `print` and `ptype` command on packed and non-packed array. It also fixes a gdb.ada test to match with the new ouput. gdb/ChangeLog (Jean-Charles Delay): * ada-typeprint.c (ada_print_type): Fix both PAD type and pointer to constrained packed array type output. * ada-valprint.c (ada_val_print_1): Fix pointer to constrained packed array output. gdb/testsuite/ChangeLog (Jean-Charles Delay): * gdb.ada/packed_array.exp: Fix expected outout.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index f0901a8c137..7b9e3ee8707 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -682,7 +682,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr,
type = ada_check_typedef (type);
if (ada_is_array_descriptor_type (type)
- || ada_is_constrained_packed_array_type (type))
+ || (ada_is_constrained_packed_array_type (type)
+ && TYPE_CODE (type) != TYPE_CODE_PTR))
{
int retn;
struct value *mark = value_mark ();