Rev 2937 | Rev 2939 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2937 | Rev 2938 | ||
|---|---|---|---|
| Line 39... | Line 39... | ||
| 39 | #include <udebug.h> |
39 | #include <udebug.h> |
| 40 | #include <sys/types.h> |
40 | #include <sys/types.h> |
| 41 | 41 | ||
| 42 | #include "main.h" |
42 | #include "main.h" |
| 43 | #include "cons.h" |
43 | #include "cons.h" |
| - | 44 | #include "dthread.h" |
|
| 44 | #include "include/arch.h" |
45 | #include "include/arch.h" |
| 45 | #include "cmd.h" |
46 | #include "cmd.h" |
| 46 | 47 | ||
| 47 | static void cmd_break(int argc, char *argv[]); |
48 | static void cmd_break(int argc, char *argv[]); |
| 48 | static void cmd_ct(int argc, char *argv[]); |
49 | static void cmd_ct(int argc, char *argv[]); |
| Line 79... | Line 80... | ||
| 79 | arch_breakpoint_add(addr); |
80 | arch_breakpoint_add(addr); |
| 80 | } |
81 | } |
| 81 | 82 | ||
| 82 | static void cmd_ct(int argc, char *argv[]) |
83 | static void cmd_ct(int argc, char *argv[]) |
| 83 | { |
84 | { |
| 84 | int i; |
- | |
| 85 | int tid; |
85 | int tid; |
| 86 | 86 | ||
| - | 87 | link_t *cur; |
|
| - | 88 | dthread_t *dt; |
|
| - | 89 | ||
| 87 | (void)argc; |
90 | (void)argc; |
| 88 | tid = strtoul(argv[1], NULL, 0); |
91 | tid = strtoul(argv[1], NULL, 0); |
| 89 | 92 | ||
| - | 93 | dt = NULL; |
|
| 90 | for (i = 0; i < n_threads; ++i) { |
94 | for (cur = dthreads.next; cur != &dthreads; cur = cur->next) { |
| - | 95 | dt = list_get_instance(cur, dthread_t, link); |
|
| 91 | if (thread_id[i] == tid) break; |
96 | if (dt->id == tid) break; |
| 92 | } |
97 | } |
| 93 | 98 | ||
| 94 | if (thread_id[i] == tid) { |
99 | if (dt->id == tid) { |
| - | 100 | cwt = dt; |
|
| 95 | cons_printf("changed working thread to: %d [hash 0x%x]\n", |
101 | cons_printf("changed working thread to: %d [hash 0x%x]\n", |
| 96 | thread_id[cwt], thread_hash[cwt]); |
102 | cwt->id, cwt->hash); |
| 97 | } else { |
103 | } else { |
| 98 | cons_printf("no such thread\n"); |
104 | cons_printf("no such thread\n"); |
| 99 | } |
105 | } |
| 100 | } |
106 | } |
| 101 | 107 | ||
| Line 169... | Line 175... | ||
| 169 | } |
175 | } |
| 170 | 176 | ||
| 171 | void cmd_pwt(int argc, char *argv[]) |
177 | void cmd_pwt(int argc, char *argv[]) |
| 172 | { |
178 | { |
| 173 | (void)argc; (void)argv; |
179 | (void)argc; (void)argv; |
| - | 180 | ||
| 174 | cons_printf("working thread: %d [hash 0x%x]\n", thread_id[cwt], |
181 | cons_printf("working thread: %d [hash 0x%x]\n", cwt->id, cwt->hash); |
| 175 | thread_hash[cwt]); |
- | |
| 176 | } |
182 | } |
| 177 | 183 | ||
| 178 | void cmd_threads(int argc, char *argv[]) |
184 | void cmd_threads(int argc, char *argv[]) |
| 179 | { |
185 | { |
| 180 | int i; |
186 | link_t *cur; |
| - | 187 | dthread_t *dt; |
|
| 181 | 188 | ||
| 182 | (void)argc; (void)argv; |
189 | (void)argc; |
| - | 190 | ||
| - | 191 | dt = NULL; |
|
| 183 | for (i = 0; i < n_threads; ++i) { |
192 | for (cur = dthreads.next; cur != &dthreads; cur = cur->next) { |
| - | 193 | dt = list_get_instance(cur, dthread_t, link); |
|
| 184 | cons_printf("%d [hash 0x%x]\n", thread_id[i], thread_hash[i]); |
194 | cons_printf("%d [hash 0x%x]\n", dt->id, dt->hash); |
| 185 | } |
195 | } |
| 186 | } |
196 | } |
| 187 | 197 | ||
| 188 | 198 | ||
| 189 | static void cmd_quit(int argc, char *argv[]) |
199 | static void cmd_quit(int argc, char *argv[]) |
| 190 | { |
200 | { |