Changeset 47246f4 in mainline for uspace/lib/libc/generic/stacktrace.c


Ignore:
Timestamp:
2009-12-30T18:34:15Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
01fda09
Parents:
ee2f1aae
Message:

Pair the stack frame address and the return address in a more meaningful way.
Also do the 'right' thing on sparc64 and recognize the end of the stack trace
by -0x7ff stored in %fp.

File:
1 edited

Legend:

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

    ree2f1aae r47246f4  
    3737#include <sys/types.h>
    3838
    39 void stack_trace_fp(uintptr_t fp)
     39void stack_trace_fp_pc(uintptr_t fp, uintptr_t pc)
    4040{
    41         uintptr_t ra;
    42 
     41        printf("Printing stack trace:\n");
     42        printf("=====================\n");
    4343        while (frame_pointer_validate(fp)) {
    44                 ra = return_address_get(fp);
    45                 printf("%p: %p()\n", fp, ra);
     44                printf("%p: %p()\n", fp, pc);
     45                pc = return_address_get(fp);
    4646                fp = frame_pointer_prev(fp);
    4747        }
     48        printf("=====================\n");
    4849}
    4950
    5051void stack_trace(void)
    5152{
    52         stack_trace_fp(frame_pointer_get());
     53        stack_trace_fp_pc(frame_pointer_get(), program_counter_get());
    5354}
    5455
Note: See TracChangeset for help on using the changeset viewer.