forked from Imagelibrary/binutils-gdb
Change finalize_values into a final cleanup
This removes finalize_values in favor of adding a new final cleanup. This is safe now that extension languages are explicitly shut down.
This commit is contained in:
@@ -1803,12 +1803,6 @@ quit_force (int *exit_arg, int from_tty)
|
|||||||
exception_print (gdb_stderr, ex);
|
exception_print (gdb_stderr, ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Destroy any values currently allocated now instead of leaving it
|
|
||||||
to global destructors, because that may be too late. For
|
|
||||||
example, the destructors of xmethod values call into the Python
|
|
||||||
runtime, which is finalized via a final cleanup. */
|
|
||||||
finalize_values ();
|
|
||||||
|
|
||||||
/* Do any final cleanups before exiting. */
|
/* Do any final cleanups before exiting. */
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
13
gdb/value.c
13
gdb/value.c
@@ -4499,12 +4499,13 @@ and exceeds this limit will cause an error."),
|
|||||||
selftests::test_insert_into_bit_range_vector);
|
selftests::test_insert_into_bit_range_vector);
|
||||||
selftests::register_test ("value_copy", selftests::test_value_copy);
|
selftests::register_test ("value_copy", selftests::test_value_copy);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
/* See value.h. */
|
/* Destroy any values currently allocated in a final cleanup instead
|
||||||
|
of leaving it to global destructors, because that may be too
|
||||||
void
|
late. For example, the destructors of xmethod values call into
|
||||||
finalize_values ()
|
the Python runtime. */
|
||||||
{
|
add_final_cleanup ([] ()
|
||||||
|
{
|
||||||
all_values.clear ();
|
all_values.clear ();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1630,10 +1630,6 @@ struct value *call_internal_function (struct gdbarch *gdbarch,
|
|||||||
|
|
||||||
const char *value_internal_function_name (struct value *);
|
const char *value_internal_function_name (struct value *);
|
||||||
|
|
||||||
/* Destroy the values currently allocated. This is called when GDB is
|
|
||||||
exiting (e.g., on quit_force). */
|
|
||||||
extern void finalize_values ();
|
|
||||||
|
|
||||||
/* Convert VALUE to a gdb_mpq. The caller must ensure that VALUE is
|
/* Convert VALUE to a gdb_mpq. The caller must ensure that VALUE is
|
||||||
of floating-point, fixed-point, or integer type. */
|
of floating-point, fixed-point, or integer type. */
|
||||||
extern gdb_mpq value_to_gdb_mpq (struct value *value);
|
extern gdb_mpq value_to_gdb_mpq (struct value *value);
|
||||||
|
|||||||
Reference in New Issue
Block a user