Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / legion / src / procs / sunsparc / debug / dbxrc
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)dbxrc 1.8 07/05/30 SMI"
#
if [ -f $HOME/.dbxrc ]; then
source $HOME/.dbxrc
fi
debug sim
when in init_threads -temp { stop in debug_hook; }
when in init_threads -temp { when in debug_hook { call debug_dump_pc(); }; }
function simbreak
{
: ${1?"usage: $0 <pc> #set a simulation breakpoint at pc"}
if [ $proc = 0 ]; then
eval "when in init_threads -temp { call debug_set_breakpoint($1); }"
else
call debug_set_breakpoint($1)
fi
}
function simclearbreak
{
: ${1?"usage: $0 <pc> #clear simulation breakpoint at pc"}
if [ $proc = 0 ]; then
eval "when in init_threads -temp { call debug_clear_breakpoint($1); }"
else
call debug_clear_breakpoint($1)
fi
}
function simshowbreak
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_print_breakpoints()
}
function simstep
{
[ -z "$2" ] || { echo "usage: $0 [<n>]" >&2 && return; }
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
if [ -z "$1" ]; then n=1; else n=$1; fi
while [ $n -gt 0 ]; do
call debug_set_breakpoint_next()
cont
((n -= 1))
done
}
function simregs
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_regs()
}
function simregsall
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_regs_all()
}
function simmmuregs
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_mmuregs()
}
function simmmuregsall
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_mmuregs_all()
}
function simdumpdtlb
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_dtlb()
}
function simdumpdtlball
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_dtlb_all()
}
function simdumpitlb
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_itlb()
}
function simdumpitlball
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_itlb_all()
}
function simx
{
: ${1?"usage: $0 <paddr> [<n>]"}
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
if [ -z "$2" ]; then n=1; else n=$2; fi
call debug_x($1, $n)
}
function simdis
{
: ${1?"usage: $0 <paddr> [<n>]"}
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
if [ -z "$2" ]; then n=1; else n=$2; fi
call debug_dis($1, $n)
}
function simfocus
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
if [ -z "$1" ]; then
call debug_focus_show();
else
call debug_focus_set($1);
fi
}
function simtrans
{
: ${1?"usage: $0 <vaddr>"}
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_trans($1)
}
function simpc
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_pc()
}
function simpcall
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_pc_all()
}
function simscratch
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
if [ -z "$1" ]; then
call debug_print_scratch(-1)
else
call debug_print_scratch($1)
fi
}
function simsave
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_initiate_save_state_now()
echo "type 'cont' on the debugger prompt for the save_state to begin"
}
function simicount
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_print_icount()
}
function simcmpregs
{
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_cmpregs()
}
function simdumpbreak
{
: ${1?"usage: $0 <fname> #dump breakpoints to file"}
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_dump_breakpoints($1)
}
function simrestorebreak
{
: ${1?"usage: $0 <fname> #restore breakpoints from file"}
if [ $proc = 0 ]; then
echo "dbx: sim not active"
return
fi
call debug_restore_breakpoints($1)
}