From aa08069b3fb9a564df755ec558fd64ba076b0ef3 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 22 Apr 2013 13:20:31 -0400 Subject: sim: Add helper functions that add PCEvents with custom arguments This changeset adds support for forwarding arguments to the PC event constructors to following methods: addKernelFuncEvent addFuncEvent Additionally, this changeset adds the following helper method to the System base class: addFuncEventOrPanic - Hook a PCEvent to a symbol, panic on failure. addKernelFuncEventOrPanic - Hook a PCEvent to a kernel symbol, panic on failure. System implementations have been updated to use the new functionality where appropriate. --- src/arch/alpha/linux/system.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/arch/alpha/linux') diff --git a/src/arch/alpha/linux/system.cc b/src/arch/alpha/linux/system.cc index 0507af029..80d13cdfa 100644 --- a/src/arch/alpha/linux/system.cc +++ b/src/arch/alpha/linux/system.cc @@ -120,14 +120,10 @@ LinuxAlphaSystem::setupFuncEvents() { AlphaSystem::setupFuncEvents(); #ifndef NDEBUG - kernelPanicEvent = addKernelFuncEvent("panic"); - if (!kernelPanicEvent) - panic("could not find kernel symbol \'panic\'"); + kernelPanicEvent = addKernelFuncEventOrPanic("panic"); #if 0 - kernelDieEvent = addKernelFuncEvent("die_if_kernel"); - if (!kernelDieEvent) - panic("could not find kernel symbol \'die_if_kernel\'"); + kernelDieEvent = addKernelFuncEventOrPanic("die_if_kernel"); #endif #endif -- cgit v1.2.3