From 611bd6c6aeb9a9d194aa128e2d20b4b6bbb1fc84 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 2 May 2023 10:31:21 -0700 Subject: [lldb] Make exe_ctx an optional argument in OptionValueProperties (NFC) The majority of call sites are nullptr as the execution context. Refactor OptionValueProperties to make the argument optional and simplify all the callers. --- .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a50327f..06f5796 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -142,30 +142,29 @@ public: uint64_t GetPacketTimeout() { const uint32_t idx = ePropertyPacketTimeout; - return m_collection_sp->GetPropertyAtIndexAsUInt64(nullptr, idx) - .value_or(g_processgdbremote_properties[idx].default_uint_value); + return m_collection_sp->GetPropertyAtIndexAsUInt64(idx).value_or( + g_processgdbremote_properties[idx].default_uint_value); } bool SetPacketTimeout(uint64_t timeout) { const uint32_t idx = ePropertyPacketTimeout; - return m_collection_sp->SetPropertyAtIndexAsUInt64(nullptr, idx, timeout); + return m_collection_sp->SetPropertyAtIndexAsUInt64(idx, timeout); } FileSpec GetTargetDefinitionFile() const { const uint32_t idx = ePropertyTargetDefinitionFile; - return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx); + return m_collection_sp->GetPropertyAtIndexAsFileSpec(idx); } bool GetUseSVR4() const { const uint32_t idx = ePropertyUseSVR4; - return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx) - .value_or(g_processgdbremote_properties[idx].default_uint_value != 0); + return m_collection_sp->GetPropertyAtIndexAsBoolean(idx).value_or( + g_processgdbremote_properties[idx].default_uint_value != 0); } bool GetUseGPacketForReading() const { const uint32_t idx = ePropertyUseGPacketForReading; - return m_collection_sp->GetPropertyAtIndexAsBoolean(nullptr, idx) - .value_or(true); + return m_collection_sp->GetPropertyAtIndexAsBoolean(idx).value_or(true); } }; -- cgit v1.1