mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00
[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.
This commit is contained in:
parent
d92f77606a
commit
be2bc6b1d0
@ -43,8 +43,10 @@ def main():
|
|||||||
# Create a new lldb invocation with capture or replay enabled.
|
# Create a new lldb invocation with capture or replay enabled.
|
||||||
lldb = os.path.join(os.path.dirname(sys.argv[0]), 'lldb')
|
lldb = os.path.join(os.path.dirname(sys.argv[0]), 'lldb')
|
||||||
new_args = [lldb]
|
new_args = [lldb]
|
||||||
|
cleanup = False
|
||||||
if sys.argv[1] == "replay":
|
if sys.argv[1] == "replay":
|
||||||
new_args.extend(['--replay', reproducer_path])
|
new_args.extend(['--replay', reproducer_path])
|
||||||
|
cleanup = True
|
||||||
elif sys.argv[1] == "capture":
|
elif sys.argv[1] == "capture":
|
||||||
new_args.extend([
|
new_args.extend([
|
||||||
'--capture', '--capture-path', reproducer_path,
|
'--capture', '--capture-path', reproducer_path,
|
||||||
@ -55,7 +57,10 @@ def main():
|
|||||||
help()
|
help()
|
||||||
return 1
|
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__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user