File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
lldb/test/API/functionalities/process_save_core_minidump Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -493,3 +493,29 @@ def test_save_minidump_custom_save_style_duplicated_regions(self):
493
493
494
494
finally :
495
495
self .assertTrue (self .dbg .DeleteTarget (target ))
496
+
497
+ @skipUnlessPlatform (["linux" ])
498
+ def minidump_deleted_on_save_failure (self ):
499
+ """Test that verifies the minidump file is deleted after an error"""
500
+
501
+ self .build ()
502
+ exe = self .getBuildArtifact ("a.out" )
503
+ try :
504
+ target = self .dbg .CreateTarget (exe )
505
+ process = target .LaunchSimple (
506
+ None , None , self .get_process_working_directory ()
507
+ )
508
+ self .assertState (process .GetState (), lldb .eStateStopped )
509
+
510
+ custom_file = self .getBuildArtifact ("core.should.be.deleted.custom.dmp" )
511
+ options = lldb .SBSaveCoreOptions ()
512
+ options .SetOutputFile (lldb .SBFileSpec (custom_file ))
513
+ options .SetPluginName ("minidump" )
514
+ options .SetStyle (lldb .eSaveCoreCustomOnly )
515
+ # We set custom only and have no thread list and have no memory.
516
+ error = process .SaveCore (options )
517
+ self .assertTrue (error .Fail ())
518
+ self .assertTrue (not os .path .isfile (custom_file ))
519
+
520
+ finally :
521
+ self .assertTrue (self .dbg .DeleteTarget (target ))
You can’t perform that action at this time.
0 commit comments