diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-23 21:46:47 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-01-23 21:46:50 -0800 |
commit | be2bc6b1d0f60b45e3fb40c14ee7bd1b4f2fa88c (patch) | |
tree | e3f93487e0ad3d193f5d1d0c4853e9d2176cbbc2 /lldb/utils | |
parent | d92f77606aa6cfcb1e3e792a880b290d77f1c8fd (diff) | |
download | llvm-be2bc6b1d0f60b45e3fb40c14ee7bd1b4f2fa88c.tar.gz |
[lldb/Util] Remove reproducers after replay
Except for debugging purposes there's no point in leaving the reproducer
behind on disk after replay. This patch adds a cleanup in the replay
case.
Diffstat (limited to 'lldb/utils')
-rwxr-xr-x | lldb/utils/lldb-repro/lldb-repro.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/utils/lldb-repro/lldb-repro.py b/lldb/utils/lldb-repro/lldb-repro.py index 313d3855a025..f7bcd3baa7a4 100755 --- a/lldb/utils/lldb-repro/lldb-repro.py +++ b/lldb/utils/lldb-repro/lldb-repro.py @@ -43,8 +43,10 @@ def main(): # Create a new lldb invocation with capture or replay enabled. lldb = os.path.join(os.path.dirname(sys.argv[0]), 'lldb') new_args = [lldb] + cleanup = False if sys.argv[1] == "replay": new_args.extend(['--replay', reproducer_path]) + cleanup = True elif sys.argv[1] == "capture": new_args.extend([ '--capture', '--capture-path', reproducer_path, @@ -55,7 +57,10 @@ def main(): help() return 1 - return subprocess.call(new_args) + exit_code = subprocess.call(new_args) + if cleanup: + shutil.rmtree(reproducer_path, True) + return exit_code if __name__ == '__main__': |