aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-valprint.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-06-28 16:59:47 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-06-28 16:59:47 +0000
commit6036c742216f95a45095562947749755601a61f5 (patch)
tree0455547cdd233ee4964d6522636feadbc43f6fda /gdb/cp-valprint.c
parentde6a04210ceecbe450212f60129740fc22330050 (diff)
downloadgdb-6036c742216f95a45095562947749755601a61f5.zip
gdb-6036c742216f95a45095562947749755601a61f5.tar.gz
gdb-6036c742216f95a45095562947749755601a61f5.tar.bz2
gdb/
* cp-valprint.c (cp_print_value_fields) <recurse == 0>: Call obstack_begin after each obstack_free. gdb/testsuite/ * gdb.cp/static-print-quit.exp, gdb.cp/static-print-quit.cc: New.
Diffstat (limited to 'gdb/cp-valprint.c')
-rw-r--r--gdb/cp-valprint.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index 57b8dab..5f47ec4 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -164,10 +164,19 @@ cp_print_value_fields (struct type *type, struct type *real_type,
if (recurse == 0)
{
+ /* Any object can be left on obstacks only during an unexpected error. */
+
if (obstack_object_size (&dont_print_statmem_obstack) > 0)
- obstack_free (&dont_print_statmem_obstack, NULL);
+ {
+ obstack_free (&dont_print_statmem_obstack, NULL);
+ obstack_begin (&dont_print_statmem_obstack, 32 * sizeof (CORE_ADDR));
+ }
if (obstack_object_size (&dont_print_stat_array_obstack) > 0)
- obstack_free (&dont_print_stat_array_obstack, NULL);
+ {
+ obstack_free (&dont_print_stat_array_obstack, NULL);
+ obstack_begin (&dont_print_stat_array_obstack,
+ 32 * sizeof (struct type *));
+ }
}
fprintf_filtered (stream, "{");