mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-26 11:22:28 +08:00
btrace: initiate teardown when closing record btrace target
The to_teardown_btrace target method is used to free btrace resources during shutdown when target record has already been unpushed and we can't reliably talk to a remote target to disable branch tracing. Tracing resources are freed for each thread when the thread is removed; both on the GDB side and on the gdbserver side. In the remote case, the remote target that provides to_teardown_btrace to free the GDB side resources has already been unpushed when threads are destroyed. This results in a complaint "You can't do this ..." and in a few bytes of memory leaked for each thread. Initiate btrace teardown in record_btrace_close, so the remote target is still in place. 2014-01-27 Markus Metzger <markus.t.metzger@intel.com> * record-btrace.c (record_btrace_close): Call btrace_teardown for all threads.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2014-01-27 Markus Metzger <markus.t.metzger@intel.com>
|
||||||
|
|
||||||
|
* record-btrace.c (record_btrace_close): Call btrace_teardown
|
||||||
|
for all threads.
|
||||||
|
|
||||||
2014-01-27 Joel Brobecker <brobecker@adacore.com>
|
2014-01-27 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* ada-lang.c: Remove "#ifdef UI_OUT" condition for including
|
* ada-lang.c: Remove "#ifdef UI_OUT" condition for including
|
||||||
|
@ -213,11 +213,16 @@ record_btrace_stop_recording (void)
|
|||||||
static void
|
static void
|
||||||
record_btrace_close (void)
|
record_btrace_close (void)
|
||||||
{
|
{
|
||||||
|
struct thread_info *tp;
|
||||||
|
|
||||||
/* Make sure automatic recording gets disabled even if we did not stop
|
/* Make sure automatic recording gets disabled even if we did not stop
|
||||||
recording before closing the record-btrace target. */
|
recording before closing the record-btrace target. */
|
||||||
record_btrace_auto_disable ();
|
record_btrace_auto_disable ();
|
||||||
|
|
||||||
/* We already stopped recording. */
|
/* We should have already stopped recording.
|
||||||
|
Tear down btrace in case we have not. */
|
||||||
|
ALL_THREADS (tp)
|
||||||
|
btrace_teardown (tp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The to_info_record method of target record-btrace. */
|
/* The to_info_record method of target record-btrace. */
|
||||||
|
Reference in New Issue
Block a user