check for non-empty context stack before restoring debugging