diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-06-28 16:59:47 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-06-28 16:59:47 +0000 |
commit | 6036c742216f95a45095562947749755601a61f5 (patch) | |
tree | 0455547cdd233ee4964d6522636feadbc43f6fda /gdb/cp-valprint.c | |
parent | de6a04210ceecbe450212f60129740fc22330050 (diff) | |
download | gdb-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.c | 13 |
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, "{"); |