3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _EFI_EDB_SUPPORT_H_
10 #define _EFI_EDB_SUPPORT_H_
14 #define EFI_DEBUG_PROMPT_STRING L"EDB > "
15 #define EFI_DEBUG_PROMPT_COLUMN 5
16 #define EFI_DEBUG_INPUS_BUFFER_SIZE 64
18 #define EFI_DEBUGGER_LINE_NUMBER_IN_PAGE 0x10
20 #define EFI_DEBUG_MAX_PRINT_BUFFER (80 * 4)
24 Convert hex string to uint.
26 @param Str - The string
37 Convert hex string to uint.
39 @param Str - The string
50 Convert hex string to uint.
52 @param Str - The string
63 Convert hex string to uint.
65 @param Str - The string
76 Convert hex string to uint.
78 @param Str - The string
88 Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
90 @param String - Unicode String to process
92 @param String2 - Ascii string to process
94 @return Return a positive integer if String is lexicall greater than String2; Zero if
95 the two strings are identical; and a negative interger if String is lexically
101 StrCmpUnicodeAndAscii (
108 Compare the Unicode string pointed by String to the string pointed by String2.
110 @param String - Unicode String to process
111 @param String2 - Unicode string to process
113 @return Return a positive integer if String is lexically greater than String2; Zero if
114 the two strings are identical; and a negative integer if String is lexically
127 Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
129 @param String - Unicode String to process
130 @param String2 - Ascii string to process
132 @return Return a positive integer if String is lexically greater than String2; Zero if
133 the two strings are identical; and a negative integer if String is lexically
139 StriCmpUnicodeAndAscii (
146 Verify if the string is end with the sub string.
148 @param Str - The string where to search the sub string
149 @param SubStr - The substring.
162 @param Src The string to be duplicated.
173 Find the next token after one or more specified characters.
175 @param String Point to the string where to find the substring.
176 @param CharSet Point to the string to be found.
188 Find the next token after one or more specified characters.
190 @param CharSet Point to the string to be found.
195 StrGetNextTokenLine (
201 Find the next token after one specificed characters.
203 @param String Point to the string where to find the substring.
204 @param CharSet Point to the string to be found.
209 StrGetNewTokenField (
216 Find the next token after one specificed characters.
218 @param CharSet Point to the string to be found.
223 StrGetNextTokenField (
229 Patch a character to the end of a string.
231 @param Buffer The string to be patched.
232 @param Patch The patch character.
237 PatchForStrTokenAfter (
243 Patch a character at the beginning of a string.
245 @param Buffer The string to be patched.
246 @param Patch The patch character.
251 PatchForStrTokenBefore (
258 Find the next token after one or more specified characters.
260 @param String Point to the string where to find the substring.
261 @param CharSet Point to the string to be found.
266 AsciiStrGetNewTokenLine (
273 Find the next token after one or more specified characters.
275 @param CharSet Point to the string to be found.
280 AsciiStrGetNextTokenLine (
286 Find the next token after one specificed characters.
288 @param String Point to the string where to find the substring.
289 @param CharSet Point to the string to be found.
294 AsciiStrGetNewTokenField (
301 Find the next token after one specificed characters.
303 @param CharSet Point to the string to be found.
308 AsciiStrGetNextTokenField (
314 Patch a character to the end of a string.
316 @param Buffer The string to be patched.
317 @param Patch The patch character.
322 PatchForAsciiStrTokenAfter (
328 Patch a character at the beginning of a string.
330 @param Buffer The string to be patched.
331 @param Patch The patch character.
336 PatchForAsciiStrTokenBefore (
346 @param Prompt The prompt string.
347 @param InStr Point to the input string.
348 @param StrLen The max length of string user can input.
354 IN CHAR16
*Prompt OPTIONAL
,
371 Print a Unicode string to the output device.
373 @param Format A Null-terminated Unicode format string.
374 @param ... The variable argument list that contains pointers to Null-
375 terminated Unicode strings to be printed
381 IN CONST CHAR16
*Format
,
386 Print a Unicode string to the output buffer.
388 @param Buffer A pointer to the output buffer for the produced Null-terminated
390 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
391 @param Format A Null-terminated Unicode format string.
392 @param ... The variable argument list that contains pointers to Null-
393 terminated Unicode strings to be printed
401 IN CONST CHAR16
*Format
,
406 Print a Unicode string to the output buffer with specified offset..
408 @param Buffer A pointer to the output buffer for the produced Null-terminated
410 @param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
411 @param Offset The offset of the buffer.
412 @param Format A Null-terminated Unicode format string.
413 @param ... The variable argument list that contains pointers to Null-
414 terminated Unicode strings to be printed
419 EDBSPrintWithOffset (
423 IN CONST CHAR16
*Format
,
430 If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs.
431 If ScanFs is TRUE, it will scan all FS and check the file.
432 If there is only one file match the name, it will be read.
433 If there is more than one file match the name, it will return Error.
435 @param DebuggerPrivate - EBC Debugger private data structure
436 @param FileName - The file to be read.
437 @param BufferSize - The file buffer size
438 @param Buffer - The file buffer
439 @param ScanFs - Need Scan all FS
441 @retval EFI_SUCCESS - read file successfully
442 @retval EFI_NOT_FOUND - file not found
443 @retval EFI_NO_MAPPING - there is duplicated files found
449 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,
451 OUT UINTN
*BufferSize
,
458 Get file name under this dir with index
460 @param DebuggerPrivate - EBC Debugger private data structure
461 @param DirName - The dir to be read.
462 @param FileName - The file name pattern under this dir
463 @param Index - The file index under this dir
465 @return File Name which match the pattern and index.
470 GetFileNameUnderDir (
471 IN EFI_DEBUGGER_PRIVATE_DATA
*DebuggerPrivate
,