Backported the new stack crawl command ("sc", not "bt" like in NewOS) from

NewOS. Untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@750 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-08-13 21:42:53 +00:00
parent ef8d7092e8
commit 5ca8da7a4b
10 changed files with 301 additions and 90 deletions
+5 -4
View File
@@ -1,9 +1,10 @@
/*
/*
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#ifndef _NEWOS_KERNEL_ARCH_DEBUG
#define _NEWOS_KERNEL_ARCH_DEBUG
#ifndef _KERNEL_ARCH_DEBUG_H
#define _KERNEL_ARCH_DEBUG_H
#endif
int arch_dbg_init(kernel_args *ka);
#endif /* _KERNEL_ARCH_DEBUG_H */
@@ -82,6 +82,28 @@ typedef struct pdentry {
unsigned int addr:20;
} pdentry;
struct iframe {
unsigned int gs;
unsigned int fs;
unsigned int es;
unsigned int ds;
unsigned int edi;
unsigned int esi;
unsigned int ebp;
unsigned int esp;
unsigned int ebx;
unsigned int edx;
unsigned int ecx;
unsigned int eax;
unsigned int vector;
unsigned int error_code;
unsigned int eip;
unsigned int cs;
unsigned int flags;
unsigned int user_esp;
unsigned int user_ss;
};
#define nop() __asm__ ("nop"::)
void setup_system_time(unsigned int cv_factor);
@@ -93,6 +115,9 @@ void i386_swap_pgdir(addr new_pgdir);
void i386_fsave_swap(void *old_fpu_state, void *new_fpu_state);
void i386_fxsave_swap(void *old_fpu_state, void *new_fpu_state);
#define read_ebp(value) \
__asm__("movl %%ebp,%0" : "=r" (value))
#define read_dr3(value) \
__asm__("movl %%dr3,%0" : "=r" (value))
@@ -11,6 +11,11 @@ extern "C" {
#include <arch/cpu.h>
void i386_push_iframe(struct thread *t, struct iframe *frame);
void i386_pop_iframe(struct thread *t);
extern inline struct thread *arch_thread_get_current_thread(void) {
struct thread *t;
read_dr3(t);
@@ -10,10 +10,17 @@ struct farcall {
unsigned int *ss;
};
#define IFRAME_TRACE_DEPTH 4
// architecture specific thread info
struct arch_thread {
struct farcall current_stack;
struct farcall interrupt_stack;
// used to track interrupts on this thread
struct iframe *iframes[IFRAME_TRACE_DEPTH];
int iframe_ptr;
// 512 byte floating point save point
uint8 fpu_state[512];
};
@@ -22,5 +29,4 @@ struct arch_team {
// nothing here
};
#endif
#endif /* _KERNEL_ARCH_x86_THREAD_STRUCT_H */
+2 -2
View File
@@ -11,7 +11,7 @@ int elf_load_uspace(const char *path, struct team *t, int flags, addr *entry);
image_id elf_load_kspace(const char *path, const char *sym_prepend);
int elf_unload_kspace( const char *path);
addr elf_lookup_symbol(image_id id, const char *symbol);
int elf_lookup_symbol_address(addr address, addr *baseAddress, char *text, size_t length);
int elf_init(kernel_args *ka);
#endif
#endif /* _KERNEL_ELF_H */