3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _EFI_EDB_SYMBOL_H_
16 #define _EFI_EDB_SYMBOL_H_
21 // The default base address is 0x10000000
23 #define EFI_DEBUGGER_DEFAULT_LINK_IMAGEBASE 0x10000000
25 #define EFI_DEBUGGER_MAX_SYMBOL_ADDRESS_DELTA_VALUE 0x100000 // 1 M delta
28 EdbMatchSymbolTypeSameAdderss
,
29 EdbMatchSymbolTypeNearestAddress
,
30 EdbMatchSymbolTypeLowerAddress
,
31 EdbMatchSymbolTypeUpperAddress
,
32 EdbMatchSymbolTypeMax
,
33 } EDB_MATCH_SYMBOL_TYPE
;
36 EdbEbcImageRvaSearchTypeAny
,
37 EdbEbcImageRvaSearchTypeFirst
,
38 EdbEbcImageRvaSearchTypeLast
,
39 EdbEbcImageRvaSearchTypeMax
,
40 } EDB_EBC_IMAGE_RVA_SEARCH_TYPE
;
44 Find symbol by address.
46 @param Address - Symbol address
47 @param Type - Search type
48 @param RetObject - Symbol object
49 @param RetEntry - Symbol entry
51 @return Nearest symbol address
55 EbdFindSymbolAddress (
57 IN EDB_MATCH_SYMBOL_TYPE Type
,
58 OUT EFI_DEBUGGER_SYMBOL_OBJECT
**Object
,
59 OUT EFI_DEBUGGER_SYMBOL_ENTRY
**Entry
64 Load symbol file by name.
66 @param DebuggerPrivate - EBC Debugger private data structure
67 @param FileName - Symbol file name
68 @param BufferSize - Symbol file buffer size
69 @param Buffer - Symbol file buffer
71 @retval EFI_SUCCESS - load symbol successfully
76 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
84 Unload symbol file by name.
86 @param DebuggerPrivate - EBC Debugger private data structure
87 @param FileName - Symbol file name
89 @retval EFI_SUCCESS - unload symbol successfully
94 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
102 @param DebuggerPrivate - EBC Debugger private data structure
103 @param FileName - Symbol file name
104 @param SearchType - Search type for Object
106 @retval EFI_SUCCESS - Patch symbol RVA successfully
107 @retval EFI_NOT_FOUND - Symbol RVA base not found
112 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
114 IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType
121 @param DebuggerPrivate - EBC Debugger private data structure
122 @param MapFileName - Symbol file name
123 @param FileName - Code file name
124 @param BufferSize - Code file buffer size
125 @param Buffer - Code file buffer
127 @retval EFI_SUCCESS - Code loaded successfully
132 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
133 IN CHAR16
*MapFileName
,
143 @param DebuggerPrivate - EBC Debugger private data structure
144 @param MapFileName - Symbol file name
145 @param FileName - Code file name
146 @param Buffer - Code file buffer
148 @retval EFI_SUCCESS - Code unloaded successfully
153 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
154 IN CHAR16
*MapFileName
,
163 @param DebuggerPrivate - EBC Debugger private data structure
164 @param MapFileName - Symbol file name
165 @param CodeFileName - Code file name
166 @param SourceBufferSize- Code buffer size
167 @param SourceBuffer - Code buffer
169 @retval EFI_SUCCESS - CodeBuffer added successfully
174 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
175 IN CHAR16
*MapFileName
,
176 IN CHAR16
*CodeFileName
,
177 IN UINTN SourceBufferSize
,
178 IN VOID
*SourceBuffer
185 @param DebuggerPrivate - EBC Debugger private data structure
186 @param MapFileName - Symbol file name
187 @param CodeFileName - Code file name
188 @param SourceBuffer - Code buffer
190 @retval EFI_SUCCESS - CodeBuffer deleted successfully
194 EdbDeleteCodeBuffer (
195 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
196 IN CHAR16
*MapFileName
,
197 IN CHAR16
*CodeFileName
,
198 IN VOID
*SourceBuffer
203 Find the symbol string according to address.
205 @param Address - Symbol address
207 @return Symbol string
219 @param Address - Instruction address
220 @param IsPrint - Whether need to print
222 @retval 1 - find the source
223 @retval 0 - not find the source
234 Convert a symbol to an address.
236 @param Symbol - Symbol name
237 @param Address - Symbol address
239 @retval EFI_SUCCESS - symbol found and address returned.
240 @retval EFI_NOT_FOUND - symbol not found
241 @retval EFI_NO_MAPPING - duplicated symbol not found