Skip to content

Instantly share code, notes, and snippets.

@tpopela
Last active June 5, 2018 15:07
Show Gist options
  • Save tpopela/16adfd9b810ef33bb4c9 to your computer and use it in GitHub Desktop.
Save tpopela/16adfd9b810ef33bb4c9 to your computer and use it in GitHub Desktop.
Script to make WebKit JavaScriptCore CLoop noisy for debugging
#!/bin/bash
# Use inside Source/JavaScriptCore/llint directory
processFile()
{
if [ ! -f "$1" ]; then
exit 2
fi
if [ -f "$1".noisy ]; then
exit 3
fi
cp "$1"{,.orig}
sed 's@^\(_.*\):$@&\n cloopDo // printf ("\1\\n");@' "$1" > "${1}.1"
sed 's@^\(\..*\):$@&\n cloopDo // printf ("\1\\n");@' "${1}.1" > "${1}.2"
sed 's@^macro \(.*\).*$@&\n cloopDo // printf ("\1\\n");@' "${1}.2" > "${1}.3"
mv "${1}.3" "$1"
rm "${1}.1"
rm "${1}.2"
cp "$1"{,.noisy}
}
if [ -z "$1" ]; then
exit 1
fi
if [ "$1" == "all" ]; then
processFile "LowLevelInterpreter.asm"
processFile "LowLevelInterpreter32_64.asm"
processFile "LowLevelInterpreter64.asm"
exit 0
fi
processFile "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment