Changes in uspace/app/taskdump/taskdump.c [9d58539:c1b979a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/taskdump.c
r9d58539 rc1b979a 35 35 #include <async.h> 36 36 #include <elf/elf_linux.h> 37 #include <fibrildump.h> 37 38 #include <stdio.h> 38 39 #include <stdlib.h> … … 47 48 #include <macros.h> 48 49 #include <assert.h> 49 #include < bool.h>50 #include <stdbool.h> 50 51 51 52 #include <symtab.h> 52 53 #include <elf_core.h> 53 54 #include <stacktrace.h> 55 #include <taskdump.h> 54 56 55 57 #define LINE_BYTES 16 … … 76 78 static istate_t reg_state; 77 79 80 static stacktrace_ops_t td_stacktrace_ops = { 81 .read_uintptr = td_read_uintptr 82 }; 83 78 84 int main(int argc, char *argv[]) 79 85 { … … 106 112 if (rc < 0) 107 113 printf("Failed dumping address space areas.\n"); 114 115 rc = fibrils_dump(app_symtab, sess); 116 if (rc < 0) 117 printf("Failed dumping fibrils.\n"); 108 118 109 119 udebug_end(sess); … … 311 321 } 312 322 323 int td_stacktrace(uintptr_t fp, uintptr_t pc) 324 { 325 uintptr_t nfp; 326 stacktrace_t st; 327 char *sym_pc; 328 int rc; 329 330 st.op_arg = NULL; 331 st.ops = &td_stacktrace_ops; 332 333 while (stacktrace_fp_valid(&st, fp)) { 334 sym_pc = fmt_sym_address(pc); 335 printf(" %p: %s\n", (void *) fp, sym_pc); 336 free(sym_pc); 337 338 rc = stacktrace_ra_get(&st, fp, &pc); 339 if (rc != EOK) 340 return rc; 341 342 rc = stacktrace_fp_prev(&st, fp, &nfp); 343 if (rc != EOK) 344 return rc; 345 346 fp = nfp; 347 } 348 349 return EOK; 350 } 351 313 352 static int thread_dump(uintptr_t thash) 314 353 { 315 354 istate_t istate; 316 uintptr_t pc, fp, nfp; 317 stacktrace_t st; 355 uintptr_t pc, fp; 318 356 char *sym_pc; 319 357 int rc; … … 336 374 free(sym_pc); 337 375 338 st.op_arg = NULL; 339 st.read_uintptr = td_read_uintptr; 340 341 while (stacktrace_fp_valid(&st, fp)) { 342 sym_pc = fmt_sym_address(pc); 343 printf(" %p: %s\n", (void *) fp, sym_pc); 344 free(sym_pc); 345 346 rc = stacktrace_ra_get(&st, fp, &pc); 347 if (rc != EOK) 348 return rc; 349 350 rc = stacktrace_fp_prev(&st, fp, &nfp); 351 if (rc != EOK) 352 return rc; 353 354 fp = nfp; 355 } 376 (void) td_stacktrace(fp, pc); 356 377 357 378 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.