diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-03-29 17:34:54 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-04-01 10:58:12 -0400 |
commit | 9d1447e09d4aa673826039321163b5a684e8e043 (patch) | |
tree | e9af1807d26dcc67327847c369b9d032afccb102 /gdb/value.h | |
parent | 34ef62f46541d423b991850b2b7ba34d8749a6ba (diff) | |
download | gdb-9d1447e09d4aa673826039321163b5a684e8e043.zip gdb-9d1447e09d4aa673826039321163b5a684e8e043.tar.gz gdb-9d1447e09d4aa673826039321163b5a684e8e043.tar.bz2 |
Destroy allocated values when exiting GDB
When the user exits GDB, we might still have some allocated values in
the chain, which, in specific scenarios, can cause problems when GDB
attempts to destroy them in "quit_force". For example, see the bug
reported at:
https://bugzilla.redhat.com/show_bug.cgi?id=1690120
And the thread starting at:
https://sourceware.org/ml/gdb-patches/2019-03/msg00475.html
Message-ID: <87r2azkhmq.fsf@redhat.com>
In order to avoid that, and to be more aware of our allocated
resources, this commit implements a new function "finalize_values" and
calls it from inside "quit_force".
Tested by the BuildBot.
2019-04-01 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
* top.c (quit_force): Call 'finalize_values'.
* value.c (finalize_values): New function.
* value.h (finalize_values): Declare.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h index d3905cc..0756d13 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1189,4 +1189,8 @@ extern struct value *call_xmethod (struct value *method, extern int value_union_variant (struct type *union_type, const gdb_byte *contents); +/* Destroy the values currently allocated. This is called when GDB is + exiting (e.g., on quit_force). */ +extern void finalize_values (); + #endif /* !defined (VALUE_H) */ |