diff options
author | Joel Brobecker <brobecker@gnat.com> | 2010-12-29 08:01:32 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2010-12-29 08:01:32 +0000 |
commit | 720d1a4025df48e7f8fd6426e4f518c02ad3208a (patch) | |
tree | 8f72a5bc2284a330fba516511759384738a7cd94 /gdb/testsuite | |
parent | 113a6f1ec903a7b627723d2c913d75c3a37e421c (diff) | |
download | gdb-720d1a4025df48e7f8fd6426e4f518c02ad3208a.zip gdb-720d1a4025df48e7f8fd6426e4f518c02ad3208a.tar.gz gdb-720d1a4025df48e7f8fd6426e4f518c02ad3208a.tar.bz2 |
[Ada] do not print arrays as array pointers
This patch enhances the debugger to distinguish between fat pointers
that represent either: array types, or array access types. In the latter
case, the object/type is encoded as a typedef type pointing to the fat
pointer.
The first part of the change is to adjust ada_check_typedef to avoid
stripping the typedef layer when it points to a fat pointer. The rest
of the patch is adjustments required in various places to deal with
the fact that the type is uses might now be a typedef.
gdb/ChangeLog:
* ada-lang.h (ada_coerce_to_simple_array): Add declaration.
* ada-lang.c (ada_typedef_target_type): New function.
(desc_base_type): Add handling of fat pointer typedefs.
(ada_coerce_to_simple_array): Make non-static.
(decode_packed_array_bitsize): Add handling of fat pointer typedefs.
Add assertion.
(ada_template_to_fixed_record_type_1, ada_to_fixed_type)
(ada_check_typedef): Add handling of fat pointer typedefs.
(ada_evaluate_subexp) [OP_FUNCALL]: Likewise.
* ada-typeprint.c (ada_print_type): Add handling of fat pointer
typedefs.
* ada-valprint.c (ada_val_print_1): Convert fat pointers that are not
array accesses to simple arrays rather than simple array pointers.
(ada_value_print): In the case of array descriptors, do not print
the value type description unless it is an array access.
gdb/testsuite/ChangeLog:
* gdb.ada/lang_switch.exp: Correct expected parameter value.
gdb/doc/ChangeLog:
* gdb.texinfo (Ada Glitches): Remove paragraph describing the
occasional case where the debugger prints an array address
instead of the array itself.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.ada/lang_switch.exp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 02a92a9..5124dbb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-12-29 Joel Brobecker <brobecker@adacore.com> + + * gdb.ada/lang_switch.exp: Correct expected parameter value. + 2010-12-25 Andreas Schwab <schwab@linux-m68k.org> * gdb.threads/tls.exp: Fix typo. diff --git a/gdb/testsuite/gdb.ada/lang_switch.exp b/gdb/testsuite/gdb.ada/lang_switch.exp index b5bf7dd..87f9921 100644 --- a/gdb/testsuite/gdb.ada/lang_switch.exp +++ b/gdb/testsuite/gdb.ada/lang_switch.exp @@ -46,7 +46,7 @@ gdb_test_no_output "set print frame-arguments all" # Make sure that the language is switched to Ada for the second frame # by checking the string parameter. gdb_test "bt" \ - ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=$hex\\).*" \ + ".*#1.*lang_switch\\.ada_procedure\\s*\\(msg=\"msg\"\\).*" \ "backtrace" # Now, make sure that the language doesn't get automatically switched |