TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbDisasmSupport.c File Reference
#include "Edb.h"

Go to the source code of this file.

Data Structures

struct  EDB_INSTRUCTION_STRING
 

Functions

VOID EdbSetOffset (IN UINTN InstructionNameOffset, IN UINTN InstructionContentOffset)
 
CHAR16 * EdbPreInstructionString (VOID)
 
CHAR16 * EdbPostInstructionString (VOID)
 
BOOLEAN EdbGetNaturalIndex16 (IN UINT16 Data16, OUT UINTN *NaturalUnits, OUT UINTN *ConstantUnits)
 
BOOLEAN EdbGetNaturalIndex32 (IN UINT32 Data32, OUT UINTN *NaturalUnits, OUT UINTN *ConstantUnits)
 
BOOLEAN EdbGetNaturalIndex64 (IN UINT64 Data64, OUT UINT64 *NaturalUnits, OUT UINT64 *ConstantUnits)
 
UINT8 EdbGetBitWidth (IN UINT64 Value)
 
UINTN EdbPrintInstructionName (IN CHAR16 *Name)
 
UINTN EdbPrintRegister1 (IN UINT8 Operands)
 
UINTN EdbPrintRegister2 (IN UINT8 Operands)
 
UINTN EdbPrintDedicatedRegister1 (IN UINT8 Operands)
 
UINTN EdbPrintDedicatedRegister2 (IN UINT8 Operands)
 
UINTN EdbPrintIndexData (IN BOOLEAN Sign, IN UINTN NaturalUnits, IN UINTN ConstantUnits)
 
UINTN EdbPrintIndexData64 (IN BOOLEAN Sign, IN UINT64 NaturalUnits, IN UINT64 ConstantUnits)
 
UINTN EdbPrintRawIndexData16 (IN UINT16 Data16)
 
UINTN EdbPrintRawIndexData32 (IN UINT32 Data32)
 
UINTN EdbPrintRawIndexData64 (IN UINT64 Data64)
 
UINTN EdbPrintImmData8 (IN UINT8 Data)
 
UINTN EdbPrintImmData16 (IN UINT16 Data)
 
UINTN EdbPrintImmData32 (IN UINT32 Data)
 
UINTN EdbPrintImmData64 (IN UINT64 Data)
 
UINTN EdbPrintImmDatan (IN UINTN Data)
 
UINTN EdbPrintImmData64n (IN UINT64 Data64)
 
UINTN EdbPrintData8 (IN UINT8 Data8)
 
UINTN EdbPrintData16 (IN UINT16 Data16)
 
UINTN EdbPrintData32 (IN UINT32 Data32)
 
UINTN EdbPrintData64 (IN UINT64 Data64)
 
UINTN EdbPrintDatan (IN UINTN Data)
 
UINTN EdbPrintData64n (IN UINT64 Data64)
 
UINTN EdbPrintData8s (IN UINT8 Data8)
 
UINTN EdbPrintData16s (IN UINT16 Data16)
 
UINTN EdbPrintData32s (IN UINT32 Data32)
 
UINTN EdbPrintData64s (IN UINT64 Data64)
 
UINTN EdbPrintComma (VOID)
 
UINTN EdbFindAndPrintSymbol (IN UINTN Address)
 
VOID EdbPrintRaw (IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN UINTN InstructionNumber)
 
EFI_STATUS EdbShowDisasm (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_SYSTEM_CONTEXT SystemContext)
 
UINT64 GetRegisterValue (IN EFI_SYSTEM_CONTEXT SystemContext, IN UINT8 Index)
 

Variables

EDB_DISASM_INSTRUCTION mEdbDisasmInstructionTable []
 
EDB_INSTRUCTION_STRING mInstructionString
 
UINTN mInstructionNameOffset
 
UINTN mInstructionContentOffset
 

Detailed Description

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

Definition in file EdbDisasmSupport.c.

Function Documentation

◆ EdbFindAndPrintSymbol()

UINTN EdbFindAndPrintSymbol ( IN UINTN  Address)

Find the symbol string according to address, then print it.

Parameters
Address- instruction address
Return values
1- symbol string is found and printed
0- symbol string not found

Definition at line 1015 of file EdbDisasmSupport.c.

◆ EdbGetBitWidth()

UINT8 EdbGetBitWidth ( IN UINT64  Value)

Get Bit Width of the value.

Parameters
Value- data
Returns
Bit width

Definition at line 193 of file EdbDisasmSupport.c.

◆ EdbGetNaturalIndex16()

BOOLEAN EdbGetNaturalIndex16 ( IN UINT16  Data16,
OUT UINTN NaturalUnits,
OUT UINTN ConstantUnits 
)

Get Sign, NaturalUnits, and ConstantUnits of the WORD data.

Parameters
Data16- WORD data
NaturalUnits- Natural Units of the WORD
ConstantUnits- Constant Units of the WORD
Returns
Sign value of WORD

Definition at line 102 of file EdbDisasmSupport.c.

◆ EdbGetNaturalIndex32()

BOOLEAN EdbGetNaturalIndex32 ( IN UINT32  Data32,
OUT UINTN NaturalUnits,
OUT UINTN ConstantUnits 
)

Get Sign, NaturalUnits, and ConstantUnits of the DWORD data.

Parameters
Data32- DWORD data
NaturalUnits- Natural Units of the DWORD
ConstantUnits- Constant Units of the DWORD
Returns
Sign value of DWORD

Definition at line 133 of file EdbDisasmSupport.c.

◆ EdbGetNaturalIndex64()

BOOLEAN EdbGetNaturalIndex64 ( IN UINT64  Data64,
OUT UINT64 *  NaturalUnits,
OUT UINT64 *  ConstantUnits 
)

Get Sign, NaturalUnits, and ConstantUnits of the QWORD data.

Parameters
Data64- QWORD data
NaturalUnits- Natural Units of the QWORD
ConstantUnits- Constant Units of the QWORD
Returns
Sign value of QWORD

Definition at line 164 of file EdbDisasmSupport.c.

◆ EdbPostInstructionString()

CHAR16 * EdbPostInstructionString ( VOID  )

Post instruction string construction.

Returns
Instruction string

Definition at line 70 of file EdbDisasmSupport.c.

◆ EdbPreInstructionString()

CHAR16 * EdbPreInstructionString ( VOID  )

Pre instruction string construction.

Returns
Instruction string

Definition at line 51 of file EdbDisasmSupport.c.

◆ EdbPrintComma()

UINTN EdbPrintComma ( VOID  )

Print the comma to instruction content.

Returns
Instruction content offset

Definition at line 989 of file EdbDisasmSupport.c.

◆ EdbPrintData16()

UINTN EdbPrintData16 ( IN UINT16  Data16)

Print the hexical WORD to instruction content.

Parameters
Data16- WORD data
Returns
Instruction content offset

Definition at line 735 of file EdbDisasmSupport.c.

◆ EdbPrintData16s()

UINTN EdbPrintData16s ( IN UINT16  Data16)

Print the decimal signed WORD to instruction content.

Parameters
Data16- signed WORD data
Returns
Instruction content offset

Definition at line 896 of file EdbDisasmSupport.c.

◆ EdbPrintData32()

UINTN EdbPrintData32 ( IN UINT32  Data32)

Print the hexical DWORD to instruction content.

Parameters
Data32- DWORD data
Returns
Instruction content offset

Definition at line 761 of file EdbDisasmSupport.c.

◆ EdbPrintData32s()

UINTN EdbPrintData32s ( IN UINT32  Data32)

Print the decimal signed DWORD to instruction content.

Parameters
Data32- signed DWORD data
Returns
Instruction content offset

Definition at line 927 of file EdbDisasmSupport.c.

◆ EdbPrintData64()

UINTN EdbPrintData64 ( IN UINT64  Data64)

Print the hexical QWORD to instruction content.

Parameters
Data64- QWORD data
Returns
Instruction content offset

Definition at line 787 of file EdbDisasmSupport.c.

◆ EdbPrintData64n()

UINTN EdbPrintData64n ( IN UINT64  Data64)

Print the decimal unsigned QWORD to instruction content.

Parameters
Data64- unsigned QWORD data
Returns
Instruction content offset

Definition at line 839 of file EdbDisasmSupport.c.

◆ EdbPrintData64s()

UINTN EdbPrintData64s ( IN UINT64  Data64)

Print the decimal signed QWORD to instruction content.

Parameters
Data64- signed QWORD data
Returns
Instruction content offset

Definition at line 958 of file EdbDisasmSupport.c.

◆ EdbPrintData8()

UINTN EdbPrintData8 ( IN UINT8  Data8)

Print the hexical BYTE to instruction content.

Parameters
Data8- BYTE data
Returns
Instruction content offset

Definition at line 709 of file EdbDisasmSupport.c.

◆ EdbPrintData8s()

UINTN EdbPrintData8s ( IN UINT8  Data8)

Print the decimal signed BYTE to instruction content.

Parameters
Data8- signed BYTE data
Returns
Instruction content offset

Definition at line 865 of file EdbDisasmSupport.c.

◆ EdbPrintDatan()

UINTN EdbPrintDatan ( IN UINTN  Data)

Print the decimal unsigned UINTN to instruction content.

Parameters
Data- unsigned UINTN data
Returns
Instruction content offset

Definition at line 813 of file EdbDisasmSupport.c.

◆ EdbPrintDedicatedRegister1()

UINTN EdbPrintDedicatedRegister1 ( IN UINT8  Operands)

Print dedicated register 1 in operands.

Parameters
Operands- instruction operands
Returns
Instruction content offset

Definition at line 336 of file EdbDisasmSupport.c.

◆ EdbPrintDedicatedRegister2()

UINTN EdbPrintDedicatedRegister2 ( IN UINT8  Operands)

Print dedicated register 2 in operands.

Parameters
Operands- instruction operands
Returns
Instruction content offset

Definition at line 374 of file EdbDisasmSupport.c.

◆ EdbPrintImmData16()

UINTN EdbPrintImmData16 ( IN UINT16  Data)

Print the hexical WORD immediate data to instruction content.

Parameters
Data- WORD data
Returns
Instruction content offset

Definition at line 579 of file EdbDisasmSupport.c.

◆ EdbPrintImmData32()

UINTN EdbPrintImmData32 ( IN UINT32  Data)

Print the hexical DWORD immediate data to instruction content.

Parameters
Data- DWORD data
Returns
Instruction content offset

Definition at line 605 of file EdbDisasmSupport.c.

◆ EdbPrintImmData64()

UINTN EdbPrintImmData64 ( IN UINT64  Data)

Print the hexical QWORD immediate data to instruction content.

Parameters
Data- QWORD data
Returns
Instruction content offset

Definition at line 631 of file EdbDisasmSupport.c.

◆ EdbPrintImmData64n()

UINTN EdbPrintImmData64n ( IN UINT64  Data64)

Print the decimal QWORD immediate data to instruction content.

Parameters
Data64- QWORD data
Returns
Instruction content offset

Definition at line 683 of file EdbDisasmSupport.c.

◆ EdbPrintImmData8()

UINTN EdbPrintImmData8 ( IN UINT8  Data)

Print the hexical BYTE immediate data to instruction content.

Parameters
Data- BYTE data
Returns
Instruction content offset

Definition at line 553 of file EdbDisasmSupport.c.

◆ EdbPrintImmDatan()

UINTN EdbPrintImmDatan ( IN UINTN  Data)

Print the decimal UINTN immediate data to instruction content.

Parameters
Data- UINTN data
Returns
Instruction content offset

Definition at line 657 of file EdbDisasmSupport.c.

◆ EdbPrintIndexData()

UINTN EdbPrintIndexData ( IN BOOLEAN  Sign,
IN UINTN  NaturalUnits,
IN UINTN  ConstantUnits 
)

Print the hexical UINTN index data to instruction content.

Parameters
Sign- Signed bit of UINTN data
NaturalUnits- natural units of UINTN data
ConstantUnits- natural units of UINTN data
Returns
Instruction content offset

Definition at line 414 of file EdbDisasmSupport.c.

◆ EdbPrintIndexData64()

UINTN EdbPrintIndexData64 ( IN BOOLEAN  Sign,
IN UINT64  NaturalUnits,
IN UINT64  ConstantUnits 
)

Print the hexical QWORD index data to instruction content.

Parameters
Sign- Signed bit of QWORD data
NaturalUnits- natural units of QWORD data
ConstantUnits- natural units of QWORD data
Returns
Instruction content offset

Definition at line 447 of file EdbDisasmSupport.c.

◆ EdbPrintInstructionName()

UINTN EdbPrintInstructionName ( IN CHAR16 *  Name)

Print the instruction name.

Parameters
Name- instruction name
Returns
Instruction name offset

Definition at line 238 of file EdbDisasmSupport.c.

◆ EdbPrintRaw()

VOID EdbPrintRaw ( IN EFI_PHYSICAL_ADDRESS  InstructionAddress,
IN UINTN  InstructionNumber 
)

Print the EBC byte code.

Parameters
InstructionAddress- instruction address
InstructionNumber- instruction number

Definition at line 1045 of file EdbDisasmSupport.c.

◆ EdbPrintRawIndexData16()

UINTN EdbPrintRawIndexData16 ( IN UINT16  Data16)

Print the hexical WORD raw index data to instruction content.

Parameters
Data16- WORD data
Returns
Instruction content offset

Definition at line 478 of file EdbDisasmSupport.c.

◆ EdbPrintRawIndexData32()

UINTN EdbPrintRawIndexData32 ( IN UINT32  Data32)

Print the hexical DWORD raw index data to instruction content.

Parameters
Data32- DWORD data
Returns
Instruction content offset

Definition at line 503 of file EdbDisasmSupport.c.

◆ EdbPrintRawIndexData64()

UINTN EdbPrintRawIndexData64 ( IN UINT64  Data64)

Print the hexical QWORD raw index data to instruction content.

Parameters
Data64- QWORD data
Returns
Instruction content offset

Definition at line 528 of file EdbDisasmSupport.c.

◆ EdbPrintRegister1()

UINTN EdbPrintRegister1 ( IN UINT8  Operands)

Print register 1 in operands.

Parameters
Operands- instruction operands
Returns
Instruction content offset

Definition at line 264 of file EdbDisasmSupport.c.

◆ EdbPrintRegister2()

UINTN EdbPrintRegister2 ( IN UINT8  Operands)

Print register 2 in operands.

Parameters
Operands- instruction operands
Returns
Instruction content offset

Definition at line 300 of file EdbDisasmSupport.c.

◆ EdbSetOffset()

VOID EdbSetOffset ( IN UINTN  InstructionNameOffset,
IN UINTN  InstructionContentOffset 
)

Set offset for Instruction name and content.

Parameters
InstructionNameOffset- Instruction name offset
InstructionContentOffset- Instruction content offset

Definition at line 32 of file EdbDisasmSupport.c.

◆ EdbShowDisasm()

EFI_STATUS EdbShowDisasm ( IN EFI_DEBUGGER_PRIVATE_DATA DebuggerPrivate,
IN EFI_SYSTEM_CONTEXT  SystemContext 
)

Print the EBC asm code.

Parameters
DebuggerPrivate- EBC Debugger private data structure
SystemContext- EBC system context.
Return values
EFI_SUCCESS- show disasm successfully

Definition at line 1109 of file EdbDisasmSupport.c.

◆ GetRegisterValue()

UINT64 GetRegisterValue ( IN EFI_SYSTEM_CONTEXT  SystemContext,
IN UINT8  Index 
)

Get register value according to the system context, and register index.

Parameters
SystemContext- EBC system context.
Index- EBC register index
Returns
register value

Definition at line 1188 of file EdbDisasmSupport.c.

Variable Documentation

◆ mEdbDisasmInstructionTable

EDB_DISASM_INSTRUCTION mEdbDisasmInstructionTable[]
extern

Definition at line 47 of file EdbDisasm.c.

◆ mInstructionContentOffset

UINTN mInstructionContentOffset

Definition at line 21 of file EdbDisasmSupport.c.

◆ mInstructionNameOffset

UINTN mInstructionNameOffset

Definition at line 20 of file EdbDisasmSupport.c.

◆ mInstructionString

EDB_INSTRUCTION_STRING mInstructionString

Definition at line 19 of file EdbDisasmSupport.c.