diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-19 02:56:54 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-09-19 02:56:54 +0000 |
commit | f630cddd9a7f7e030c852d442df360b206e63ee0 (patch) | |
tree | 931099c3ad16532f3f23ac67536af3233aa8d438 /sim-scripts | |
parent | c08854e6d37a3567acabe3a26ba53b237c8efc56 (diff) |
2009-09-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* gdb-sim-run.in, qemu-rtems.in, skyeye-support: Add support for
running coverage/trace on qemu/x86. Fine tune other details to
support this.
Diffstat (limited to 'sim-scripts')
-rw-r--r-- | sim-scripts/ChangeLog | 6 | ||||
-rwxr-xr-x | sim-scripts/gdb-sim-run.in | 29 | ||||
-rw-r--r-- | sim-scripts/qemu-rtems.in | 17 | ||||
-rw-r--r-- | sim-scripts/skyeye-support | 2 |
4 files changed, 45 insertions, 9 deletions
diff --git a/sim-scripts/ChangeLog b/sim-scripts/ChangeLog index a9a2342..7c90f01 100644 --- a/sim-scripts/ChangeLog +++ b/sim-scripts/ChangeLog @@ -1,3 +1,9 @@ +2009-09-18 Joel Sherrill <joel.sherrill@oarcorp.com> + + * gdb-sim-run.in, qemu-rtems.in, skyeye-support: Add support for + running coverage/trace on qemu/x86. Fine tune other details to + support this. + 2009-09-16 Joel Sherrill <joel.sherrill@OARcorp.com> * gdb-sim-run.in: Rerun when coverage enabled and a zero-length diff --git a/sim-scripts/gdb-sim-run.in b/sim-scripts/gdb-sim-run.in index ea3e993..66d704d 100755 --- a/sim-scripts/gdb-sim-run.in +++ b/sim-scripts/gdb-sim-run.in @@ -133,6 +133,8 @@ bspSupportsGDBServerMode="no" bspSupportsDisplayAdapter="no" bspSupportsNIC="no" bspNeedsSttySane="yes" +bspNeedsTraceConversion="no" +bspWritesZeroCoverage="no" for v in 4.10 4.9 4.8 4.7 "" do @@ -410,13 +412,26 @@ do test ${verbose} = "yes" && \ echo BACKGROUND runtest ${toRun} ${testtype} ${limit} runtest ${toRun} ${testtype} ${limit} - # some simulators do not always write a coverage file with non-zero length - # If we see this, try again - while [ ${coverage} = "yes" -a ! -s ${toRun}.cov ] - do - echo Rerunning ${toRun} due to zero length coverage file - runtest ${toRun} ${testtype} ${limit} - done + if [ ${coverage} = "yes" ] ; then + + # some simulators do not always write a coverage file with non-zero length + # If we see this, try again + if [ ${bspWritesZeroCoverage} = "yes" ] ; then + while [ ${coverage} = "yes" -a ! -s ${toRun}.cov ] + do + echo Rerunning ${toRun} due to zero length coverage file + runtest ${toRun} ${testtype} ${limit} + done + fi + + # some BSPs produce trace oriented files which need to be converted + # to object coverage maps + if [ ${bspNeedsTraceConversion} = "yes" ] ; then + convertTraceToCoverageMap ${toRun} + fi + + fi + if [ ${bspGeneratesDeviceTree} = "yes" ] ; then rm -f ${bspTreeFile} diff --git a/sim-scripts/qemu-rtems.in b/sim-scripts/qemu-rtems.in index 71f1d36..2a3af06 100644 --- a/sim-scripts/qemu-rtems.in +++ b/sim-scripts/qemu-rtems.in @@ -5,8 +5,12 @@ # bspUsesGDBSimulator="no" -runBSP=qemu +runBSP=${HOME}/qemu-coverage/install/bin/qemu +if [ ! -r ${runBSP} ] ; then + runBSP=qemu +fi bspNeedsDos2Unix="yes" +bspNeedsTraceConversion="yes" # Set the defaults based upon arguments given and do some error checking if [ X${QEMUDIR} == X ] ; then @@ -46,7 +50,10 @@ runARGS() fi cp ${1} ${hd0Dir}/test.exe - echo "-m 8 -boot a -fda ${fd0Image} -hda fat:${hd0Dir} \ + if [ ${coverage} = yes ] ; then + COVERAGE_ARG="-trace ${1}.tra" + fi + echo "-m 8 -boot a -fda ${fd0Image} -hda fat:${hd0Dir} ${COVERAGE_ARG} \ -monitor null -nographic -serial stdio --no-reboot" } @@ -71,10 +78,16 @@ bspLimit() case ${tname} in *stackchk*)limit=5 ;; *fatal*) limit=1 ;; + *psxtime0*)limit=60 ;; *psxtime*) limit=180 ;; *) limit=60 ;; esac echo ${limit} } +convertTraceToCoverageMap() +{ + trace_converter -l 100000 -h 200000 -f QEMU ${1}.tra ${1}.cov + +} bspGeneratesDeviceTree="no" diff --git a/sim-scripts/skyeye-support b/sim-scripts/skyeye-support index 5928c5e..cf1b152 100644 --- a/sim-scripts/skyeye-support +++ b/sim-scripts/skyeye-support @@ -9,6 +9,8 @@ bspSupportsGDBServerMode="yes" bspNeedsDos2Unix="yes" bspGeneratesGDBCommands="yes" bspNeedsSttySane="no" +# sometimes the .cov file has a zero length +bspWritesZeroCoverage="yes" if [ ${coverage} = "yes" ] ; then bspRunFatal="yes" |