* Changed arch_debug_save_registers() to take an arch-specific structure

arch_debug_registers instead.
* Call arch_debug_save_registers() on all CPUs when entering the kernel
  debugger.
* Added debug_get_debug_registers() to return a specified CPU's saved
  registers.
* x86:
  - Replaced the previous arch_debug_save_registers() implementation. Disabled
    getting the registers via the gdb interface for the time being.
  - Fixed the "sc", "call", and "calling" commands to also work for threads
    running on another CPU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35907 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-03-18 17:20:06 +00:00
parent 74de61fda5
commit cfefeee3f8
15 changed files with 149 additions and 55 deletions
@@ -0,0 +1,16 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_ARM_DEBUG_H
#define _KERNEL_ARCH_ARM_DEBUG_H
#include <SupportDefs.h>
struct arch_debug_registers {
};
#endif // _KERNEL_ARCH_ARM_DEBUG_H
+2 -1
View File
@@ -11,6 +11,7 @@
#include <SupportDefs.h>
#include <arch_debug.h>
#include <cpu.h>
@@ -35,7 +36,7 @@ int32 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
void* arch_debug_get_interrupt_pc(bool* _isSyscall);
bool arch_debug_contains_call(struct thread *thread, const char *symbol,
addr_t start, addr_t end);
void arch_debug_save_registers(int *);
void arch_debug_save_registers(struct arch_debug_registers* registers);
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);
@@ -0,0 +1,16 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_M68K_DEBUG_H
#define _KERNEL_ARCH_M68K_DEBUG_H
#include <SupportDefs.h>
struct arch_debug_registers {
};
#endif // _KERNEL_ARCH_M68K_DEBUG_H
@@ -0,0 +1,16 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_MIPSEL_DEBUG_H
#define _KERNEL_ARCH_MIPSEL_DEBUG_H
#include <SupportDefs.h>
struct arch_debug_registers {
};
#endif // _KERNEL_ARCH_MIPSEL_DEBUG_H
@@ -0,0 +1,16 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_PPC_DEBUG_H
#define _KERNEL_ARCH_PPC_DEBUG_H
#include <SupportDefs.h>
struct arch_debug_registers {
};
#endif // _KERNEL_ARCH_PPC_DEBUG_H
@@ -0,0 +1,17 @@
/*
* Copyright 2010, Ingo Weinhold, [email protected].
* Distributed under the terms of the MIT License.
*/
#ifndef _KERNEL_ARCH_X86_DEBUG_H
#define _KERNEL_ARCH_X86_DEBUG_H
#include <SupportDefs.h>
struct arch_debug_registers {
uint32 ebp;
};
#endif // _KERNEL_ARCH_X86_DEBUG_H
+6 -2
View File
@@ -67,6 +67,10 @@
#define B_KDEBUG_DONT_PARSE_ARGUMENTS (0x01)
#define B_KDEBUG_PIPE_FINAL_RERUN (0x02)
struct arch_debug_registers;
struct debugger_module_info {
module_info info;
@@ -92,8 +96,6 @@ struct debugger_demangle_module_info {
};
extern int dbg_register_file[B_MAX_CPU_COUNT][14];
typedef struct debug_page_fault_info {
addr_t fault_address;
addr_t pc;
@@ -170,6 +172,8 @@ extern status_t debug_get_next_demangled_argument(uint32* _cookie,
extern struct thread* debug_set_debugged_thread(struct thread* thread);
extern struct thread* debug_get_debugged_thread();
extern struct arch_debug_registers* debug_get_debug_registers(int32 cpu);
extern status_t _user_kernel_debugger(const char *message);
extern void _user_debug_output(const char *userString);