aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-04-03 18:49:05 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-04-03 18:49:05 +0000
commit3bfab7807a41e5cf666606f32e124afd3d96d1e9 (patch)
treea088924ab6d23f4333b334a660838d9b777345b4 /gnu
parentc591ed081e4d746dc2900678b36ab4ca010cee98 (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/trgt.c b/gnu/usr.bin/gdb/kgdb/trgt.c
index bb3c1c9e027d..a312767c43c8 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt.c
@@ -174,6 +174,32 @@ kgdb_set_proc_cmd (char *arg, int from_tty)
kgdb_switch_to_thread(thr);
}
+static void
+kgdb_set_tid_cmd (char *arg, int from_tty)
+{
+ CORE_ADDR addr;
+ struct kthr *thr;
+
+ if (!arg)
+ error_no_arg ("TID or thread address for the new context");
+
+ if (kvm == NULL)
+ error ("no kernel core file");
+
+ addr = (CORE_ADDR) parse_and_eval_address (arg);
+
+ if (!INKERNEL (addr)) {
+ thr = kgdb_thr_lookup_tid((int)addr);
+ if (thr == NULL)
+ error ("invalid TID");
+ } else {
+ thr = kgdb_thr_lookup_taddr(addr);
+ if (thr == NULL)
+ error("invalid thread address");
+ }
+ kgdb_switch_to_thread(thr);
+}
+
void
kgdb_target(void)
{
@@ -215,5 +241,7 @@ kgdb_target(void)
inferior_ptid = ptid_build(curkthr->pid, 0, curkthr->tid);
add_com ("proc", class_obscure, kgdb_set_proc_cmd,
"Set current process context");
+ add_com ("tid", class_obscure, kgdb_set_tid_cmd,
+ "Set current thread context");
kgdb_kld_init();
}