DDB support. splddb() and trapcode for ddb.
This commit is contained in:
parent
a1761db1f5
commit
913f0b045e
|
@ -0,0 +1,73 @@
|
|||
/* $NetBSD: db_machdep.h,v 1.1 1995/06/16 15:17:27 ragge Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
* Copyright (c) 1991,1990 Carnegie Mellon University
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software and its
|
||||
* documentation is hereby granted, provided that both the copyright
|
||||
* notice and this permission notice appear in all copies of the
|
||||
* software, derivative works or modified versions, and any portions
|
||||
* thereof, and that both notices appear in supporting documentation.
|
||||
*
|
||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* Carnegie Mellon requests users of this software to return to
|
||||
*
|
||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||
* School of Computer Science
|
||||
* Carnegie Mellon University
|
||||
* Pittsburgh PA 15213-3890
|
||||
*
|
||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||
* the rights to redistribute these changes.
|
||||
*/
|
||||
|
||||
#ifndef _VAX_DB_MACHDEP_H_
|
||||
#define _VAX_DB_MACHDEP_H_
|
||||
|
||||
/*
|
||||
* Machine-dependent defines for new kernel debugger.
|
||||
* Modified for vax out of i386 code.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <vm/vm.h>
|
||||
#include <machine/trap.h>
|
||||
|
||||
typedef vm_offset_t db_addr_t; /* address - unsigned */
|
||||
typedef int db_expr_t; /* expression - signed */
|
||||
|
||||
typedef struct trapframe db_regs_t;
|
||||
db_regs_t ddb_regs; /* register state */
|
||||
#define DDB_REGS (&ddb_regs)
|
||||
|
||||
#define PC_REGS(regs) ((db_addr_t)(regs)->pc)
|
||||
|
||||
#define BKPT_INST 0x03 /* breakpoint instruction */
|
||||
#define BKPT_SIZE (1) /* size of breakpoint inst */
|
||||
#define BKPT_SET(inst) (BKPT_INST)
|
||||
|
||||
#define FIXUP_PC_AFTER_BREAK ddb_regs.pc -= BKPT_SIZE;
|
||||
|
||||
#define db_clear_single_step(regs) ((regs)->psl &= ~PSL_T)
|
||||
#define db_set_single_step(regs) ((regs)->psl |= PSL_T)
|
||||
|
||||
#define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BPTFLT)
|
||||
#define IS_WATCHPOINT_TRAP(type, code) ((type) == T_TRCTRAP)
|
||||
|
||||
#define I_CALL 0xfb
|
||||
#define I_RET 0x04
|
||||
#define I_IRET 0x02
|
||||
|
||||
#define inst_trap_return(ins) (((ins)&0xff) == I_IRET)
|
||||
#define inst_return(ins) (((ins)&0xff) == I_RET)
|
||||
#define inst_call(ins) (((ins)&0xff) == I_CALL)
|
||||
|
||||
#define inst_load(ins) 0
|
||||
#define inst_store(ins) 0
|
||||
|
||||
#endif /* _VAX_DB_MACHDEP_H_ */
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: param.h,v 1.8 1995/05/03 19:53:46 ragge Exp $ */
|
||||
/* $NetBSD: param.h,v 1.9 1995/06/16 15:17:33 ragge Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -184,6 +184,7 @@
|
|||
#define spl0() splx(0) /* IPL0 */
|
||||
#define splsoftclock() splx(8) /* IPL08 */
|
||||
#define splnet() splx(0xc) /* IPL0C */
|
||||
#define splddb() splx(0xf) /* IPL0F */
|
||||
#define spl4() splx(0x14) /* IPL14 */
|
||||
#define spltty() splx(0x15) /* IPL15 */
|
||||
#define splbio() splx(0x15) /* IPL15 */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap.h,v 1.7 1995/06/05 17:18:00 ragge Exp $ */
|
||||
/* $NetBSD: trap.h,v 1.8 1995/06/16 15:17:40 ragge Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -59,9 +59,9 @@
|
|||
#define T_ACCFLT 12 /* Access violation fault */
|
||||
/* #define T_TABLEFLT 13 /* page table fault */
|
||||
/* #define T_ALIGNFLT 14 /* alignment fault */
|
||||
/* #define T_KSPNOTVAL 15 /* kernel stack pointer not valid */
|
||||
#define T_KSPNOTVAL 15 /* kernel stack pointer not valid */
|
||||
/* #define T_BUSERR 16 /* bus error */
|
||||
/* #define T_KDBTRAP 17 /* kernel debugger trap */
|
||||
#define T_KDBTRAP 17 /* kernel debugger trap */
|
||||
|
||||
/* #define T_DIVIDE 18 /* integer divide fault */
|
||||
/* #define T_NMI 19 /* non-maskable trap */
|
||||
|
|
Loading…
Reference in New Issue