TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbSupport.h File Reference
#include <Uefi.h>

Go to the source code of this file.

Macros

#define EFI_DEBUG_PROMPT_STRING   L"EDB > "
 
#define EFI_DEBUG_PROMPT_COLUMN   5
 
#define EFI_DEBUG_INPUS_BUFFER_SIZE   64
 
#define EFI_DEBUGGER_LINE_NUMBER_IN_PAGE   0x10
 
#define EFI_DEBUG_MAX_PRINT_BUFFER   (80 * 4)
 

Functions

UINTN EFIAPI Xtoi (CHAR16 *Str)
 
UINT64 EFIAPI LXtoi (CHAR16 *Str)
 
UINTN EFIAPI Atoi (CHAR16 *Str)
 
UINTN EFIAPI AsciiXtoi (CHAR8 *Str)
 
UINTN EFIAPI AsciiAtoi (CHAR8 *Str)
 
INTN EFIAPI StrCmpUnicodeAndAscii (IN CHAR16 *String, IN CHAR8 *String2)
 
INTN EFIAPI StriCmp (IN CHAR16 *String, IN CHAR16 *String2)
 
INTN EFIAPI StriCmpUnicodeAndAscii (IN CHAR16 *String, IN CHAR8 *String2)
 
BOOLEAN EFIAPI StrEndWith (IN CHAR16 *Str, IN CHAR16 *SubStr)
 
CHAR16 *EFIAPI StrDuplicate (IN CHAR16 *Src)
 
CHAR16 *EFIAPI StrGetNewTokenLine (IN CHAR16 *String, IN CHAR16 *CharSet)
 
CHAR16 *EFIAPI StrGetNextTokenLine (IN CHAR16 *CharSet)
 
CHAR16 *EFIAPI StrGetNewTokenField (IN CHAR16 *String, IN CHAR16 *CharSet)
 
CHAR16 *EFIAPI StrGetNextTokenField (IN CHAR16 *CharSet)
 
VOID EFIAPI PatchForStrTokenAfter (IN CHAR16 *Buffer, IN CHAR16 Patch)
 
VOID EFIAPI PatchForStrTokenBefore (IN CHAR16 *Buffer, IN CHAR16 Patch)
 
CHAR8 *EFIAPI AsciiStrGetNewTokenLine (IN CHAR8 *String, IN CHAR8 *CharSet)
 
CHAR8 *EFIAPI AsciiStrGetNextTokenLine (IN CHAR8 *CharSet)
 
CHAR8 *EFIAPI AsciiStrGetNewTokenField (IN CHAR8 *String, IN CHAR8 *CharSet)
 
CHAR8 *EFIAPI AsciiStrGetNextTokenField (IN CHAR8 *CharSet)
 
VOID EFIAPI PatchForAsciiStrTokenAfter (IN CHAR8 *Buffer, IN CHAR8 Patch)
 
VOID EFIAPI PatchForAsciiStrTokenBefore (IN CHAR8 *Buffer, IN CHAR8 Patch)
 
VOID EFIAPI Input (IN CHAR16 *Prompt OPTIONAL, OUT CHAR16 *InStr, IN UINTN StrLen)
 
BOOLEAN EFIAPI SetPageBreak (VOID)
 
UINTN EFIAPI EDBPrint (IN CONST CHAR16 *Format,...)
 
UINTN EFIAPI EDBSPrint (OUT CHAR16 *Buffer, IN INTN BufferSize, IN CONST CHAR16 *Format,...)
 
UINTN EFIAPI EDBSPrintWithOffset (OUT CHAR16 *Buffer, IN INTN BufferSize, IN UINTN Offset, IN CONST CHAR16 *Format,...)
 
EFI_STATUS EFIAPI ReadFileToBuffer (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, OUT UINTN *BufferSize, OUT VOID **Buffer, IN BOOLEAN ScanFs)
 
CHAR16 *EFIAPI GetFileNameUnderDir (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *DirName, IN CHAR16 *FileName, IN OUT UINTN *Index)
 

Detailed Description

