From a8a624d0a45d506f3ac1eab883226cb1cfa71bf6 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Thu, 24 Nov 2016 10:37:55 +0800 Subject: [PATCH] MdeModulePkg/EbcDebugger: Add missing check for symbol not found In function DebuggerDisplaySymbolAccrodingToAddress(), when variable 'CandidateAddress' (returned by EbdFindSymbolAddress function) equals (UINTN) -1, it also indicates that the symbol is not found at the given address. This commit adds this missing check. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Jiewen Yao --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 329a642cfd..8a418d5190 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2007, Intel Corporation +Copyright (c) 2007 - 2016, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -185,7 +185,7 @@ Returns: // Find the nearest symbol address // CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry); - if (CandidateAddress == 0) { + if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) { EDBPrint (L"Symbole at Address not found!\n"); return EFI_DEBUG_CONTINUE; } else if (Address != CandidateAddress) {