aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-02-28 17:00:49 +0000
committerDaniel Jacobowitz <drow@false.org>2005-02-28 17:00:49 +0000
commit806048c68af789ffb76e44fca706a7915cfdb9aa (patch)
tree83e67e751bcf78f68476c295d662f947d514b9f9 /gdb/p-valprint.c
parentf67e617a26e6d1efafb752d5047b4ddc33056ab1 (diff)
downloadgdb-806048c68af789ffb76e44fca706a7915cfdb9aa.zip
gdb-806048c68af789ffb76e44fca706a7915cfdb9aa.tar.gz
gdb-806048c68af789ffb76e44fca706a7915cfdb9aa.tar.bz2
* dwarf2loc.c (loclist_read_variable): Set optimized_out
instead of reporting an error. * valprint.c (value_check_printable): New function. (common_val_print): New function. Use value_check_printable. (value_print): Use value_check_printable. * value.h (common_val_print): Add prototype. * c-valprint.c (c_val_print): Use common_val_print. * cp-valprint.c (cp_print_value_fields): Likewise. (cp_print_hpacc_virtual_table_entries): Likewise. * f-valprint.c (f_val_print): Likewise. * jv-valprint.c (java_value_print, java_print_value_fields): Likewise. * scm-valprint.c (scm_value_print): Likewise. * stack.c (print_frame_args): Likewise. * varobj.c (c_value_of_variable): Likewise. * p-valprint.c (pascal_val_print, pascal_value_print): Likewise. (pascal_object_print_value_fields): Likewise. Update call to pascal_object_print_static_field. (pascal_object_print_static_field): Remove TYPE argument. Use common_val_print.
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r--gdb/p-valprint.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 46e40e0..e2105eb 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -240,9 +240,8 @@ pascal_val_print (struct type *type, const bfd_byte *valaddr,
wtype = TYPE_TARGET_TYPE (type);
}
vt_val = value_at (wtype, vt_address);
- val_print (value_type (vt_val), value_contents (vt_val), 0,
- VALUE_ADDRESS (vt_val), stream, format,
- deref_ref, recurse + 1, pretty);
+ common_val_print (vt_val, stream, format, deref_ref,
+ recurse + 1, pretty);
if (pretty)
{
fprintf_filtered (stream, "\n");
@@ -292,10 +291,8 @@ pascal_val_print (struct type *type, const bfd_byte *valaddr,
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
valaddr + embedded_offset));
- val_print (value_type (deref_val),
- value_contents (deref_val), 0,
- VALUE_ADDRESS (deref_val), stream, format,
- deref_ref, recurse + 1, pretty);
+ common_val_print (deref_val, stream, format, deref_ref,
+ recurse + 1, pretty);
}
else
fputs_filtered ("???", stream);
@@ -566,9 +563,7 @@ pascal_value_print (struct value *val, struct ui_file *stream, int format,
fprintf_filtered (stream, ") ");
}
}
- return val_print (type, value_contents (val), value_embedded_offset (val),
- VALUE_ADDRESS (val) + value_offset (val),
- stream, format, 1, 0, pretty);
+ return common_val_print (val, stream, format, 1, 0, pretty);
}
@@ -591,7 +586,7 @@ show_pascal_static_field_print (struct ui_file *file, int from_tty,
static struct obstack dont_print_vb_obstack;
static struct obstack dont_print_statmem_obstack;
-static void pascal_object_print_static_field (struct type *, struct value *,
+static void pascal_object_print_static_field (struct value *,
struct ui_file *, int, int,
enum val_prettyprint);
@@ -854,8 +849,7 @@ pascal_object_print_value_fields (struct type *type, const bfd_byte *valaddr,
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
- val_print (TYPE_FIELD_TYPE (type, i), value_contents (v), 0, 0,
- stream, format, 0, recurse + 1, pretty);
+ common_val_print (v, stream, format, 0, recurse + 1, pretty);
}
}
else
@@ -874,9 +868,8 @@ pascal_object_print_value_fields (struct type *type, const bfd_byte *valaddr,
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
- pascal_object_print_static_field (TYPE_FIELD_TYPE (type, i), v,
- stream, format, recurse + 1,
- pretty);
+ pascal_object_print_static_field (v, stream, format,
+ recurse + 1, pretty);
}
else
{
@@ -1017,14 +1010,16 @@ pascal_object_print_value (struct type *type, const bfd_byte *valaddr,
static member classes in an obstack and refuse to print them more
than once.
- VAL contains the value to print, TYPE, STREAM, RECURSE, and PRETTY
+ VAL contains the value to print, STREAM, RECURSE, and PRETTY
have the same meanings as in c_val_print. */
static void
-pascal_object_print_static_field (struct type *type, struct value *val,
+pascal_object_print_static_field (struct value *val,
struct ui_file *stream, int format,
int recurse, enum val_prettyprint pretty)
{
+ struct type *type = value_type (val);
+
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;
@@ -1053,8 +1048,7 @@ pascal_object_print_static_field (struct type *type, struct value *val,
stream, format, recurse, pretty, NULL, 1);
return;
}
- val_print (type, value_contents (val), 0, VALUE_ADDRESS (val),
- stream, format, 0, recurse, pretty);
+ common_val_print (val, stream, format, 0, recurse, pretty);
}
void