]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/EbcDebugger: Add missing check for symbol not found
authorHao Wu <hao.a.wu@intel.com>
Thu, 24 Nov 2016 02:37:55 +0000 (10:37 +0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 25 Nov 2016 05:34:21 +0000 (13:34 +0800)
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 <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c

index 329a642cfd76badc01c71531ecbee96341213301..8a418d51900de86501500db09370c0f5d49f7d94 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2007, Intel Corporation\r
+Copyright (c) 2007 - 2016, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -185,7 +185,7 @@ Returns:
   // Find the nearest symbol address\r
   //\r
   CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry);\r
-  if (CandidateAddress == 0) {\r
+  if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) {\r
     EDBPrint (L"Symbole at Address not found!\n");\r
     return EFI_DEBUG_CONTINUE;\r
   } else if (Address != CandidateAddress) {\r