aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-valprint.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-02-08 14:20:56 +0000
committerDaniel Jacobowitz <drow@false.org>2007-02-08 14:20:56 +0000
commitc1b6e682ab8a42f040c3a664ad25080779efdf53 (patch)
tree80e882284f4843a61d5e978d02166555f36e30d8 /gdb/p-valprint.c
parentfe5dedf464aa9740b6db25bb69c758021b860199 (diff)
downloadgdb-c1b6e682ab8a42f040c3a664ad25080779efdf53.zip
gdb-c1b6e682ab8a42f040c3a664ad25080779efdf53.tar.gz
gdb-c1b6e682ab8a42f040c3a664ad25080779efdf53.tar.bz2
* cp-valprint.c (cp_print_value_fields, cp_print_value): Always
initialize tmp_obstack. * p-valprint.c (pascal_object_print_value_fields) (pascal_object_print_value): Likewise.
Diffstat (limited to 'gdb/p-valprint.c')
-rw-r--r--gdb/p-valprint.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
index 19556a4..a383371 100644
--- a/gdb/p-valprint.c
+++ b/gdb/p-valprint.c
@@ -641,7 +641,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
int dont_print_statmem)
{
int i, len, n_baseclasses;
- struct obstack tmp_obstack;
char *last_dont_print = obstack_next_free (&dont_print_statmem_obstack);
CHECK_TYPEDEF (type);
@@ -660,6 +659,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
fprintf_filtered (stream, "<No data fields>");
else
{
+ struct obstack tmp_obstack = dont_print_statmem_obstack;
int fields_seen = 0;
if (dont_print_statmem == 0)
@@ -667,7 +667,6 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
/* If we're at top level, carve out a completely fresh
chunk of the obstack and use that until this particular
invocation returns. */
- tmp_obstack = dont_print_statmem_obstack;
obstack_finish (&dont_print_statmem_obstack);
}
@@ -810,9 +809,9 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
enum val_prettyprint pretty,
struct type **dont_print_vb)
{
- struct obstack tmp_obstack;
struct type **last_dont_print
= (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);
if (dont_print_vb == 0)
@@ -820,7 +819,6 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr,
/* If we're at top level, carve out a completely fresh
chunk of the obstack and use that until this particular
invocation returns. */
- tmp_obstack = dont_print_vb_obstack;
/* Bump up the high-water mark. Now alpha is omega. */
obstack_finish (&dont_print_vb_obstack);
}