Changeset e515b21a in mainline for uspace/app/taskdump/taskdump.c
- Timestamp:
- 2010-01-26T21:31:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3698e44
- Parents:
- 80487bc5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/taskdump.c
r80487bc5 re515b21a 46 46 #include <bool.h> 47 47 48 #include <stacktrace.h> 49 48 50 #define LINE_BYTES 16 49 51 … … 57 59 static int connect_task(task_id_t task_id); 58 60 static int parse_args(int argc, char *argv[]); 59 static void print_syntax( );61 static void print_syntax(void); 60 62 static int threads_dump(void); 61 63 static int thread_dump(uintptr_t thash); … … 63 65 static int area_dump(as_area_info_t *area); 64 66 static void hex_dump(uintptr_t addr, void *buffer, size_t size); 67 static int td_read_uintptr(void *arg, uintptr_t addr, uintptr_t *value); 65 68 66 69 int main(int argc, char *argv[]) … … 184 187 } 185 188 186 static void print_syntax( )189 static void print_syntax(void) 187 190 { 188 191 printf("Syntax: taskdump [-m] -t <task_id>\n"); … … 298 301 { 299 302 istate_t istate; 300 uintptr_t pc, fp; 303 uintptr_t pc, fp, nfp; 304 stacktrace_t st; 301 305 int rc; 302 306 … … 311 315 312 316 printf("Thread 0x%lx crashed at PC 0x%lx. FP 0x%lx\n", thash, pc, fp); 313 printf("Istate hexdump:\n"); 314 hex_dump(0, &istate, (sizeof(istate_t) + 15) & ~15); 317 318 st.op_arg = NULL; 319 st.read_uintptr = td_read_uintptr; 320 321 while (stacktrace_fp_valid(&st, fp)) { 322 printf("%p: %p()\n", fp, pc); 323 324 rc = stacktrace_ra_get(&st, fp, &pc); 325 if (rc != EOK) 326 return rc; 327 328 rc = stacktrace_fp_prev(&st, fp, &nfp); 329 if (rc != EOK) 330 return rc; 331 332 fp = nfp; 333 } 315 334 316 335 return EOK; … … 376 395 } 377 396 397 static int td_read_uintptr(void *arg, uintptr_t addr, uintptr_t *value) 398 { 399 uintptr_t data; 400 int rc; 401 402 (void) arg; 403 404 rc = udebug_mem_read(phoneid, &data, addr, sizeof(data)); 405 if (rc < 0) { 406 printf("Warning: udebug_mem_read() failed.\n"); 407 return rc; 408 } 409 410 *value = data; 411 return EOK; 412 } 413 378 414 /** @} 379 415 */
Note:
See TracChangeset
for help on using the changeset viewer.