summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py6
-rw-r--r--lldb/source/Breakpoint/BreakpointOptions.cpp25
2 files changed, 16 insertions, 15 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
index 943998a421b..e84cbf48654 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
@@ -17,6 +17,7 @@ from lldbsuite.test import lldbutil
class BreakpointSerialization(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
def test_resolvers(self):
@@ -196,6 +197,11 @@ class BreakpointSerialization(TestBase):
bkpt.SetThreadName("grubby")
source_bps.Append(bkpt)
+ bkpt = self.orig_target.BreakpointCreateByName("blubby", lldb.eFunctionNameTypeAuto, empty_module_list, empty_cu_list)
+ bkpt.SetCondition("gonna remove this")
+ bkpt.SetCondition("")
+ source_bps.Append(bkpt)
+
bkpt = self.orig_target.BreakpointCreateByName("blubby", lldb.eFunctionNameTypeFull, empty_module_list,empty_cu_list)
bkpt.SetCondition("something != something_else")
bkpt.SetQueueName("grubby")
diff --git a/lldb/source/Breakpoint/BreakpointOptions.cpp b/lldb/source/Breakpoint/BreakpointOptions.cpp
index 491273cfb32..112c71280e5 100644
--- a/lldb/source/Breakpoint/BreakpointOptions.cpp
+++ b/lldb/source/Breakpoint/BreakpointOptions.cpp
@@ -253,55 +253,50 @@ std::unique_ptr<BreakpointOptions> BreakpointOptions::CreateFromStructuredData(
const char *key = GetKey(OptionNames::EnabledState);
bool success;
- if (key) {
+ if (key && options_dict.HasKey(key)) {
success = options_dict.GetValueForKeyAsBoolean(key, enabled);
if (!success) {
- error.SetErrorStringWithFormat("%s key is not a boolean.",
- GetKey(OptionNames::EnabledState));
+ error.SetErrorStringWithFormat("%s key is not a boolean.", key);
return nullptr;
}
set_options.Set(eEnabled);
}
key = GetKey(OptionNames::OneShotState);
- if (key) {
+ if (key && options_dict.HasKey(key)) {
success = options_dict.GetValueForKeyAsBoolean(key, one_shot);
if (!success) {
- error.SetErrorStringWithFormat("%s key is not a boolean.",
- GetKey(OptionNames::OneShotState));
+ error.SetErrorStringWithFormat("%s key is not a boolean.", key);
return nullptr;
}
set_options.Set(eOneShot);
}
key = GetKey(OptionNames::AutoContinue);
- if (key) {
+ if (key && options_dict.HasKey(key)) {
success = options_dict.GetValueForKeyAsBoolean(key, auto_continue);
if (!success) {
- error.SetErrorStringWithFormat("%s key is not a boolean.",
- GetKey(OptionNames::AutoContinue));
+ error.SetErrorStringWithFormat("%s key is not a boolean.", key);
return nullptr;
}
set_options.Set(eAutoContinue);
}
key = GetKey(OptionNames::IgnoreCount);
- if (key) {
+ if (key && options_dict.HasKey(key)) {
success = options_dict.GetValueForKeyAsInteger(key, ignore_count);
if (!success) {
- error.SetErrorStringWithFormat("%s key is not an integer.",
- GetKey(OptionNames::IgnoreCount));
+ error.SetErrorStringWithFormat("%s key is not an integer.", key);
return nullptr;
}
set_options.Set(eIgnoreCount);
}
key = GetKey(OptionNames::ConditionText);
- if (key) {
+ if (key && options_dict.HasKey(key)) {
success = options_dict.GetValueForKeyAsString(key, condition_ref);
if (!success) {
- error.SetErrorStringWithFormat("%s key is not an string.",
- GetKey(OptionNames::ConditionText));
+ error.SetErrorStringWithFormat("%s key is not an string.", key);
return nullptr;
}
set_options.Set(eCondition);
OpenPOWER on IntegriCloud