Merge change 24168 into eclair

* changes:
  Improved DEBUG_SAVE_INPUT_TO_FILE logic.