Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2937 → Rev 2938

/branches/tracing/uspace/app/debug/cmd.c
41,6 → 41,7
 
#include "main.h"
#include "cons.h"
#include "dthread.h"
#include "include/arch.h"
#include "cmd.h"
 
81,19 → 82,24
 
static void cmd_ct(int argc, char *argv[])
{
int i;
int tid;
 
link_t *cur;
dthread_t *dt;
 
(void)argc;
tid = strtoul(argv[1], NULL, 0);
 
for (i = 0; i < n_threads; ++i) {
if (thread_id[i] == tid) break;
dt = NULL;
for (cur = dthreads.next; cur != &dthreads; cur = cur->next) {
dt = list_get_instance(cur, dthread_t, link);
if (dt->id == tid) break;
}
if (thread_id[i] == tid) {
if (dt->id == tid) {
cwt = dt;
cons_printf("changed working thread to: %d [hash 0x%x]\n",
thread_id[cwt], thread_hash[cwt]);
cwt->id, cwt->hash);
} else {
cons_printf("no such thread\n");
}
171,18 → 177,22
void cmd_pwt(int argc, char *argv[])
{
(void)argc; (void)argv;
cons_printf("working thread: %d [hash 0x%x]\n", thread_id[cwt],
thread_hash[cwt]);
 
cons_printf("working thread: %d [hash 0x%x]\n", cwt->id, cwt->hash);
}
 
void cmd_threads(int argc, char *argv[])
{
int i;
link_t *cur;
dthread_t *dt;
 
(void)argc; (void)argv;
for (i = 0; i < n_threads; ++i) {
cons_printf("%d [hash 0x%x]\n", thread_id[i], thread_hash[i]);
}
(void)argc;
 
dt = NULL;
for (cur = dthreads.next; cur != &dthreads; cur = cur->next) {
dt = list_get_instance(cur, dthread_t, link);
cons_printf("%d [hash 0x%x]\n", dt->id, dt->hash);
}
}