From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9DC7081D16 for ; Thu, 24 Nov 2016 20:19:48 -0800 (PST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 24 Nov 2016 20:19:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,693,1473145200"; d="scan'208";a="790531203" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 24 Nov 2016 20:19:47 -0800 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Nov 2016 20:19:42 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Nov 2016 20:19:41 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.142]) with mapi id 14.03.0248.002; Fri, 25 Nov 2016 12:19:38 +0800 From: "Yao, Jiewen" To: "Bi, Dandan" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH v2] MdeModulePkg: Fix GCC build failure Thread-Index: AQHSRsypRSVlHU94FkSlwGXRWZu0fKDpGJuw Date: Fri, 25 Nov 2016 04:19:37 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386DAAD0@shsmsx102.ccr.corp.intel.com> References: <1480044755-6512-1-git-send-email-dandan.bi@intel.com> In-Reply-To: <1480044755-6512-1-git-send-email-dandan.bi@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v2] MdeModulePkg: Fix GCC build failure X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Nov 2016 04:19:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Bi, Dandan > Sent: Friday, November 25, 2016 11:33 AM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Pete Batard > Subject: [PATCH v2] MdeModulePkg: Fix GCC build failure >=20 > V2: Add check for CreateEvent and CloseEvent. >=20 > Cc: Jiewen Yao > Cc: Pete Batard > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Dandan Bi > --- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c | 3 --- > .../Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c | 5 ----- > MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c | 16 > ++++++++++------ > MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 -- > 4 files changed, 10 insertions(+), 16 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > index e0b85c7..adc1c50 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c > @@ -192,11 +192,10 @@ Returns: >=20 > --*/ > { > UINT64 Address; > UINTN Index; > - UINT16 OldInstruction; > BOOLEAN IsHitBreakpoint; >=20 > // > // Roll back IP for breakpoint instruction (BREAK(3) : 0x0300) > // > @@ -207,11 +206,10 @@ Returns: > // > IsHitBreakpoint =3D FALSE; > for (Index =3D 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) &= & > (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { > if > ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress > =3D=3D Address) && > (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) { > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > IsHitBreakpoint =3D TRUE; > break; > } > } >=20 > @@ -242,11 +240,10 @@ Returns: > // > IsHitBreakpoint =3D FALSE; > for (Index =3D 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) > && (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { > if > ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress > =3D=3D Address) && > (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) > { > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > IsHitBreakpoint =3D TRUE; > break; > } > } >=20 > diff --git > a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > index 4be6dd4..a137ea9 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > +++ > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c > @@ -437,12 +437,10 @@ Returns: >=20 > --*/ > { > UINTN Index; > EFI_STATUS Status; > - UINTN Address; > - UINT16 OldInstruction; >=20 > if (CommandArg =3D=3D NULL) { > EDBPrint (L"BreakpointClear Argument error!\n"); > return EFI_DEBUG_CONTINUE; > } > @@ -464,13 +462,10 @@ Returns: >=20 > if ((Index >=3D EFI_DEBUGGER_BREAKPOINT_MAX) || > (Index >=3D DebuggerPrivate->DebuggerBreakpointCount)) { > EDBPrint (L"BreakpointClear error!\n"); > return EFI_DEBUG_CONTINUE; > - } else { > - Address =3D > (UINTN)DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointA > ddress; > - OldInstruction =3D > (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstructi > on; > } >=20 > // > // Delete breakpoint > // > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > index 9196adb..9394fb0 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c > @@ -455,15 +455,17 @@ Returns: > TPL_CALLBACK, > EbcDebuggerBreakEventFunc, > NULL, > &mDebuggerPrivate.BreakEvent > ); > - Status =3D gBS->SetTimer ( > - mDebuggerPrivate.BreakEvent, > - TimerPeriodic, > - EFI_DEBUG_BREAK_TIMER_INTERVAL > - ); > + if (!EFI_ERROR (Status)) { > + Status =3D gBS->SetTimer ( > + mDebuggerPrivate.BreakEvent, > + TimerPeriodic, > + EFI_DEBUG_BREAK_TIMER_INTERVAL > + ); > + } >=20 > return ; > } >=20 > VOID > @@ -491,11 +493,13 @@ Returns: > EFI_DEBUGGER_SYMBOL_OBJECT *Object; >=20 > // > // Close the break event > // > - gBS->CloseEvent (mDebuggerPrivate.BreakEvent); > + if (mDebuggerPrivate.BreakEvent !=3D NULL) { > + gBS->CloseEvent (mDebuggerPrivate.BreakEvent); > + } >=20 > // > // Clean up the symbol > // > Object =3D mDebuggerPrivate.DebuggerSymbolContext.Object; > diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > index 9573c43..a1d21aa 100644 > --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c > @@ -191,19 +191,17 @@ Returns: >=20 > --*/ > { > CHAR8 *LineBuffer; > CHAR8 *FieldBuffer; > - EFI_DEBUGGER_SYMBOL_ENTRY *Entry; > EDB_EBC_MAP_PARSE_STATE MapParseState; > EDB_EBC_SYMBOL_PARSE_STATE SymbolParseState; > CHAR8 *Name; > CHAR8 *ObjName; > UINTN Address; > EFI_DEBUGGER_SYMBOL_TYPE Type; >=20 > - Entry =3D Object->Entry; >=20 > // > // Begin to parse the Buffer > // > LineBuffer =3D AsciiStrGetNewTokenLine (Buffer, "\n\r"); > -- > 1.9.5.msysgit.1