Copyright (c) 2007, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EdbSupport.h.

Macro Definition Documentation

◆ EFI_DEBUG_INPUS_BUFFER_SIZE

#define EFI_DEBUG_INPUS_BUFFER_SIZE   64

Definition at line 16 of file EdbSupport.h.

◆ EFI_DEBUG_MAX_PRINT_BUFFER

#define EFI_DEBUG_MAX_PRINT_BUFFER   (80 * 4)

Definition at line 20 of file EdbSupport.h.

◆ EFI_DEBUG_PROMPT_COLUMN

#define EFI_DEBUG_PROMPT_COLUMN   5

Definition at line 15 of file EdbSupport.h.

◆ EFI_DEBUG_PROMPT_STRING

#define EFI_DEBUG_PROMPT_STRING   L"EDB > "

Definition at line 14 of file EdbSupport.h.

◆ EFI_DEBUGGER_LINE_NUMBER_IN_PAGE

#define EFI_DEBUGGER_LINE_NUMBER_IN_PAGE   0x10

Definition at line 18 of file EdbSupport.h.

Function Documentation

◆ AsciiAtoi()

UINTN EFIAPI AsciiAtoi ( CHAR8 *  Str)

Convert hex string to uint.

Parameters
Str- The string

Definition at line 273 of file EdbSupportString.c.

◆ AsciiStrGetNewTokenField()

CHAR8 *EFIAPI AsciiStrGetNewTokenField ( IN CHAR8 *  String,
IN CHAR8 *  CharSet 
)

Find the next token after one specificed characters.

Parameters
StringPoint to the string where to find the substring.
CharSetPoint to the string to be found.

Definition at line 939 of file EdbSupportString.c.

◆ AsciiStrGetNewTokenLine()

CHAR8 *EFIAPI AsciiStrGetNewTokenLine ( IN CHAR8 *  String,
IN CHAR8 *  CharSet 
)

Find the next token after one or more specified characters.

Parameters
StringPoint to the string where to find the substring.
CharSetPoint to the string to be found.

Definition at line 905 of file EdbSupportString.c.

◆ AsciiStrGetNextTokenField()

CHAR8 *EFIAPI AsciiStrGetNextTokenField ( IN CHAR8 *  CharSet)

Find the next token after one specificed characters.

Parameters
CharSetPoint to the string to be found.

Definition at line 956 of file EdbSupportString.c.

◆ AsciiStrGetNextTokenLine()

CHAR8 *EFIAPI AsciiStrGetNextTokenLine ( IN CHAR8 *  CharSet)

Find the next token after one or more specified characters.

Parameters
CharSetPoint to the string to be found.

Definition at line 922 of file EdbSupportString.c.

◆ AsciiXtoi()

UINTN EFIAPI AsciiXtoi ( CHAR8 *  Str)

Convert hex string to uint.

Parameters
Str- The string

Definition at line 206 of file EdbSupportString.c.

◆ Atoi()

UINTN EFIAPI Atoi ( CHAR16 *  Str)

Convert hex string to uint.

Parameters
Str- The string

Definition at line 155 of file EdbSupportString.c.

◆ EDBPrint()

UINTN EFIAPI EDBPrint ( IN CONST CHAR16 *  Format,
  ... 
)

Print a Unicode string to the output device.

Parameters
FormatA Null-terminated Unicode format string.
...The variable argument list that contains pointers to Null- terminated Unicode strings to be printed

Definition at line 683 of file EdbSupportUI.c.

◆ EDBSPrint()

UINTN EFIAPI EDBSPrint ( OUT CHAR16 *  Buffer,
IN INTN  BufferSize,
IN CONST CHAR16 *  Format,
  ... 
)

Print a Unicode string to the output buffer.

Parameters
BufferA pointer to the output buffer for the produced Null-terminated Unicode string.
BufferSizeThe size, in bytes, of the output buffer specified by StartOfBuffer.
FormatA Null-terminated Unicode format string.
...The variable argument list that contains pointers to Null- terminated Unicode strings to be printed

