diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-11-07 16:23:00 -0600 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-11-16 12:56:42 -0600 |
| commit | 032c54f4f03414618499a6717890a408e80acb77 (patch) | |
| tree | c3fb15cdd4cb5119937b8b11cedb52aa05e49cc7 /src/build/debug/Hostboot | |
| parent | 1e3a888edab060be5b016aff86a5d547b5be6643 (diff) | |
| download | talos-hostboot-032c54f4f03414618499a6717890a408e80acb77.tar.gz talos-hostboot-032c54f4f03414618499a6717890a408e80acb77.zip | |
Simics implementation of debug framework.
Change-Id: Ie9f6963070ced0a39c2e62f685c79d6da01fdcdb
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/488
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/debug/Hostboot')
| -rwxr-xr-x | src/build/debug/Hostboot/Printk.pm | 2 | ||||
| -rwxr-xr-x | src/build/debug/Hostboot/Ps.pm | 16 | ||||
| -rwxr-xr-x | src/build/debug/Hostboot/Trace.pm | 4 | ||||
| -rwxr-xr-x | src/build/debug/Hostboot/_DebugFramework.pm (renamed from src/build/debug/Hostboot/DebugFramework.pm) | 60 |
4 files changed, 53 insertions, 29 deletions
diff --git a/src/build/debug/Hostboot/Printk.pm b/src/build/debug/Hostboot/Printk.pm index 6e76b484c..deaf6c72d 100755 --- a/src/build/debug/Hostboot/Printk.pm +++ b/src/build/debug/Hostboot/Printk.pm @@ -32,7 +32,7 @@ sub main { ::userDisplay "------------Kernel Printk Parser------------\n"; my ($symAddr, $symSize) = ::findSymbolAddress("kernel_printk_buffer"); - if (not defined $symAddr) { ::userDisplay "Cannot find symbol.\n"; die; } + if (not defined $symAddr) { ::userDisplay "Cannot find symbol.\n"; die; } ::userDisplay ::readData($symAddr,$symSize); ::userDisplay "--------------------------------------------\n"; } diff --git a/src/build/debug/Hostboot/Ps.pm b/src/build/debug/Hostboot/Ps.pm index 7077079d1..0048ccc87 100755 --- a/src/build/debug/Hostboot/Ps.pm +++ b/src/build/debug/Hostboot/Ps.pm @@ -28,7 +28,7 @@ package Hostboot::Ps; use Exporter; our @EXPORT_OK = ('main'); -use constant PS_TASKMGR_SYMBOLNAME => +use constant PS_TASKMGR_SYMBOLNAME => "Singleton<TaskManager>::instance()::instance"; use constant PS_TASKMGR_TRACKER_LIST_OFFSET => 8 * 4; use constant PS_TRACKER_LIST_HEAD_OFFSET => 0; @@ -39,7 +39,7 @@ use constant PS_TRACKER_PREV_OFFSET => 0; use constant PS_TRACKER_NEXT_OFFSET => 8 + PS_TRACKER_PREV_OFFSET; use constant PS_TRACKER_PARENT_OFFSET => 8 + PS_TRACKER_NEXT_OFFSET; use constant PS_TRACKER_CHILDREN_LIST_OFFSET => 8 + PS_TRACKER_PARENT_OFFSET; -use constant PS_TRACKER_TID_OFFSET => +use constant PS_TRACKER_TID_OFFSET => PS_TRACKER_CHILDREN_LIST_OFFSET + PS_TRACKER_LIST_SIZE; use constant PS_TRACKER_TASK_OFFSET => 8 + PS_TRACKER_TID_OFFSET; use constant PS_TRACKER_STATUS_OFFSET => 8 + PS_TRACKER_TASK_OFFSET; @@ -55,9 +55,9 @@ sub main # Find symbol containing kernel list of task objects. # (Tasks who's parent is the kernel) my ($symAddr, $symSize) = ::findSymbolAddress(PS_TASKMGR_SYMBOLNAME); - if (not defined $symAddr) - { - ::userDisplay "Couldn't find ".PS_TASKMGR_SYMBOLNAME; + if (not defined $symAddr) + { + ::userDisplay "Couldn't find ".PS_TASKMGR_SYMBOLNAME; die; } @@ -96,7 +96,7 @@ sub displayList sub displayTracker { my ($trackAddr, $level) = @_; - + # Read TID. my $tid = ::read16(PS_TRACKER_TID_OFFSET + $trackAddr); @@ -121,7 +121,7 @@ sub displayTracker if (($state ne "R") and ($state ne "r") and ($state ne "E") and ($state ne "Z")) { - $stateExtra = sprintf "(0x%x)", + $stateExtra = sprintf "(0x%x)", ::read64(PS_TASK_STATEEXTRA_OFFSET + $taskAddr); } elsif ($state eq "Z") @@ -163,7 +163,7 @@ sub makeTabs $result = $result." |"; $level = $level - 1; } - + return $result; } diff --git a/src/build/debug/Hostboot/Trace.pm b/src/build/debug/Hostboot/Trace.pm index f57676f40..42722c09f 100755 --- a/src/build/debug/Hostboot/Trace.pm +++ b/src/build/debug/Hostboot/Trace.pm @@ -66,11 +66,11 @@ sub main if ((not defined $traceBuffers) or ($traceBuffers =~ m/$compName/)) { - $foundBuffer = 1; + $foundBuffer = 1; print $fh (::readData($buffAddr, TRAC_DEFAULT_BUFFER_SIZE)); } } - + if ($foundBuffer) { open TRACE, ($args->{"fsp-trace"}." -s ". diff --git a/src/build/debug/Hostboot/DebugFramework.pm b/src/build/debug/Hostboot/_DebugFramework.pm index 5bdedd4df..a55794ebc 100755 --- a/src/build/debug/Hostboot/DebugFramework.pm +++ b/src/build/debug/Hostboot/_DebugFramework.pm @@ -1,8 +1,30 @@ #!/usr/bin/perl +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/debug/Hostboot/_DebugFramework.pm $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2011 +# +# p1 +# +# Object Code Only (OCO) source materials +# Licensed Internal Code Source Materials +# IBM HostBoot Licensed Internal Code +# +# The source code for this program is not published or other- +# wise divested of its trade secrets, irrespective of what has +# been deposited with the U.S. Copyright Office. +# +# Origin: 30 +# +# IBM_PROLOG_END -# DebugFramework.pm +# _DebugFramework.pm # -# This module is a set of utility functions for the debug framework, which +# This module is a set of utility functions for the debug framework, which # should be common across all debug framework environments. # # The module provides the functions listed below in @EXPORT. @@ -17,7 +39,7 @@ use strict; -package Hostboot::DebugFramework; +package Hostboot::_DebugFramework; use Exporter 'import'; our @EXPORT = ( 'callToolModule', 'callToolModuleHelp', @@ -47,7 +69,7 @@ BEGIN return 1; # @sub callToolModule -# +# # Executes the 'main' function of the requested tool module. # # @param string - Tool to call. @@ -59,14 +81,15 @@ sub callToolModule my $tool = shift; my $package = "Hostboot::$tool"; - eval("use lib '.'; use $package; return 1;") or - die "Couldn't load tool \"$tool\""; + eval("use lib '.'; use $package; return 1;") or + die "Couldn't load tool \"$tool\":\n\t$@"; eval("$package->main(\\%toolOpts);"); + die $@ if $@; } # @sub callToolModuleHelp # -# Executes the 'help' function of the requested tool module to display +# Executes the 'help' function of the requested tool module to display # tool usage. # # @param string - Tool to call. @@ -76,9 +99,10 @@ sub callToolModuleHelp my $tool = shift; my $package = "Hostboot::$tool"; - eval("use lib '.'; use $package; return 1;") or - die "Couldn't load tool \"$tool\""; + eval("use lib '.'; use $package; return 1;") or + die "Couldn't load tool \"$tool\":\n\t$@"; eval("$package->help(\\%toolOpts);"); + die $@ if $@; } # @sub parseToolOpts @@ -131,7 +155,7 @@ sub determineImagePath $imgPath = $ENV{"HOSTBOOTROOT"} . "/img/"; } } - + return $imgPath; } @@ -144,24 +168,24 @@ sub parseSymbolFile if ($parsedSymbolFile) { return; } my $symsFile = ::getImgPath(); - if (::getIsTest()) - { + if (::getIsTest()) + { $symsFile = $symsFile."hbicore_test.syms"; } else { $symsFile = $symsFile."hbicore.syms"; } - - open(FILE, "< $symsFile") or die; + + open(FILE, "< $symsFile") or die "Cannot open symbol file $symsFile"; while (my $line = <FILE>) { $line =~ m/(.*?),(.*?),(.*?),(.*?),(.*)/; - my $name = $5; + my $name = $5; my $addr = hex $2; my $tocAddr = hex $3; my $size = hex $4; - + $symbolAddress{$name} = $addr; $symbolSize{$name} = $size; $addressSymbol{$addr} = $name; @@ -222,7 +246,7 @@ sub parseModuleFile $modFile = $modFile."hbicore.bin.modinfo"; } - open(FILE, "< $modFile") or die; + open(FILE, "< $modFile") or die "Cannot open module-info file $modFile"; while (my $line = <FILE>) { $line =~ m/(.*?),(.*)/; @@ -337,7 +361,7 @@ sub read8 my $addr = shift; my $result = ::readData($addr, 1); - + return unpack("C", $result); } |

