aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2023-05-01 21:04:24 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2023-05-01 21:46:32 -0700
commit9c48aa68f455a63fc5e20e196d3c3e8822bfa6af (patch)
tree00e435408f19ee5db36ca242536247370f7f1d0e /lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
parent3b8bc83527910dc36c4d415256c43a84d213f322 (diff)
downloadllvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.zip
llvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.tar.gz
llvm-9c48aa68f455a63fc5e20e196d3c3e8822bfa6af.tar.bz2
[lldb] Refactor OptionValueProperties to return a std::optional (NFC)
Similar to fdbe7c7faa54, refactor OptionValueProperties to return a std::optional instead of taking a fail value. This allows the caller to handle situations where there's no value, instead of being unable to distinguish between the absence of a value and the value happening the match the fail value. When a fail value is required, std::optional::value_or() provides the same functionality.
Diffstat (limited to 'lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp')
-rw-r--r--lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index faebe5d..668b7b0 100644
--- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -78,8 +78,8 @@ public:
uint64_t GetPacketTimeout() {
const uint32_t idx = ePropertyKDPPacketTimeout;
- return m_collection_sp->GetPropertyAtIndexAsUInt64(
- NULL, idx, g_processkdp_properties[idx].default_uint_value);
+ return m_collection_sp->GetPropertyAtIndexAsUInt64(NULL, idx).value_or(
+ g_processkdp_properties[idx].default_uint_value);
}
};