aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-16 01:27:02 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-16 01:27:02 +0000
commitad3bbd48b65047845b258564db3fd2e64e00c7bc (patch)
tree6fa1e4fcc2207b1528a33e4097c13526e75db941 /gdb/p-valprint.c
parent5cc80db34dcbe944fe7b480c9841f309c0cf6e96 (diff)
downloadgdb-ad3bbd48b65047845b258564db3fd2e64e00c7bc.zip
gdb-ad3bbd48b65047845b258564db3fd2e64e00c7bc.tar.gz
gdb-ad3bbd48b65047845b258564db3fd2e64e00c7bc.tar.bz2
2010-05-15 Michael Snyder <msnyder@vmware.com>
* parse.c: White space. * p-lang.c: White space. * posix-hdep.c: White space. * printcmd.c: White space. * progspace.c: White space. * prologue-value.c: White space. * psymtab.c: White space. * p-typeprint.c: White space. * p-valprint.c: White space.
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r--gdb/p-valprint.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 98908af..78cba98 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -194,6 +194,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
{
ULONGEST string_length;
void *buffer;
+
buffer = xmalloc (length_size);
read_memory (addr + length_pos, buffer, length_size);
string_length = extract_unsigned_integer (buffer, length_size,
@@ -205,9 +206,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
{
/* print vtbl's nicely */
CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset);
-
struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (vt_address);
+ lookup_minimal_symbol_by_pc (vt_address);
+
if ((msymbol != NULL)
&& (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
{
@@ -259,6 +260,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
@@ -270,9 +272,10 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (type, valaddr + embedded_offset));
+ value_at
+ (TYPE_TARGET_TYPE (type),
+ unpack_pointer (type, valaddr + embedded_offset));
+
common_val_print (deref_val, stream, recurse + 1, options,
current_language);
}
@@ -372,6 +375,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
@@ -406,6 +410,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
@@ -421,6 +426,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
@@ -484,6 +490,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
for (i = low_bound; i <= high_bound; i++)
{
int element = value_bit_index (type, valaddr + embedded_offset, i);
+
if (element < 0)
{
i = element;
@@ -501,6 +508,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
if (i + 1 <= high_bound && value_bit_index (type, valaddr + embedded_offset, ++i))
{
int j = i;
+
fputs_filtered ("..", stream);
while (i + 1 <= high_bound
&& value_bit_index (type, valaddr + embedded_offset, ++i))
@@ -760,6 +768,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
else
{
struct value_print_options opts = *options;
+
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
@@ -778,6 +787,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
{
/* struct value *v = value_static_field (type, i); v4.17 specific */
struct value *v;
+
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
@@ -790,6 +800,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
else
{
struct value_print_options opts = *options;
+
opts.deref_ref = 0;
/* val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
@@ -833,7 +844,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
struct type **dont_print_vb)
{
struct type **last_dont_print
- = (struct type **) obstack_next_free (&dont_print_vb_obstack);
+ = (struct type **) obstack_next_free (&dont_print_vb_obstack);
struct obstack tmp_obstack = dont_print_vb_obstack;
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
@@ -856,10 +867,10 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
if (BASETYPE_VIA_VIRTUAL (type, i))
{
struct type **first_dont_print
- = (struct type **) obstack_base (&dont_print_vb_obstack);
+ = (struct type **) obstack_base (&dont_print_vb_obstack);
int j = (struct type **) obstack_next_free (&dont_print_vb_obstack)
- - first_dont_print;
+ - first_dont_print;
while (--j >= 0)
if (baseclass == first_dont_print[j])
@@ -890,6 +901,7 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
{
/* FIXME (alloc): not safe is baseclass is really really big. */
gdb_byte *buf = alloca (TYPE_LENGTH (baseclass));
+
base_valaddr = buf;
if (target_read_memory (address + boffset, buf,
TYPE_LENGTH (baseclass)) != 0)