[LLDB][SaveCore] Add SBSaveCoreOptions Object, and SBProcess::SaveCore() overload (#98403)
This PR adds `SBSaveCoreOptions`, which is a container class for options when LLDB is taking coredumps. For this first iteration this container just keeps parity with the extant API of `file, style, plugin`. In the future this options object can be extended to allow users to take a subset of their core dumps.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
"""Test the SBSaveCoreOptions APIs."""
|
||||
|
||||
import lldb
|
||||
from lldbsuite.test.decorators import *
|
||||
from lldbsuite.test.lldbtest import *
|
||||
|
||||
|
||||
class SBSaveCoreOptionsAPICase(TestBase):
|
||||
def test_plugin_name_assignment(self):
|
||||
"""Test assignment ensuring valid plugin names only."""
|
||||
options = lldb.SBSaveCoreOptions()
|
||||
error = options.SetPluginName(None)
|
||||
self.assertTrue(error.Success())
|
||||
self.assertEqual(options.GetPluginName(), None)
|
||||
error = options.SetPluginName("Not a real plugin")
|
||||
self.assertTrue(error.Fail())
|
||||
self.assertEqual(options.GetPluginName(), None)
|
||||
error = options.SetPluginName("minidump")
|
||||
self.assertTrue(error.Success())
|
||||
self.assertEqual(options.GetPluginName(), "minidump")
|
||||
error = options.SetPluginName("")
|
||||
self.assertTrue(error.Success())
|
||||
self.assertEqual(options.GetPluginName(), None)
|
||||
|
||||
def test_default_corestyle_behavior(self):
|
||||
"""Test that the default core style is unspecified."""
|
||||
options = lldb.SBSaveCoreOptions()
|
||||
self.assertEqual(options.GetStyle(), lldb.eSaveCoreUnspecified)
|
||||
Reference in New Issue
Block a user