public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Hao Wu <hao.a.wu@intel.com>
To: edk2-devel@lists.01.org
Cc: Hao Wu <hao.a.wu@intel.com>, Jiewen Yao <jiewen.yao@intel.com>
Subject: [PATCH 3/5] MdeModulePkg/EbcDebugger: Add missing check for symbol not found
Date: Thu, 24 Nov 2016 10:56:33 +0800	[thread overview]
Message-ID: <1479956195-10764-4-git-send-email-hao.a.wu@intel.com> (raw)
In-Reply-To: <1479956195-10764-1-git-send-email-hao.a.wu@intel.com>

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>
---
 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 329a642..8a418d5 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) {
-- 
1.9.5.msysgit.0



  parent reply	other threads:[~2016-11-24  2:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24  2:56 [PATCH 0/5] Code refinements in MdeModulePkg/EbcDebugger Hao Wu
2016-11-24  2:56 ` [PATCH 1/5] MdeModulePkg/EbcDebugger: Operands of same size for bitwise operation Hao Wu
2016-11-24  2:56 ` [PATCH 2/5] MdeModulePkg/EbcDebugger: Add check for invalid 'CommandArg' Hao Wu
2016-11-24  2:56 ` Hao Wu [this message]
2016-11-24  2:56 ` [PATCH 4/5] MdeModulePkg/EbcDebugger: Add ASSERT to ensure FieldBuffer is not NULL Hao Wu
2016-11-24  2:56 ` [PATCH 5/5] MdeModulePkg/EbcDebugger: Compare ASCII char with '\0' Hao Wu
2016-11-24  3:12 ` [PATCH 0/5] Code refinements in MdeModulePkg/EbcDebugger Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479956195-10764-4-git-send-email-hao.a.wu@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox