generateStateTrace