📄 make_textsym
字号:
#!/bin/sh## Build a textsym file for use in the Arium ITP probe.### This file is subject to the terms and conditions of the GNU General Public# License. See the file "COPYING" in the main directory of this archive# for more details.## Copyright (c) 2001-2002 Silicon Graphics, Inc. All rights reserved.#help() {cat <<ENDBuild a WinDD "symtxt" file for use with the Arium ECM-30 probe. Usage: $0 [<vmlinux file> [<output file>]] If no input file is specified, it defaults to vmlinux. If no output file name is specified, it defaults to "textsym".ENDexit 1}err () { echo "ERROR - $*" >&2 exit 1}OPTS="H"while getopts "$OPTS" c ; do case $c in H) help;; \?) help;; esacdoneshift `expr $OPTIND - 1`LINUX=${1:-vmlinux}TEXTSYM=${2:-${LINUX}.sym}TMPSYM=${2:-${LINUX}.sym.tmp}trap "/bin/rm -f $TMPSYM" 0[ -f $VMLINUX ] || help$OBJDUMP -t $LINUX | egrep -v '__ks' | sort > $TMPSYMSN1=`egrep "dig_setup|Synergy_da_indr" $TMPSYM|wc -l`# Dataprefix and textprefix correspond to the VGLOBAL_BASE and VPERNODE_BASE.# Eventually, these values should be:# dataprefix ffffffff# textprefix fffffffe# but right now they're still changing, so make them dynamic.dataprefix=`awk ' / \.data / { print substr($1, 0, 8) ; exit ; }' $TMPSYM`textprefix=`awk ' / \.text / { print substr($1, 0, 8) ; exit ; }' $TMPSYM`# pipe everything thru sortecho "TEXTSYM V1.0"(cat <<END GLOBAL | ${textprefix}00000000 | CODE | VEC_VHPT_Translation_0000GLOBAL | ${textprefix}00000400 | CODE | VEC_ITLB_0400GLOBAL | ${textprefix}00000800 | CODE | VEC_DTLB_0800GLOBAL | ${textprefix}00000c00 | CODE | VEC_Alt_ITLB_0c00GLOBAL | ${textprefix}00001000 | CODE | VEC_Alt_DTLB_1000GLOBAL | ${textprefix}00001400 | CODE | VEC_Data_nested_TLB_1400GLOBAL | ${textprefix}00001800 | CODE | VEC_Instruction_Key_Miss_1800GLOBAL | ${textprefix}00001c00 | CODE | VEC_Data_Key_Miss_1c00GLOBAL | ${textprefix}00002000 | CODE | VEC_Dirty-bit_2000GLOBAL | ${textprefix}00002400 | CODE | VEC_Instruction_Access-bit_2400GLOBAL | ${textprefix}00002800 | CODE | VEC_Data_Access-bit_2800GLOBAL | ${textprefix}00002c00 | CODE | VEC_Break_instruction_2c00GLOBAL | ${textprefix}00003000 | CODE | VEC_External_Interrupt_3000GLOBAL | ${textprefix}00003400 | CODE | VEC_Reserved_3400GLOBAL | ${textprefix}00003800 | CODE | VEC_Reserved_3800GLOBAL | ${textprefix}00003c00 | CODE | VEC_Reserved_3c00GLOBAL | ${textprefix}00004000 | CODE | VEC_Reserved_4000GLOBAL | ${textprefix}00004400 | CODE | VEC_Reserved_4400GLOBAL | ${textprefix}00004800 | CODE | VEC_Reserved_4800GLOBAL | ${textprefix}00004c00 | CODE | VEC_Reserved_4c00GLOBAL | ${textprefix}00005000 | CODE | VEC_Page_Not_Present_5000GLOBAL | ${textprefix}00005100 | CODE | VEC_Key_Permission_5100GLOBAL | ${textprefix}00005200 | CODE | VEC_Instruction_Access_Rights_5200GLOBAL | ${textprefix}00005300 | CODE | VEC_Data_Access_Rights_5300GLOBAL | ${textprefix}00005400 | CODE | VEC_General_Exception_5400GLOBAL | ${textprefix}00005500 | CODE | VEC_Disabled_FP-Register_5500GLOBAL | ${textprefix}00005600 | CODE | VEC_Nat_Consumption_5600GLOBAL | ${textprefix}00005700 | CODE | VEC_Speculation_5700GLOBAL | ${textprefix}00005800 | CODE | VEC_Reserved_5800GLOBAL | ${textprefix}00005900 | CODE | VEC_Debug_5900GLOBAL | ${textprefix}00005a00 | CODE | VEC_Unaligned_Reference_5a00GLOBAL | ${textprefix}00005b00 | CODE | VEC_Unsupported_Data_Reference_5b00GLOBAL | ${textprefix}00005c00 | CODE | VEC_Floating-Point_Fault_5c00GLOBAL | ${textprefix}00005d00 | CODE | VEC_Floating_Point_Trap_5d00GLOBAL | ${textprefix}00005e00 | CODE | VEC_Lower_Privilege_Tranfer_Trap_5e00GLOBAL | ${textprefix}00005f00 | CODE | VEC_Taken_Branch_Trap_5f00GLOBAL | ${textprefix}00006000 | CODE | VEC_Single_Step_Trap_6000GLOBAL | ${textprefix}00006100 | CODE | VEC_Reserved_6100GLOBAL | ${textprefix}00006200 | CODE | VEC_Reserved_6200GLOBAL | ${textprefix}00006300 | CODE | VEC_Reserved_6300GLOBAL | ${textprefix}00006400 | CODE | VEC_Reserved_6400GLOBAL | ${textprefix}00006500 | CODE | VEC_Reserved_6500GLOBAL | ${textprefix}00006600 | CODE | VEC_Reserved_6600GLOBAL | ${textprefix}00006700 | CODE | VEC_Reserved_6700GLOBAL | ${textprefix}00006800 | CODE | VEC_Reserved_6800GLOBAL | ${textprefix}00006900 | CODE | VEC_IA-32_Exeception_6900GLOBAL | ${textprefix}00006a00 | CODE | VEC_IA-32_Intercept_6a00GLOBAL | ${textprefix}00006b00 | CODE | VEC_IA-32_Interrupt_6b00GLOBAL | ${textprefix}00006c00 | CODE | VEC_Reserved_6c00GLOBAL | ${textprefix}00006d00 | CODE | VEC_Reserved_6d00GLOBAL | ${textprefix}00006e00 | CODE | VEC_Reserved_6e00GLOBAL | ${textprefix}00006f00 | CODE | VEC_Reserved_6f00GLOBAL | ${textprefix}00007000 | CODE | VEC_Reserved_7000GLOBAL | ${textprefix}00007100 | CODE | VEC_Reserved_7100GLOBAL | ${textprefix}00007200 | CODE | VEC_Reserved_7200GLOBAL | ${textprefix}00007300 | CODE | VEC_Reserved_7300GLOBAL | ${textprefix}00007400 | CODE | VEC_Reserved_7400GLOBAL | ${textprefix}00007500 | CODE | VEC_Reserved_7500GLOBAL | ${textprefix}00007600 | CODE | VEC_Reserved_7600GLOBAL | ${textprefix}00007700 | CODE | VEC_Reserved_7700GLOBAL | ${textprefix}00007800 | CODE | VEC_Reserved_7800GLOBAL | ${textprefix}00007900 | CODE | VEC_Reserved_7900GLOBAL | ${textprefix}00007a00 | CODE | VEC_Reserved_7a00GLOBAL | ${textprefix}00007b00 | CODE | VEC_Reserved_7b00GLOBAL | ${textprefix}00007c00 | CODE | VEC_Reserved_7c00GLOBAL | ${textprefix}00007d00 | CODE | VEC_Reserved_7d00GLOBAL | ${textprefix}00007e00 | CODE | VEC_Reserved_7e00GLOBAL | ${textprefix}00007f00 | CODE | VEC_Reserved_7f00ENDawk '/__start_gate_section/ {start=1}/^'${dataprefix}\|${textprefix}'/ { if ($4 == ".kdb") next if (start && substr($NF,1,1) != "0") { type = substr($0,26,5) if (type == ".text") printf "GLOBAL | %s | CODE | %s\n", $1, $NF else { n = 0 s = $(NF-1) while (length(s) > 0) { n = n*16 + substr(s,1,1) s = substr(s,2) } printf "GLOBAL | %s | DATA | %s | %d\n", $1, $NF, n } } if($NF == "_end") exit}' $TMPSYM ) | egrep -v " __device| __vendor" | awk -v sn1="$SN1" '/GLOBAL/ { print $0 if (sn1 != 0) { /* 32 bits of sn1 physical addrs, */ print substr($0,1,9) "04" substr($0,20,16) "Phy_" substr($0,36) } else { /* 38 bits of sn2 physical addrs, need addr space bits */ print substr($0,1,9) "3004" substr($0,20,16) "Phy_" substr($0,36) }} ' | sort -k3N=`wc -l $TEXTSYM|awk '{print $1}'`echo "Generated TEXTSYM file" >&2echo " $LINUX --> $TEXTSYM" >&2echo " Found $N symbols" >&2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -