10#ifndef __GDB_STUB_INTERNAL__
11#define __GDB_STUB_INTERNAL__
31extern CONST CHAR8 mHexToStr[];
35#define MAX_BUF_SIZE 2000
38#define MAX_ADDR_SIZE 32
41#define MAX_REG_NUM_BUF_SIZE 32
44#define MAX_LENGTH_SIZE 32
47#define MAX_T_SIGNAL_SIZE 64
50#define TF_BIT 0x00000100
65#define GDB_EBADMEMADDRBUFSIZE 11
66#define GDB_EBADMEMLENGBUFSIZE 12
67#define GDB_EBADMEMLENGTH 13
68#define GDB_EBADMEMDATA 14
69#define GDB_EBADMEMDATASIZE 15
70#define GDB_EBADBUFSIZE 21
71#define GDB_EINVALIDARG 31
72#define GDB_ENOSPACE 41
73#define GDB_EINVALIDBRKPOINTTYPE 51
74#define GDB_EINVALIDREGNUM 61
75#define GDB_EUNKNOWN 255
81#define GDB_STDOUT 0x01
82#define GDB_STDERR 0x02
87#if defined (MDE_CPU_IA32)
89#elif defined (MDE_CPU_X64)
91#elif defined (MDE_CPU_ARM)
95#define GDB_SERIAL_DEV_SIGNATURE SIGNATURE_32 ('g', 'd', 'b', 's')
118 INTN InFileDescriptor;
119 INTN OutFileDescriptor;
122#define GDB_SERIAL_DEV_FROM_THIS(a) CR (a, GDB_SERIAL_DEV, SerialIo, GDB_SERIAL_DEV_SIGNATURE)
129#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
142 UINT32 Reserved_1 : 9;
146 UINT32 Reserved_2 : 16;
168 UINT32 Reserved_1 : 3;
170 UINT32 Reserved_2 : 2;
186 InstructionExecution,
203extern BOOLEAN gCtrlCBreakFlag;
210extern BOOLEAN gProcessingFPacket;
215extern UINTN gRegisterOffsets[];
259 IN UINT8 GdbExceptionType
561 OUT CHAR8 *PacketData,
643 IN CHAR8 *PacketData,
UINTN MaxEfiException(VOID)
UINT8 ConvertEFItoGDBtype(IN EFI_EXCEPTION_TYPE EFIExceptionType)
VOID EFIAPI RemoveBreakPoint(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *PacketData)
VOID EFIAPI WriteToMemory(IN CHAR8 *PacketData)
UINTN MaxRegisterCount(VOID)
VOID EFIAPI WriteGeneralRegisters(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *InBuffer)
VOID GdbInitializeSerialConsole(VOID)
CHAR8 * BasicReadRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN RegNumber, IN CHAR8 *OutBufPtr)
BREAK_TYPE GetBreakpointType(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN BreakpointNumber)
VOID EFIAPI InsertBreakPoint(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *PacketData)
VOID TransferFromInBufToMem(IN UINTN Length, IN UINT8 *Address, IN CHAR8 *NewData)
VOID ReadNthRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *InBuffer)
CHAR8 * BasicWriteRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN RegNumber, IN CHAR8 *InBufPtr)
UINTN ParseBreakpointPacket(IN CHAR8 *PacketData, OUT UINTN *Type, OUT UINTN *Address, OUT UINTN *Length)
VOID EFIAPI SendNotSupported(VOID)
BOOLEAN CheckIsa(IN EFI_INSTRUCTION_SET_ARCHITECTURE Isa)
VOID EFIAPI ReadGeneralRegisters(IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI WriteNthRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *InBuffer)
UINTN ConvertLengthData(IN UINTN Length)
VOID EFIAPI GdbExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
UINTN SendPacket(IN CHAR8 *PacketData)
EFI_STATUS FindMatchingDebugRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN Address, IN UINTN Length, IN UINTN Type, OUT UINTN *Register)
VOID RemoveSingleStep(IN EFI_SYSTEM_CONTEXT SystemContext)
VOID AddSingleStep(IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI SingleStep(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *PacketData)
VOID EFIAPI SendSuccess(VOID)
UINTN GetBreakpointDataAddress(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN BreakpointNumber)
EFI_STATUS DisableDebugRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN Register)
INTN GdbWrite(IN INTN FileDescriptor, OUT CONST VOID *Buffer, IN UINTN Count)
VOID GdbSendTSignal(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINT8 GdbExceptionType)
VOID EmptyBuffer(IN CHAR8 *Buf)
UINTN ReceivePacket(OUT CHAR8 *PacketData, IN UINTN PacketDataSize)
INTN HexCharToInt(IN CHAR8 Char)
EFI_STATUS EnableDebugRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN Register, IN UINTN Address, IN UINTN Length, IN UINTN Type)
INTN GdbRead(IN INTN FileDescriptor, OUT VOID *Buffer, IN UINTN Count)
VOID EFIAPI ReadFromMemory(IN CHAR8 *PacketData)
EFI_STATUS FindNextFreeDebugRegister(IN EFI_SYSTEM_CONTEXT SystemContext, OUT UINTN *Register)
UINTN * FindPointerToRegister(IN EFI_SYSTEM_CONTEXT SystemContext, IN UINTN RegNumber)
VOID EFIAPI SendError(IN UINT8 ErrorNum)
UINTN GetBreakpointDetected(IN EFI_SYSTEM_CONTEXT SystemContext)
VOID EFIAPI GdbPeriodicCallBack(IN OUT EFI_SYSTEM_CONTEXT SystemContext)
VOID TransferFromMemToOutBufAndSend(IN UINTN Length, IN UINT8 *Address)
VOID EFIAPI ContinueAtAddress(IN EFI_SYSTEM_CONTEXT SystemContext, IN CHAR8 *PacketData)
EFI_INSTRUCTION_SET_ARCHITECTURE
EFI_STATUS EFIAPI Register(IN EFI_PEI_RSC_HANDLER_CALLBACK Callback)