db_machdep.h revision 75666
166458Sdfr/* $FreeBSD: head/sys/ia64/include/db_machdep.h 75666 2001-04-18 14:15:45Z dfr $ */ 266458Sdfr/* $NetBSD: db_machdep.h,v 1.6 1997/09/06 02:02:25 thorpej Exp $ */ 366458Sdfr 466458Sdfr/* 566458Sdfr * Copyright (c) 1995 Carnegie-Mellon University. 666458Sdfr * All rights reserved. 766458Sdfr * 866458Sdfr * Author: Chris G. Demetriou 966458Sdfr * 1066458Sdfr * Permission to use, copy, modify and distribute this software and 1166458Sdfr * its documentation is hereby granted, provided that both the copyright 1266458Sdfr * notice and this permission notice appear in all copies of the 1366458Sdfr * software, derivative works or modified versions, and any portions 1466458Sdfr * thereof, and that both notices appear in supporting documentation. 1566458Sdfr * 1666458Sdfr * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 1766458Sdfr * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND 1866458Sdfr * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 1966458Sdfr * 2066458Sdfr * Carnegie Mellon requests users of this software to return to 2166458Sdfr * 2266458Sdfr * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 2366458Sdfr * School of Computer Science 2466458Sdfr * Carnegie Mellon University 2566458Sdfr * Pittsburgh PA 15213-3890 2666458Sdfr * 2766458Sdfr * any improvements or extensions that they make and grant Carnegie the 2866458Sdfr * rights to redistribute these changes. 2966458Sdfr */ 3066458Sdfr 3166458Sdfr#ifndef _ALPHA_DB_MACHDEP_H_ 3266458Sdfr#define _ALPHA_DB_MACHDEP_H_ 3366458Sdfr 3466458Sdfr/* 3566458Sdfr * Machine-dependent defines for new kernel debugger. 3666458Sdfr */ 3766458Sdfr 3866458Sdfr#include <sys/param.h> 3966458Sdfr#include <vm/vm.h> 4066458Sdfr#include <machine/frame.h> 4166458Sdfr 4266458Sdfr#define DB_NO_AOUT 4366458Sdfr 4466458Sdfrtypedef vm_offset_t db_addr_t; /* address - unsigned */ 4566458Sdfrtypedef long db_expr_t; /* expression - signed */ 4666458Sdfrtypedef struct trapframe db_regs_t; 4766458Sdfrdb_regs_t ddb_regs; /* register state */ 4866458Sdfr#define DDB_REGS (&ddb_regs) 4966458Sdfr 5066937Sdfr#define PC_REGS(regs) ((db_addr_t)(regs)->tf_cr_iip \ 5166937Sdfr + (((regs)->tf_cr_ipsr >> 41) & 3)) 5266458Sdfr 5366458Sdfr#define BKPT_INST 0x00000080 /* breakpoint instruction */ 5466458Sdfr#define BKPT_SIZE (4) /* size of breakpoint inst */ 5566458Sdfr#define BKPT_SET(inst) (BKPT_INST) 5666458Sdfr 5766937Sdfr#define FIXUP_PC_AFTER_BREAK 5866458Sdfr 5966937Sdfr#define db_clear_single_step(regs) 0 6066937Sdfr#define db_set_single_step(regs) 0 6166937Sdfr 6266937Sdfr#define IS_BREAKPOINT_TRAP(type, code) 0 6366458Sdfr#define IS_WATCHPOINT_TRAP(type, code) 0 6466458Sdfr 6566937Sdfr#define inst_trap_return(ins) 0 6666937Sdfr#define inst_return(ins) 0 6766937Sdfr#define inst_call(ins) 0 6866937Sdfr#define inst_branch(ins) 0 6966937Sdfr#define inst_load(ins) 0 7066937Sdfr#define inst_store(ins) 0 7166937Sdfr#define inst_unconditional_flow_transfer(ins) 0 7266937Sdfr 7366937Sdfr#define branch_taken(ins, pc, regs) pc 7466937Sdfr 7566458Sdfr/* 7666458Sdfr * Functions needed for software single-stepping. 7766458Sdfr */ 7866458Sdfr 7966458Sdfr/* No delay slots on Alpha. */ 8066458Sdfr#define next_instr_address(v, b) ((db_addr_t) ((b) ? (v) : ((v) + 4))) 8166458Sdfr 8266937Sdfru_long db_register_value(db_regs_t *, int); 8366937Sdfrint kdb_trap(int vector, struct trapframe *regs); 8466458Sdfr 8575666Sdfru_int64_t *db_rse_current_frame(void); 8675666Sdfru_int64_t *db_rse_previous_frame(u_int64_t *bsp, int sof); 8775666Sdfru_int64_t *db_rse_register_address(u_int64_t *bsp, int regno); 8875666Sdfr 8966458Sdfr/* 9066458Sdfr * Pretty arbitrary 9166458Sdfr */ 9266458Sdfr#define DB_SMALL_VALUE_MAX 0x7fffffff 9366458Sdfr#define DB_SMALL_VALUE_MIN (-0x400001) 9466458Sdfr 9566458Sdfr/* 9666458Sdfr * We define some of our own commands. 9766458Sdfr */ 9866458Sdfr#define DB_MACHINE_COMMANDS 9966458Sdfr 10066458Sdfr/* 10166458Sdfr * We use Elf64 symbols in DDB. 10266458Sdfr */ 10366458Sdfr#define DB_ELFSIZE 64 10466458Sdfr 10566458Sdfr#endif /* _ALPHA_DB_MACHDEP_H_ */ 106