/* Multi-process/thread control for GDB, the GNU debugger.
- Copyright (C) 1986-1988, 1993-2004, 2007-2012 Free Software
- Foundation, Inc.
+ Copyright (C) 1986-2013 Free Software Foundation, Inc.
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
#include "regcache.h"
#include "gdb.h"
#include "gdb_string.h"
+#include "btrace.h"
#include <ctype.h>
#include <sys/types.h>
/* Prototypes for local functions. */
-static struct thread_info *thread_list = NULL;
+struct thread_info *thread_list = NULL;
static int highest_thread_num;
static void thread_command (char *tidstr, int from_tty);
tp->control.exception_resume_breakpoint = NULL;
}
+ delete_longjmp_breakpoint_at_next_stop (tp->num);
+
bpstat_clear (&tp->control.stop_bpstat);
+ btrace_teardown (tp);
+
do_all_intermediate_continuations_thread (tp, 1);
do_all_continuations_thread (tp, 1);
-
- delete_longjmp_breakpoint (tp->num);
}
static void
finish_thread_state (*ptid_p);
}
+int
+pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
+{
+ return (pc >= thread->control.step_range_start
+ && pc < thread->control.step_range_end);
+}
+
/* Prints the list of threads and their details on UIOUT.
This is a version of 'info_threads_command' suitable for
use from MI.
inferior_ptid = ptid;
reinit_frame_cache ();
- registers_changed ();
/* We don't check for is_stopped, because we're called at times
while in the TARGET_RUNNING state, e.g., while handling an
{
struct thread_info *tp;
int start;
- char *p = tidlist;
start = get_number_or_range (&state);
if (ptid_equal (inferior_ptid, null_ptid))
error (_("No thread selected"));
- while (arg && isspace (*arg))
- ++arg;
+ arg = skip_spaces (arg);
info = inferior_thread ();
xfree (info->name);
no thread is selected, or no threads exist. */
static struct value *
-thread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var)
+thread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var,
+ void *ignore)
{
struct thread_info *tp = find_thread_ptid (inferior_ptid);
/* Commands with a prefix of `thread'. */
struct cmd_list_element *thread_cmd_list = NULL;
+/* Implementation of `thread' variable. */
+
+static const struct internalvar_funcs thread_funcs =
+{
+ thread_id_make_value,
+ NULL,
+ NULL
+};
+
void
_initialize_thread (void)
{
show_print_thread_events,
&setprintlist, &showprintlist);
- create_internalvar_type_lazy ("_thread", thread_id_make_value);
+ create_internalvar_type_lazy ("_thread", &thread_funcs, NULL);
}