Changeset 15d0046 in mainline for uspace/lib/c/generic/stacktrace.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/stacktrace.c

    r8db09e4 r15d0046  
    4242static int stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
    4343
    44 void stacktrace_print_fp_pc(uintptr_t fp, uintptr_t pc)
     44static stacktrace_ops_t basic_ops = {
     45        .read_uintptr = stacktrace_read_uintptr
     46};
     47
     48void stacktrace_print_generic(stacktrace_ops_t *ops, void *arg, uintptr_t fp,
     49    uintptr_t pc)
    4550{
    4651        stacktrace_t st;
    4752        uintptr_t nfp;
     53        int rc;
    4854
    49         st.op_arg = NULL;
    50         st.read_uintptr = stacktrace_read_uintptr;
     55        st.op_arg = arg;
     56        st.ops = ops;
    5157
    5258        while (stacktrace_fp_valid(&st, fp)) {
    5359                printf("%p: %p()\n", (void *) fp, (void *) pc);
    54                 (void) stacktrace_ra_get(&st, fp, &pc);
    55                 (void) stacktrace_fp_prev(&st, fp, &nfp);
     60                rc =  stacktrace_ra_get(&st, fp, &pc);
     61                if (rc != EOK)
     62                        break;
     63                rc = stacktrace_fp_prev(&st, fp, &nfp);
     64                if (rc != EOK)
     65                        break;
    5666                fp = nfp;
    5767        }
     68}
     69
     70void stacktrace_print_fp_pc(uintptr_t fp, uintptr_t pc)
     71{
     72        stacktrace_print_generic(&basic_ops, NULL, fp, pc);
    5873}
    5974
Note: See TracChangeset for help on using the changeset viewer.