add debug script for bug reporting (#4419)

Change-Id: I0d97f6ee32e10865f5229d2f1d3c849304ba75fc