db_trace.c revision 178172
1/*- 2 * Copyright (c) 2004-2005, Juniper Networks, Inc. 3 * All rights reserved. 4 * 5 * JNPR: db_trace.c,v 1.8 2007/08/09 11:23:32 katta 6 */ 7 8#include <sys/cdefs.h> 9__FBSDID("$FreeBSD: head/sys/mips/mips/db_trace.c 178172 2008-04-13 07:27:37Z imp $"); 10 11#include <sys/param.h> 12#include <sys/systm.h> 13#include <sys/kdb.h> 14#include <sys/proc.h> 15#include <sys/stack.h> 16#include <sys/sysent.h> 17 18#include <machine/db_machdep.h> 19#include <machine/md_var.h> 20#include <machine/pcb.h> 21 22#include <ddb/ddb.h> 23 24int 25db_md_set_watchpoint(db_expr_t addr, db_expr_t size) 26{ 27 28 return(0); 29} 30 31 32int 33db_md_clr_watchpoint( db_expr_t addr, db_expr_t size) 34{ 35 36 return(0); 37} 38 39 40void 41db_md_list_watchpoints() 42{ 43} 44 45static int 46db_backtrace(struct thread *td, db_addr_t frame, int count) 47{ 48 stacktrace_subr((struct trapframe *)frame, 49 (int (*) (const char *, ...))db_printf); 50 return (0); 51} 52 53void 54db_trace_self(void) 55{ 56 db_trace_thread (curthread, -1); 57 return; 58} 59 60int 61db_trace_thread(struct thread *thr, int count) 62{ 63 struct pcb *ctx; 64 65 ctx = kdb_thr_ctx(thr); 66 return (db_backtrace(thr, (db_addr_t) &ctx->pcb_regs, count)); 67} 68 69void 70db_show_mdpcpu(struct pcpu *pc) 71{ 72 73 db_printf("ipis = 0x%x\n", pc->pc_pending_ipis); 74 db_printf("next ASID = %d\n", pc->pc_next_asid); 75 db_printf("GENID = %d\n", pc->pc_asid_generation); 76 return; 77} 78