summaryrefslogtreecommitdiffstats
path: root/src/build/debug
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2016-05-16 11:22:18 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-05-24 17:09:33 -0400
commit39c834621810eac50a7b34a94a90a840dcdb58d9 (patch)
treef215055b8565eebee4944aa5646925ad85336863 /src/build/debug
parentc518fff3c3a71c3a9944a4b2e8ca7ac776cd8eb1 (diff)
downloadtalos-hostboot-39c834621810eac50a7b34a94a90a840dcdb58d9.tar.gz
talos-hostboot-39c834621810eac50a7b34a94a90a840dcdb58d9.zip
Add simics breakpoint for exceptions
Created a new magic instruction handler that can be enabled via environment variable to stop the simulation for Hostboot exceptions. This is useful when we want to get a backtrace at the failing spot without recompiling code or having to manually insert breakpoints in simics directly. Enable the function by setting HB_BREAK_ON_ERROR The trigger call is MAGIC_BREAK_ON_ERROR Change-Id: I17e008281d010e3f8c5e5817e5f30fd0ccb624d0 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24600 Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Marshall J. Wilks <mjwilks@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/debug')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 48a8d4818..cae13c134 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -485,9 +485,6 @@ except:
# See src/include/arch/ppc.H for the definitions of the magic args.
# Hostboot magic args should range 7000..7999.
def magic_instruction_callback(user_arg, cpu, arg):
- if arg == 7008:
- cpu.r3 = random.randint(1, 0xffffffffffffffffL)
-
if arg == 7006: # MAGIC_SHUTDOWN
# KernelMisc::shutdown()
print "KernelMisc::shutdown() called."
@@ -499,6 +496,9 @@ def magic_instruction_callback(user_arg, cpu, arg):
# Stop the simulation, much like a hard-coded breakpoint
SIM_break_simulation( "Simulation stopped. (hap 7007)" )
+ if arg == 7008:
+ cpu.r3 = random.randint(1, 0xffffffffffffffffL)
+
if arg == 7009: # MAGIC_MEMORYLEAK_FUNCTION
magic_memoryleak_function(cpu)
@@ -552,6 +552,11 @@ def magic_instruction_callback(user_arg, cpu, arg):
enableCore1 = "%s; %s; %s; %s"%(enable4,enable5,enable6,enable7)
SIM_run_alone(run_command, enableCore1 )
+ if arg == 7018: # MAGIC_BREAK_ON_ERROR
+ # Stop the simulation if an env var is set
+ if( os.environ.has_key('HB_BREAK_ON_ERROR') ):
+ SIM_break_simulation( "Stopping sim on HB error. (hap 7018)" )
+
if arg == 7055: # MAGIC_CONTINUOUS_TRACE
hb_tracBinaryBuffer = cpu.r4
hb_tracBinaryBufferSz = cpu.r5
OpenPOWER on IntegriCloud