diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-27 17:21:31 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-04-27 17:21:31 +0000 |
commit | 98790d814871cc30bbd536673d3a0948047cd2f0 (patch) | |
tree | cfffae42b649cd647a29953a36cae48d933b1554 /EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm | |
parent | 2cf57c92af9ae3bd9ac506071c4ef1c6e7535fd5 (diff) | |
download | edk2-platforms-98790d814871cc30bbd536673d3a0948047cd2f0.tar.xz |
EmbeddedPkg/LauterbachT32: Lauterbach T32 Debug Scripts
These scripts are used for UEFI Source debugging with Lauterbach T32.
They can be used at different stages of the UEFI boot time.
A README.txt file explains how to use these scripts.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11599 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm')
-rwxr-xr-x | EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm b/EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm new file mode 100755 index 0000000000..9347c9c35b --- /dev/null +++ b/EmbeddedPkg/Scripts/LauterbachT32/EfiProcessTeImage.cmm @@ -0,0 +1,70 @@ +;
+; Copyright (c) 2011, Hewlett-Packard Company. All rights reserved.<BR>
+;
+; This program and the accompanying materials
+; are licensed and made available under the terms and conditions of the BSD License
+; which accompanies this distribution. The full text of the license may be found at
+; http://opensource.org/licenses/bsd-license.php
+;
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+;
+
+ LOCAL &imgstart &strippedsize &debugdirentryrva &debugtype &debugrva &dwarfsig &elfbase &elfpath &pathoffset
+ ENTRY &imgstart
+
+ &imgstart=&imgstart
+ print "TE image found at &imgstart"
+
+ ; determine pe header bytes removed to account for in rva references
+ &strippedsize=(Data.Long(a:&imgstart+0x4)&0xffff0000)>>16.
+ &strippedsize=&strippedsize-0x28
+
+ &debugdirentryrva=Data.Long(a:&imgstart+0x20)
+ if &debugdirentryrva==0
+ (
+ print "no debug dir for image at &imgstart"
+ enddo
+ )
+ &debugdirentryrva=&debugdirentryrva-&strippedsize
+
+ &debugtype=Data.Long(a:&imgstart+&debugdirentryrva+0xc)
+ if (&debugtype!=0xdf)&&(&debugtype!=0x02)
+ (
+ print "debug type is not dwarf for image at &imgstart, it's &debugtype"
+ enddo
+ )
+
+ &debugrva=Data.Long(a:&imgstart+&debugdirentryrva+0x14)
+ &debugrva=&debugrva-&strippedsize;
+ &dwarfsig=Data.Long(a:&imgstart+&debugrva);
+ if &dwarfsig==0x66727764
+ (
+ &pathoffset=0xc
+ )
+ else
+ (
+ if &dwarfsig==0x3031424E
+ (
+ &pathoffset=0x10
+ )
+ else
+ (
+ print "debug signature not found for image at &imgstart, its &dwarfsig"
+ enddo
+ )
+ )
+
+ &elfpath=Data.String(c:&imgstart+&debugrva+&pathoffset)
+
+ ; elf base is baseofcode (we hope that for TE images it's not baseofdata)
+ &elfbase=&imgstart+Data.Long(a:&imgstart+0xc)-&strippedsize
+
+ print "found path &elfpath"
+ ; $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$;
+ ON ERROR GOSUB
+ return
+ data.load.elf &elfpath &elfbase /NOCODE /NOCLEAR
+ ON error
+
+enddo
|