Definition at line 719 of file EdbSupportUI.c.

◆ EDBSPrintWithOffset()

UINTN EFIAPI EDBSPrintWithOffset ( OUT CHAR16 *  Buffer,
IN INTN  BufferSize,
IN UINTN  Offset,
IN CONST CHAR16 *  Format,
  ... 
)

Print a Unicode string to the output buffer with specified offset..

Parameters
BufferA pointer to the output buffer for the produced Null-terminated Unicode string.
BufferSizeThe size, in bytes, of the output buffer specified by StartOfBuffer.
OffsetThe offset of the buffer.
FormatA Null-terminated Unicode format string.
...The variable argument list that contains pointers to Null- terminated Unicode strings to be printed

Definition at line 752 of file EdbSupportUI.c.

◆ GetFileNameUnderDir()

CHAR16 *EFIAPI GetFileNameUnderDir ( IN EFI_DEBUGGER_PRIVATE_DATA DebuggerPrivate,
IN CHAR16 *  DirName,
IN CHAR16 *  FileName,
IN OUT UINTN Index 
)

Get file name under this dir with index

Parameters
DebuggerPrivate- EBC Debugger private data structure
DirName- The dir to be read.
FileName- The file name pattern under this dir
Index- The file index under this dir
Returns
File Name which match the pattern and index.

Definition at line 265 of file EdbSupportFile.c.

◆ Input()

VOID EFIAPI Input ( IN CHAR16 *Prompt  OPTIONAL,
OUT CHAR16 *  InStr,
IN UINTN  StrLength 
)

Shell Library. Get user input.

Parameters
PromptThe prompt string.
InStrPoint to the input string.
StrLenThe max length of string user can input.

Get user input.

Parameters
PromptThe prompt string.
InStrPoint to the input string.
StrLengthThe max length of string user can input.

Definition at line 187 of file EdbSupportUI.c.

◆ LXtoi()

UINT64 EFIAPI LXtoi ( CHAR16 *  Str)

Convert hex string to uint.

Parameters
Str- The string

Definition at line 87 of file EdbSupportString.c.

◆ PatchForAsciiStrTokenAfter()

VOID EFIAPI PatchForAsciiStrTokenAfter ( IN CHAR8 *  Buffer,
IN CHAR8  Patch 
)

Patch a character to the end of a string.

Parameters
BufferThe string to be patched.
PatchThe patch character.

Definition at line 973 of file EdbSupportString.c.

◆ PatchForAsciiStrTokenBefore()

VOID EFIAPI PatchForAsciiStrTokenBefore ( IN CHAR8 *  Buffer,
IN CHAR8  Patch 
)

Patch a character at the beginning of a string.

Parameters
BufferThe string to be patched.
PatchThe patch character.

Definition at line 1011 of file EdbSupportString.c.

◆ PatchForStrTokenAfter()

VOID EFIAPI PatchForStrTokenAfter ( IN CHAR16 *  Buffer,
IN CHAR16  Patch 
)

Patch a character to the end of a string.

Parameters
BufferThe string to be patched.
PatchThe patch character.

Definition at line 687 of file EdbSupportString.c.

◆ PatchForStrTokenBefore()

VOID EFIAPI PatchForStrTokenBefore ( IN CHAR16 *  Buffer,
IN CHAR16  Patch 
)

Patch a character at the beginning of a string.

Parameters
BufferThe string to be patched.
PatchThe patch character.

Definition at line 725 of file EdbSupportString.c.

◆ ReadFileToBuffer()

EFI_STATUS EFIAPI ReadFileToBuffer ( IN EFI_DEBUGGER_PRIVATE_DATA DebuggerPrivate,
IN CHAR16 *  FileName,
OUT UINTN BufferSize,
OUT VOID **  Buffer,
IN BOOLEAN  ScanFs 
)

Read a file. If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs. If ScanFs is TRUE, it will scan all FS and check the file. If there is only one file match the name, it will be read. If there is more than one file match the name, it will return Error.

