Skip to content

Instantly share code, notes, and snippets.

@cotto
Created July 28, 2010 08:15
Show Gist options
  • Save cotto/493754 to your computer and use it in GitHub Desktop.
Save cotto/493754 to your computer and use it in GitHub Desktop.
cotto@feather:/usr/src/partcl-old\ 0 $ cat proftest
#!/bin/bash
echo "building..."
/usr/local/parrot-svn/bin/parrot --output=runtime/tcllib.pbc runtime/tcllib.pir
let tclconst_start=`pbc_dump runtime/tcllib.pbc |grep tclconst.pir -B1|grep OFFSET|sed -e 's/.*=> //' -e 's/,.*//'`
let tclconst_end="`pbc_dump runtime/tcllib.pbc |grep tclconst.pir -A4|grep OFFSET|sed -e 's/.*=> //' -e 's/,.*//'`-1"
let tclconst_class_init=`pbc_dump runtime/tcllib.pbc |grep "namespace => 'TclConst'" -B6|grep class_init -B 3|head -n1|sed -e 's/.*start_offs => //' -e 's/,.*//g'`
echo "tclconst range (debug segment): $tclconst_start -> $tclconst_end"
echo "TclConst;class_init starts at $tclconst_class_init"
if [ $tclconst_class_init > tclconst_end ]
then
echo "pbc is broken"
else
echo "pbc might not be broken"
fi
cotto@feather:/usr/src/partcl-old\ 0 $ cat runtime/tcllib.pir
.include 'src/class/tclarray.pir'
.include 'src/class/tclconst.pir'
.include 'src/class/tcldict.pir'
cotto@feather:/usr/src/partcl-old\ 0 $ cat src/class/tclarray.pir
.sub does :vtable
.param string provides
.end
cotto@feather:/usr/src/partcl-old\ 0 $ cat src/class/tclconst.pir
.namespace [ 'TclConst' ]
.sub class_init :anon :load
$P0 = get_class 'String'
.end
cotto@feather:/usr/src/partcl-old\ 0 $ cat src/class/tcldict.pir
.namespace [ 'TclDict' ]
.sub class_init :anon :load
say "wut"
.end
cotto@feather:/usr/src/partcl-old\ 0 $ ./proftest
building...
tclconst range (debug segment): 3 -> 5
TclConst;class_init starts at 7
pbc is broken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment