From 8ae17140476861efa642d28849f627fd9940f1af Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Fri, 25 Nov 2016 09:00:39 +0800 Subject: [PATCH] MdeModulePkg: Fix GCC build failure Cc: Jiewen Yao Cc: Pete Batard Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Jiewen.yao@intel.com --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c | 3 --- .../EbcDxe/EbcDebugger/EdbCmdBreakpoint.c | 5 ----- .../Universal/EbcDxe/EbcDebugger/EdbHook.c | 16 ++++++++++------ .../Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 -- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c index 9e44026ab9..7f7cfc0f63 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c @@ -194,7 +194,6 @@ Returns: { UINT64 Address; UINTN Index; - UINT16 OldInstruction; BOOLEAN IsHitBreakpoint; // @@ -209,7 +208,6 @@ Returns: for (Index = 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) && (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { if ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress == Address) && (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) { - OldInstruction = (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstruction; IsHitBreakpoint = TRUE; break; } @@ -244,7 +242,6 @@ Returns: for (Index = 0; (Index < DebuggerPrivate->DebuggerBreakpointCount) && (Index < EFI_DEBUGGER_BREAKPOINT_MAX); Index++) { if ((DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress == Address) && (DebuggerPrivate->DebuggerBreakpointContext[Index].State)) { - OldInstruction = (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstruction; IsHitBreakpoint = TRUE; break; } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c index f06963f7d7..7c0122e75c 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c @@ -439,8 +439,6 @@ Returns: { UINTN Index; EFI_STATUS Status; - UINTN Address; - UINT16 OldInstruction; if (CommandArg == NULL) { EDBPrint (L"BreakpointClear Argument error!\n"); @@ -470,9 +468,6 @@ Returns: (Index >= DebuggerPrivate->DebuggerBreakpointCount)) { EDBPrint (L"BreakpointClear error!\n"); return EFI_DEBUG_CONTINUE; - } else { - Address = (UINTN)DebuggerPrivate->DebuggerBreakpointContext[Index].BreakpointAddress; - OldInstruction = (UINT16)DebuggerPrivate->DebuggerBreakpointContext[Index].OldInstruction; } // diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c index 9196adb74b..9394fb0ce5 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c @@ -457,11 +457,13 @@ Returns: NULL, &mDebuggerPrivate.BreakEvent ); - Status = gBS->SetTimer ( - mDebuggerPrivate.BreakEvent, - TimerPeriodic, - EFI_DEBUG_BREAK_TIMER_INTERVAL - ); + if (!EFI_ERROR (Status)) { + Status = gBS->SetTimer ( + mDebuggerPrivate.BreakEvent, + TimerPeriodic, + EFI_DEBUG_BREAK_TIMER_INTERVAL + ); + } return ; } @@ -493,7 +495,9 @@ Returns: // // Close the break event // - gBS->CloseEvent (mDebuggerPrivate.BreakEvent); + if (mDebuggerPrivate.BreakEvent != NULL) { + gBS->CloseEvent (mDebuggerPrivate.BreakEvent); + } // // Clean up the symbol diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 22a827d35d..5794502358 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -193,7 +193,6 @@ Returns: { CHAR8 *LineBuffer; CHAR8 *FieldBuffer; - EFI_DEBUGGER_SYMBOL_ENTRY *Entry; EDB_EBC_MAP_PARSE_STATE MapParseState; EDB_EBC_SYMBOL_PARSE_STATE SymbolParseState; CHAR8 *Name; @@ -201,7 +200,6 @@ Returns: UINTN Address; EFI_DEBUGGER_SYMBOL_TYPE Type; - Entry = Object->Entry; // // Begin to parse the Buffer