ShellPkg/dh: Modify the dump of DebugSupport protocol

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li <huajing.li@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Huajing Li 2017-09-21 16:00:29 +08:00 committed by Ruiyu Ni
parent 24ac68ef20
commit 6fcf7288df
2 changed files with 68 additions and 1 deletions

View File

@ -1094,6 +1094,71 @@ BlockIoProtocolDumpInformation (
return RetVal; return RetVal;
} }
/**
Function to dump information about DebugSupport Protocol.
@param[in] TheHandle The handle that has the protocol installed.
@param[in] Verbose TRUE for additional information, FALSE otherwise.
@retval A pointer to a string containing the information.
**/
CHAR16*
EFIAPI
DebugSupportProtocolDumpInformation (
IN CONST EFI_HANDLE TheHandle,
IN CONST BOOLEAN Verbose
)
{
EFI_STATUS Status;
EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport;
CHAR16 *GetString;
CHAR16 *RetVal;
if (!Verbose) {
return NULL;
}
GetString = NULL;
RetVal = NULL;
Status = gBS->OpenProtocol (
TheHandle,
&gEfiDebugSupportProtocolGuid,
(VOID**)&DebugSupport,
gImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (EFI_ERROR (Status)) {
return NULL;
}
HandleParsingHiiInit ();
GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_INFO), NULL);
if (GetString == NULL) {
return NULL;
}
//
// Dump Debug support info
//
switch (DebugSupport->Isa) {
case (IsaIa32):
RetVal = CatSPrint (RetVal, GetString, L"IA-32");
break;
case (IsaIpf):
RetVal = CatSPrint (RetVal, GetString, L"IPF");
break;
case (IsaEbc):
RetVal = CatSPrint (RetVal, GetString, L"EBC");
break;
default:
SHELL_FREE_NON_NULL (GetString);
GetString = HiiGetString (mHandleParsingHiiHandle, STRING_TOKEN(STR_DEBUGSUPPORT_UNKNOWN), NULL);
RetVal = GetString != NULL ? CatSPrint (RetVal, GetString, DebugSupport->Isa) : NULL;
break;
}
SHELL_FREE_NON_NULL (GetString);
return RetVal;
}
/** /**
Function to dump information about EfiAdapterInformation Protocol. Function to dump information about EfiAdapterInformation Protocol.
@ -1817,7 +1882,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
{STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, NULL}, {STRING_TOKEN(STR_USB_IO), &gEfiUsbIoProtocolGuid, NULL},
{STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL}, {STRING_TOKEN(STR_USB_HC), &gEfiUsbHcProtocolGuid, NULL},
{STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL}, {STRING_TOKEN(STR_USB_HC2), &gEfiUsb2HcProtocolGuid, NULL},
{STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, NULL}, {STRING_TOKEN(STR_DEBUG_SUPPORT), &gEfiDebugSupportProtocolGuid, DebugSupportProtocolDumpInformation},
{STRING_TOKEN(STR_DEBUG_PORT), &gEfiDebugPortProtocolGuid, NULL}, {STRING_TOKEN(STR_DEBUG_PORT), &gEfiDebugPortProtocolGuid, NULL},
{STRING_TOKEN(STR_DECOMPRESS), &gEfiDecompressProtocolGuid, NULL}, {STRING_TOKEN(STR_DECOMPRESS), &gEfiDecompressProtocolGuid, NULL},
{STRING_TOKEN(STR_ACPI_TABLE), &gEfiAcpiTableProtocolGuid, NULL}, {STRING_TOKEN(STR_ACPI_TABLE), &gEfiAcpiTableProtocolGuid, NULL},

View File

@ -336,6 +336,8 @@
#string STR_IDE_CONT_INIT #language en-US "IdeControllerInit" #string STR_IDE_CONT_INIT #language en-US "IdeControllerInit"
#string STR_DISK_INFO #language en-US "DiskInfo" #string STR_DISK_INFO #language en-US "DiskInfo"
#string STR_BLOCKIO_INFO #language en-US " %s%sMId:%%H%x%%N bsize %%H%x%%N, lblock %lx (%,ld), %s %s %s" #string STR_BLOCKIO_INFO #language en-US " %s%sMId:%%H%x%%N bsize %%H%x%%N, lblock %lx (%,ld), %s %s %s"
#string STR_DEBUGSUPPORT_INFO #language en-US " Isa = %s"
#string STR_DEBUGSUPPORT_UNKNOWN #language en-US " Unknown (%%H%s%%N)"
#string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: %H%x%N\r\n" #string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: %H%x%N\r\n"
#string STR_PCIRB_DUMP_SEG #language en-US " Segment #.....: %H%x%N\r\n" #string STR_PCIRB_DUMP_SEG #language en-US " Segment #.....: %H%x%N\r\n"