forked from Imagelibrary/binutils-gdb
Use thread_info_ref in enable_thread_stack_temporaries
This changes enable_thread_stack_temporaries to use a thread_info_ref, removing some manual reference counting. gdb/ChangeLog 2020-12-11 Tom Tromey <tom@tromey.com> * gdbthread.h (class enable_thread_stack_temporaries) <m_thr>: Change type.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2020-12-11 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* gdbthread.h (class enable_thread_stack_temporaries) <m_thr>:
|
||||
Change type.
|
||||
|
||||
2020-12-11 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* ada-tasks.c (struct ada_tasks_pspace_data) <cpu_id_offset>: New
|
||||
|
||||
@@ -711,12 +711,8 @@ class enable_thread_stack_temporaries
|
||||
public:
|
||||
|
||||
explicit enable_thread_stack_temporaries (struct thread_info *thr)
|
||||
: m_thr (thr)
|
||||
: m_thr (thread_info_ref::new_reference (thr))
|
||||
{
|
||||
gdb_assert (m_thr != NULL);
|
||||
|
||||
m_thr->incref ();
|
||||
|
||||
m_thr->stack_temporaries_enabled = true;
|
||||
m_thr->stack_temporaries.clear ();
|
||||
}
|
||||
@@ -725,15 +721,13 @@ public:
|
||||
{
|
||||
m_thr->stack_temporaries_enabled = false;
|
||||
m_thr->stack_temporaries.clear ();
|
||||
|
||||
m_thr->decref ();
|
||||
}
|
||||
|
||||
DISABLE_COPY_AND_ASSIGN (enable_thread_stack_temporaries);
|
||||
|
||||
private:
|
||||
|
||||
struct thread_info *m_thr;
|
||||
thread_info_ref m_thr;
|
||||
};
|
||||
|
||||
extern bool thread_stack_temporaries_enabled_p (struct thread_info *tp);
|
||||
|
||||
Reference in New Issue
Block a user