diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-06-28 16:59:43 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-06-28 16:59:43 +0000 |
commit | 47c8c764a9be6d023eca450336e6d9de16970fc0 (patch) | |
tree | d0027bddadb9d6168dfe77701255d4b8d8edc4a2 /gdb/cp-valprint.c | |
parent | 1969a57f58c998bfbb06f08ce7bc1717178b6f54 (diff) | |
download | gdb-47c8c764a9be6d023eca450336e6d9de16970fc0.tar.gz |
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.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 57b8dab7027..5f47ec4d910 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, "{"); |