//************************************************************************** | |
//* | |
//* Copyright (c) 2017 ZTE Corporation. | |
//* | |
//************************************************************************** | |
// penglei | |
//************************************************************************** | |
//* tos/linux/uClinux²Ù×÷ϵͳÄں˴úÂë¶Î±È½Ï£¬²é¿´´úÂë¶ÎÊÇ·ñÓÐÍ»±äµÄÇé¿ö | |
//************************************************************************** | |
local &addressStart | |
local &addressEnd | |
//Òª±È½ÏµÄelfÎļþ | |
;&elfname="D:\ramdump\7520v5\0523\vmlinux" | |
//´´½¨Ò»¸ö´°¿Ú£» | |
&width=20. | |
&nameWidth=20. | |
&fileColumns=90. | |
&fileLines=500. | |
&diffCount=0 | |
area.create codeDiff &fileColumns &fileLines | |
area.clear codeDiff | |
area.select codeDiff | |
area.open codeDiff codeDiff.txt | |
area.view codeDiff | |
//´ò¿ªÎļþ£» | |
&dir=os.pwd()+"\log" | |
if !os.dir(&dir) | |
( | |
mkdir &dir | |
) | |
&file="&dir\codeDiff.txt" | |
;Load Code from Binary and verify specific sections with the Elf file | |
//¸ù¾Ý²Ù×÷ϵͳÀàÐÍ»ñÈ¡´úÂë¶ÎÆðʼµØÖ·ºÍ½áÊøµØÖ· | |
if symbol.exist(init_task) //linux or uClinux | |
( | |
&addressStart=sYmbol.SECADDRESS(".head.text") | |
&addressEnd=sYmbol.SECEND(".text") | |
) | |
else if symbol.exist(tos_except) //tos | |
( | |
&addressStart=sYmbol.SECADDRESS(".rom_vectors") | |
&addressEnd=sYmbol.SECADDRESS(".data") | |
) | |
else | |
( | |
area.close codeDiff | |
ENDDO | |
) | |
print FORMAT.CHAR('-',&fileColumns,'-') | |
//´òÓ¡title | |
&string=format.string(" ",&fileColumns/3,' ') | |
&string="&string"+"elfÓëbinÎļþµÄ´úÂë¶Î²îÒì" | |
print %string "&string" | |
print FORMAT.CHAR('-',&fileColumns,'-') | |
repeat | |
( | |
Data.LOAD.Elf &elfname &addressStart--&addressEnd /DIFF /NoRegister /NosYmbol | |
&find=FOUND() | |
if &find | |
( | |
&addressStart=ADDRESS.OFFSET(TRACK.ADDRESS()) | |
&result="P:"+format.string("&addressStart",10,'') | |
&string=format.string("different address=",-&width,' ')+"&result" | |
&result=sYmbol.NAME(&result) | |
&result=os.file.name("&result") | |
&string="&string"+" symbol="+format.string("&result",20,'') | |
print %string "&string" | |
&addressStart=(&addressStart&(~0x3))+4 | |
&addressStart="P:"+format.string("&addressStart",10,'') | |
&diffCount=&diffCount+1 | |
) | |
else | |
( | |
&addressStart="" | |
) | |
) | |
while ("&addressStart"!="")&&(&diffCount!=0x78) | |
if (&diffCount==0x0) | |
( | |
&string=format.string(" ",&fileColumns/3,' ') | |
&string="&string"+"Äں˴úÂë¶Î²»´æÔÚÍ»±ä" | |
print %string "&string" | |
) | |
print FORMAT.CHAR('-',&fileColumns,'-') | |
area.close codeDiff | |
ENDDO | |
RETURN |