Ticket #6139: 0002-Exclude-stack_trace-function-from-stack-trace.patch

File 0002-Exclude-stack_trace-function-from-stack-trace.patch, 1.1 KB (added by andreasf, 14 years ago)

proposed patch: exclude stack_trace from stack trace

  • src/system/kernel/arch/ppc/arch_debug.cpp

    From 20a7d3f570f51f9360554d7bb706084481bb0484 Mon Sep 17 00:00:00 2001
    From: Andreas Faerber <andreas.faerber@web.de>
    Date: Sun, 6 Jun 2010 14:10:15 +0200
    Subject: [PATCH 2/2] Exclude stack_trace function from stack trace
    
    Much more we cannot exclude since the call stack varies depending on caller.
    In particular the function is called either through arch_debug_get_stack_trace
    or interactively through the kernel debugger.
    ---
     src/system/kernel/arch/ppc/arch_debug.cpp |    2 +-
     1 files changed, 1 insertions(+), 1 deletions(-)
    
    diff --git a/src/system/kernel/arch/ppc/arch_debug.cpp b/src/system/kernel/arch/ppc/arch_debug.cpp
    index d5d9458..dc7179a 100644
    a b stack_trace(int argc, char **argv)  
    124124
    125125    if (argc < 2) {
    126126        thread = thread_get_current_thread();
    127         framePointer = (addr_t)get_current_stack_frame();
     127        framePointer = (addr_t)get_current_stack_frame()->previous;
    128128    } else {
    129129// TODO: Add support for stack traces of other threads.
    130130/*      thread_id id = strtoul(argv[1], NULL, 0);