Parameters
DebuggerPrivate- EBC Debugger private data structure
FileName- The file to be read.
BufferSize- The file buffer size
Buffer- The file buffer
ScanFs- Need Scan all FS
Return values
EFI_SUCCESS- read file successfully
EFI_NOT_FOUND- file not found
EFI_NO_MAPPING- there is duplicated files found

Definition at line 143 of file EdbSupportFile.c.

◆ SetPageBreak()

BOOLEAN EFIAPI SetPageBreak ( VOID  )

SetPageBreak.

Definition at line 605 of file EdbSupportUI.c.

◆ StrCmpUnicodeAndAscii()

INTN EFIAPI StrCmpUnicodeAndAscii ( IN CHAR16 *  String,
IN CHAR8 *  String2 
)

Compare the Unicode and Ascii string pointed by String to the string pointed by String2.

Parameters
String- Unicode String to process
String2- Ascii string to process
Returns
Return a positive integer if String is lexicall greater than String2; Zero if the two strings are identical; and a negative interger if String is lexically less than String2.

Definition at line 329 of file EdbSupportString.c.

◆ StrDuplicate()

CHAR16 *EFIAPI StrDuplicate ( IN CHAR16 *  Src)

Duplicate a string.

Parameters
SrcThe string to be duplicated.

Definition at line 445 of file EdbSupportString.c.

◆ StrEndWith()

BOOLEAN EFIAPI StrEndWith ( IN CHAR16 *  Str,
IN CHAR16 *  SubStr 
)

Verify if the string is end with the sub string.

Parameters
Str- The string where to search the sub string
SubStr- The substring.

Definition at line 414 of file EdbSupportString.c.

◆ StrGetNewTokenField()

CHAR16 *EFIAPI StrGetNewTokenField ( IN CHAR16 *  String,
IN CHAR16 *  CharSet 
)

Find the next token after one specificed characters.

Parameters
StringPoint to the string where to find the substring.
CharSetPoint to the string to be found.

Definition at line 653 of file EdbSupportString.c.

◆ StrGetNewTokenLine()

CHAR16 *EFIAPI StrGetNewTokenLine ( IN CHAR16 *  String,
IN CHAR16 *  CharSet 
)

Find the next token after one or more specified characters.

Parameters
StringPoint to the string where to find the substring.
CharSetPoint to the string to be found.

Definition at line 619 of file EdbSupportString.c.

◆ StrGetNextTokenField()

CHAR16 *EFIAPI StrGetNextTokenField ( IN CHAR16 *  CharSet)

Find the next token after one specificed characters.

Parameters
CharSetPoint to the string to be found.

Definition at line 670 of file EdbSupportString.c.

◆ StrGetNextTokenLine()

CHAR16 *EFIAPI StrGetNextTokenLine ( IN CHAR16 *  CharSet)

Find the next token after one or more specified characters.

Parameters
CharSetPoint to the string to be found.

Definition at line 636 of file EdbSupportString.c.

◆ StriCmp()

INTN EFIAPI StriCmp ( IN CHAR16 *  String,
IN CHAR16 *  String2 
)

Compare the Unicode string pointed by String to the string pointed by String2.

Parameters
String- Unicode String to process
String2- Unicode string to process
Returns
Return a positive integer if String is lexically greater than String2; Zero if the two strings are identical; and a negative integer if String is lexically less than String2.

Definition at line 360 of file EdbSupportString.c.

◆ StriCmpUnicodeAndAscii()

INTN EFIAPI StriCmpUnicodeAndAscii ( IN CHAR16 *  String,
IN CHAR8 *  String2 
)

Compare the Unicode and Ascii string pointed by String to the string pointed by String2.

Parameters
String- Unicode String to process
String2- Ascii string to process
Returns
Return a positive integer if String is lexically greater than String2; Zero if the two strings are identical; and a negative integer if String is lexically less than String2.

Definition at line 389 of file EdbSupportString.c.

◆ Xtoi()

UINTN EFIAPI Xtoi ( CHAR16 *  Str)

Convert hex string to uint.

Parameters
Str- The string

Definition at line 20 of file EdbSupportString.c.