mirror of
				https://git.proxmox.com/git/mirror_edk2
				synced 2025-10-31 15:06:49 +00:00 
			
		
		
		
	 98790d8148
			
		
	
	
		98790d8148
		
	
	
	
	
		
			
			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
		
			
				
	
	
		
			78 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
| ;
 | |
| ; 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 &filehdrstart &debugdirentryrva &debugtype &debugrva &dwarfsig &baseofcode &baseofdata &elfbase &elfpath &pathoffset
 | |
|   ENTRY &imgstart
 | |
| 
 | |
|   &imgstart=&imgstart
 | |
|   print "PE32 image found at &imgstart"
 | |
| 
 | |
|   ; offset from dos hdr to PE file hdr
 | |
|   &filehdrstart=&imgstart+Data.Long(c:&imgstart+0x3C)
 | |
| 
 | |
|   ; offset to debug dir in PE hdrs
 | |
|   &debugdirentryrva=Data.Long(c:&filehdrstart+0xA8)
 | |
|   if &debugdirentryrva==0
 | |
|   (
 | |
|     print "no debug dir for image at &imgstart"
 | |
|     enddo
 | |
|   )
 | |
|   
 | |
|   &debugtype=Data.Long(c:&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(c:&imgstart+&debugdirentryrva+0x14)
 | |
|   &dwarfsig=Data.Long(c:&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)
 | |
| 
 | |
|   &baseofcode=&imgstart+Data.Long(c:&filehdrstart+0x28)
 | |
|   &baseofdata=&imgstart+Data.Long(c:&filehdrstart+0x2c)
 | |
|  
 | |
|   if (&baseofcode<&baseofdata)&&(&baseofcode!=0)
 | |
|   (
 | |
|     &elfbase=&baseofcode;
 | |
|   )
 | |
|   else
 | |
|   (
 | |
|     &elfbase=&baseofdata;
 | |
|   )
 | |
| 
 | |
|   print "found path &elfpath"
 | |
|         ON ERROR GOSUB
 | |
|               return
 | |
|   data.load.elf &elfpath &elfbase /NOCODE /NOCLEAR
 | |
|         ON error
 | |
| 
 | |
| enddo
 |