15f040e596
* Added a virtual Architecture::CreateStackTrace() and added a basic implementation in ArchitectureX86. Fleshed out StackTrace/StackFrame a bit and added StackFrameX86. This needs to be organized differently, though, so that we can get the maximum available information for each stack frame, depending on what info is available for the respective function. * Added job to get the stack trace for a thread. * Added stack trace related handling in TeamDebugger. Reorganized the thread state/CPU state/stack trace change handling a bit -- we're using a Team::Listener now, and do things asynchronously. * Added a StackTraceView to display the stack trace of the current thread. No function name available yet, otherwise working fine. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31126 a95241bf-73f2-0310-859d-f6bbb57e9c96
47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef STACK_FRAME_H
|
|
#define STACK_FRAME_H
|
|
|
|
#include <OS.h>
|
|
|
|
#include <Referenceable.h>
|
|
#include <util/DoublyLinkedList.h>
|
|
|
|
#include "ArchitectureTypes.h"
|
|
|
|
|
|
enum stack_frame_type {
|
|
STACK_FRAME_TYPE_TOP, // top-most frame
|
|
STACK_FRAME_TYPE_STANDARD, // non-top-most standard frame
|
|
STACK_FRAME_TYPE_SIGNAL, // signal handler frame
|
|
STACK_FRAME_TYPE_FRAMELESS // dummy frame for a frameless function
|
|
};
|
|
|
|
|
|
class CpuState;
|
|
|
|
|
|
class StackFrame : public Referenceable,
|
|
public DoublyLinkedListLinkImpl<StackFrame> {
|
|
public:
|
|
virtual ~StackFrame();
|
|
|
|
virtual stack_frame_type Type() const = 0;
|
|
|
|
virtual CpuState* GetCpuState() const = 0;
|
|
|
|
virtual target_addr_t InstructionPointer() const = 0;
|
|
virtual target_addr_t FrameAddress() const = 0;
|
|
virtual target_addr_t ReturnAddress() const = 0;
|
|
virtual target_addr_t PreviousFrameAddress() const = 0;
|
|
};
|
|
|
|
|
|
typedef DoublyLinkedList<StackFrame> StackFrameList;
|
|
|
|
|
|
#endif // STACK_FRAME_H
|