From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: dandan.bi@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Mon, 27 May 2019 19:25:43 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 May 2019 19:25:42 -0700 X-ExtLoop1: 1 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.147]) by orsmga006.jf.intel.com with ESMTP; 27 May 2019 19:25:40 -0700 From: "Dandan Bi" To: devel@edk2.groups.io, oleksiyy@ami.com Cc: Jaben Carsey , Ray Ni , Zhichao Gao Subject: [patch] ShellPkg/Debug1CommandsLib: Fix bugs in func DisplaySysEventLogData Date: Tue, 28 May 2019 10:25:09 +0800 Message-Id: <20190528022509.15152-1-dandan.bi@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1498 This patch fix following bugs in func DisplaySysEventLogData: 1. Log increment (Log = (LOG_RECORD_FORMAT *) (LogData + Offset);) should happened in the end of while loop, not in the very beginning. 2. DisplaySELTypes function should be used in while loop instead of DisplaySELVarDataFormatType. Cc: Jaben Carsey Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Dandan Bi --- .../SmbiosView/EventLogInfo.c | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c index b8adf438d3..984c178890 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c @@ -1,9 +1,9 @@ /** @file Module for clarifying the content of the smbios structure element info. - Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2005 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ #include "UefiShellDebug1CommandsLib.h" @@ -345,20 +345,16 @@ DisplaySysEventLogData ( // Print Log info // Offset = 0; Log = (LOG_RECORD_FORMAT *) LogData; while (Log != NULL && Log->Type != END_OF_LOG && Offset < LogAreaLength) { - // - // Get a Event Log Record - // - Log = (LOG_RECORD_FORMAT *) (LogData + Offset); if (Log != NULL) { // // Display Event Log Record Information // - DisplaySELVarDataFormatType (Log->Type, SHOW_DETAIL); + DisplaySELTypes (Log->Type, SHOW_DETAIL); DisplaySELLogHeaderLen (Log->Length, SHOW_DETAIL); Offset += Log->Length; // // Display Log Header Date/Time Fields @@ -371,10 +367,14 @@ DisplaySysEventLogData ( Print (L"19"); } else if (Log != NULL && Log->Year <= 79) { Print (L"20"); } else { ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_ERROR), gShellDebug1HiiHandle); + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); continue; } ShellPrintHiiEx(-1,-1,NULL, STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_TIME_SIX_VARS), @@ -389,13 +389,21 @@ DisplaySysEventLogData ( // // Display Variable Data Format // if (Log->Length <= (sizeof (LOG_RECORD_FORMAT) - 1)) { + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); continue; } ElVdfType = Log->LogVariableData[0]; DisplayElVdfInfo (ElVdfType, Log->LogVariableData); + // + // Get a Event Log Record + // + Log = (LOG_RECORD_FORMAT *) (LogData + Offset); } } } -- 2.18.0.windows.1