2002-08-14 01:42:53 +04:00
|
|
|
/*
|
2009-10-18 23:50:13 +04:00
|
|
|
* Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de.
|
2005-05-25 17:58:32 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
|
|
|
* Distributed under the terms of the NewOS License.
|
|
|
|
*/
|
2002-08-14 01:42:53 +04:00
|
|
|
#ifndef _KERNEL_ARCH_DEBUG_H
|
|
|
|
#define _KERNEL_ARCH_DEBUG_H
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2005-05-25 17:58:32 +04:00
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2010-03-18 20:20:06 +03:00
|
|
|
#include <arch_debug.h>
|
2009-08-03 16:39:56 +04:00
|
|
|
#include <cpu.h>
|
|
|
|
|
|
|
|
|
2005-05-25 17:58:32 +04:00
|
|
|
struct kernel_args;
|
2008-03-26 20:08:51 +03:00
|
|
|
struct thread;
|
2005-05-25 17:58:32 +04:00
|
|
|
|
|
|
|
|
2009-12-22 18:15:07 +03:00
|
|
|
// arch_debug_get_stack_trace() flags
|
|
|
|
#define STACK_TRACE_KERNEL 0x01
|
|
|
|
#define STACK_TRACE_USER 0x02
|
|
|
|
|
|
|
|
|
2005-05-25 17:58:32 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-05-29 17:01:38 +04:00
|
|
|
status_t arch_debug_init(kernel_args *args);
|
2009-10-18 23:50:13 +04:00
|
|
|
void arch_debug_stack_trace(void);
|
2005-05-29 17:01:38 +04:00
|
|
|
void *arch_debug_get_caller(void);
|
2008-04-27 06:54:27 +04:00
|
|
|
int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
|
2009-12-22 18:15:07 +03:00
|
|
|
int32 skipIframes, int32 skipFrames, uint32 flags);
|
2009-06-24 15:49:35 +04:00
|
|
|
void* arch_debug_get_interrupt_pc(bool* _isSyscall);
|
2008-03-26 20:08:51 +03:00
|
|
|
bool arch_debug_contains_call(struct thread *thread, const char *symbol,
|
2008-04-27 06:54:27 +04:00
|
|
|
addr_t start, addr_t end);
|
2010-03-18 20:20:06 +03:00
|
|
|
void arch_debug_save_registers(struct arch_debug_registers* registers);
|
2009-08-03 16:39:56 +04:00
|
|
|
void arch_debug_unset_current_thread(void);
|
|
|
|
void arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer,
|
|
|
|
void (*function)(void*), void* parameter);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2008-08-25 03:01:43 +04:00
|
|
|
bool arch_is_debug_variable_defined(const char* variableName);
|
|
|
|
status_t arch_set_debug_variable(const char* variableName, uint64 value);
|
|
|
|
status_t arch_get_debug_variable(const char* variableName, uint64* value);
|
|
|
|
|
2005-05-25 17:58:32 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-08-14 01:42:53 +04:00
|
|
|
#endif /* _KERNEL_ARCH_DEBUG_H */
|