Use env to ignore the readonly flags.
env SHELLOPTS=xtrace ./yourscript Alternately, if you have set -x in your parent shell, you can export SHELLOPTS to cause it to be copied into the environment, and thus to the child (thanks to Joe Casadonte for this):
set -x # set xtrace flag export SHELLOPTS # copy all options, including xtrace flag, to environment ./yourscript