MdeModulePkg/EbcDxe: prepare support for EBC Debugger

* This patch introduces EbcDebuggerHook.c/h and inserts the required
  EBCDebugger references into the existing EBC source files.
* With all the hooks defined to their empty version in EbcDebuggerHook.c
  the existing EBC VM behaviour is left unaffected.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Pete Batard
2016-11-16 21:24:08 +08:00
committed by Jiewen Yao
parent 0265811dbe
commit 6f0a3cd23e
9 changed files with 339 additions and 7 deletions

View File

@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "EbcInt.h"
#include "EbcExecute.h"
#include "EbcSupport.h"
#include "EbcDebuggerHook.h"
/**
Given raw bytes of Itanium based code, format them into a bundle and
@ -214,12 +215,15 @@ EbcInterpret (
PushU64 (&VmContext, 0);
PushU64 (&VmContext, 0xDEADBEEFDEADBEEF);
VmContext.StackRetAddr = (UINT64) VmContext.Gpr[0];
//
// Begin executing the EBC code
//
EbcDebuggerHookEbcInterpret (&VmContext);
EbcExecute (&VmContext);
//
// Return the value in R[7] unless there was an error
// Return the value in Gpr[7] unless there was an error
//
ReturnEBCStack(StackIndex);
return (UINT64) VmContext.Gpr[7];
@ -334,10 +338,11 @@ ExecuteEbcImageEntryPoint (
//
// Begin executing the EBC code
//
EbcDebuggerHookExecuteEbcImageEntryPoint (&VmContext);
EbcExecute (&VmContext);
//
// Return the value in R[7] unless there was an error
// Return the value in Gpr[7] unless there was an error
//
ReturnEBCStack(StackIndex);
return (UINT64) VmContext.Gpr[7];