aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 61c903b..d516a4d 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -719,6 +719,14 @@ ada_value_print_ptr (struct value *val,
struct ui_file *stream, int recurse,
const struct value_print_options *options)
{
+ if (!options->format
+ && TYPE_TARGET_TYPE (value_type (val))->code () == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (value_type (val))) == 0)
+ {
+ fputs_filtered ("null", stream);
+ return;
+ }
+
common_val_print (val, stream, recurse, options, language_def (language_c));
struct type *type = ada_check_typedef (value_type (val));
@@ -1096,8 +1104,11 @@ ada_value_print (struct value *val0, struct ui_file *stream,
struct type *type = ada_check_typedef (value_type (val));
struct value_print_options opts;
- /* If it is a pointer, indicate what it points to. */
- if (type->code () == TYPE_CODE_PTR)
+ /* If it is a pointer, indicate what it points to; but not for
+ "void *" pointers. */
+ if (type->code () == TYPE_CODE_PTR
+ && !(TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_INT
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) == 0))
{
/* Hack: don't print (char *) for char strings. Their
type is indicated by the quoted string anyway. */