/* Multi-process/thread control defs for GDB, the GNU debugger.
- Copyright (C) 1987-2020 Free Software Foundation, Inc.
+ Copyright (C) 1987-2021 Free Software Foundation, Inc.
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
#include "gdbsupport/refcounted-object.h"
#include "gdbsupport/common-gdbthread.h"
#include "gdbsupport/forward-scope-exit.h"
+#include "displaced-stepping.h"
struct inferior;
struct process_stratum_target;
fields point to self. */
struct thread_info *step_over_prev = NULL;
struct thread_info *step_over_next = NULL;
+
+ /* Displaced-step state for this thread. */
+ displaced_step_thread_state displaced_step_state;
};
/* A gdb::ref_ptr pointer to a thread_info. */
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 ();
}
{
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);
extern void global_thread_step_over_chain_enqueue (thread_info *tp);
+/* Append the thread step over chain CHAIN_HEAD to the global thread step over
+ chain. */
+
+extern void global_thread_step_over_chain_enqueue_chain
+ (thread_info *chain_head);
+
+/* Remove TP from step-over chain LIST_P. */
+
+extern void thread_step_over_chain_remove (thread_info **list_p,
+ thread_info *tp);
+
/* Remove TP from the global pending step-over chain. */
extern void global_thread_step_over_chain_remove (thread_info *tp);
+/* Return the thread following TP in the step-over chain whose head is
+ CHAIN_HEAD. Return NULL if TP is the last entry in the chain. */
+
+extern thread_info *thread_step_over_chain_next (thread_info *chain_head,
+ thread_info *tp);
+
/* Return the thread following TP in the global step-over chain, or NULL if TP
is the last entry in the chain. */
extern int thread_is_in_step_over_chain (struct thread_info *tp);
+/* Return the length of the the step over chain TP is in.
+
+ If TP is non-nullptr, the thread must be in a step over chain.
+ TP may be nullptr, in which case it denotes an empty list, so a length of
+ 0. */
+
+extern int thread_step_over_chain_length (thread_info *tp);
+
/* Cancel any ongoing execution command. */
extern void thread_cancel_execution_command (struct thread_info *thr);