Changeset 8119363 in mainline for uspace/lib/c/generic/stacktrace.c


Ignore:
Timestamp:
2018-06-26T17:35:40Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6e569bf
Parents:
fbfe59d (diff), e768aea (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 some preliminary async/fibril framework changes.

File:
1 edited

Legend:

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

    rfbfe59d r8119363  
    3939#include <stdint.h>
    4040#include <errno.h>
     41#include <io/kio.h>
    4142
    4243static errno_t stacktrace_read_uintptr(void *arg, uintptr_t addr, uintptr_t *data);
    4344
    4445static stacktrace_ops_t basic_ops = {
    45         .read_uintptr = stacktrace_read_uintptr
     46        .read_uintptr = stacktrace_read_uintptr,
     47        .printf = printf,
     48};
     49
     50static stacktrace_ops_t kio_ops = {
     51        .read_uintptr = stacktrace_read_uintptr,
     52        .printf = kio_printf,
    4653};
    4754
     
    5764
    5865        while (stacktrace_fp_valid(&st, fp)) {
    59                 printf("%p: %p()\n", (void *) fp, (void *) pc);
     66                ops->printf("%p: %p()\n", (void *) fp, (void *) pc);
    6067                rc =  stacktrace_ra_get(&st, fp, &pc);
    6168                if (rc != EOK)
     
    7178{
    7279        stacktrace_print_generic(&basic_ops, NULL, fp, pc);
     80}
     81
     82void stacktrace_kio_print(void)
     83{
     84        stacktrace_prepare();
     85        stacktrace_print_generic(&kio_ops, NULL, stacktrace_fp_get(), stacktrace_pc_get());
     86
     87        /*
     88         * Prevent the tail call optimization of the previous call by
     89         * making it a non-tail call.
     90         */
     91
     92        kio_printf("-- end of stack trace --\n");
    7393}
    7494
Note: See TracChangeset for help on using the changeset viewer.