Author: jdevlieghere Date: Mon Jul 29 09:41:30 2019 New Revision: 367238 URL: http://llvm.org/viewvc/llvm-project?rev=367238&view=rev Log: [lldb] Also include the array definition in Properties.inc
Right now our Properties.inc only generates the initializer for the options list but not the array declaration boilerplate around it. As the array definition is identical for all arrays, we might as well also let the Properties.inc generate it alongside the initializers. Unfortunately we cannot do the same for enums, as there's this magic ePropertyExperimental, which needs to come at the end to be interpreted correctly. Hopefully we can get rid of this in the future and do the same for the property enums. Differential revision: https://reviews.llvm.org/D65353 Modified: lldb/trunk/source/Core/Debugger.cpp lldb/trunk/source/Core/ModuleList.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Interpreter/Properties.td lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Target/Platform.cpp lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/Thread.cpp lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp Modified: lldb/trunk/source/Core/Debugger.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Core/Debugger.cpp (original) +++ lldb/trunk/source/Core/Debugger.cpp Mon Jul 29 09:41:30 2019 @@ -202,10 +202,8 @@ static constexpr OptionEnumValueElement "display thread stop locations."}, {eStopShowColumnNone, "none", "Do not highlight the stop column."}}; -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_debugger #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_debugger @@ -230,7 +228,7 @@ Status Debugger::SetPropertyValue(const Status error(Properties::SetPropertyValue(exe_ctx, op, property_path, value)); if (error.Success()) { // FIXME it would be nice to have "on-change" callbacks for properties - if (property_path == g_properties[ePropertyPrompt].name) { + if (property_path == g_debugger_properties[ePropertyPrompt].name) { llvm::StringRef new_prompt = GetPrompt(); std::string str = lldb_utility::ansi::FormatAnsiTerminalCodes( new_prompt, GetUseColor()); @@ -241,7 +239,7 @@ Status Debugger::SetPropertyValue(const auto prompt_change_event_sp = std::make_shared<Event>( CommandInterpreter::eBroadcastBitResetPrompt, bytes.release()); GetCommandInterpreter().BroadcastEvent(prompt_change_event_sp); - } else if (property_path == g_properties[ePropertyUseColor].name) { + } else if (property_path == g_debugger_properties[ePropertyUseColor].name) { // use-color changed. Ping the prompt so it can reset the ansi terminal // codes. SetPrompt(GetPrompt()); @@ -272,7 +270,7 @@ Status Debugger::SetPropertyValue(const bool Debugger::GetAutoConfirm() const { const uint32_t idx = ePropertyAutoConfirm; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_debugger_properties[idx].default_uint_value != 0); } const FormatEntity::Entry *Debugger::GetDisassemblyFormat() const { @@ -293,13 +291,13 @@ const FormatEntity::Entry *Debugger::Get bool Debugger::GetNotifyVoid() const { const uint32_t idx = ePropertyNotiftVoid; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_debugger_properties[idx].default_uint_value != 0); } llvm::StringRef Debugger::GetPrompt() const { const uint32_t idx = ePropertyPrompt; return m_collection_sp->GetPropertyAtIndexAsString( - nullptr, idx, g_properties[idx].default_cstr_value); + nullptr, idx, g_debugger_properties[idx].default_cstr_value); } void Debugger::SetPrompt(llvm::StringRef p) { @@ -331,7 +329,7 @@ const FormatEntity::Entry *Debugger::Get lldb::ScriptLanguage Debugger::GetScriptLanguage() const { const uint32_t idx = ePropertyScriptLanguage; return (lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } bool Debugger::SetScriptLanguage(lldb::ScriptLanguage script_lang) { @@ -343,7 +341,7 @@ bool Debugger::SetScriptLanguage(lldb::S uint32_t Debugger::GetTerminalWidth() const { const uint32_t idx = ePropertyTerminalWidth; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } bool Debugger::SetTerminalWidth(uint32_t term_width) { @@ -354,7 +352,7 @@ bool Debugger::SetTerminalWidth(uint32_t bool Debugger::GetUseExternalEditor() const { const uint32_t idx = ePropertyUseExternalEditor; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_debugger_properties[idx].default_uint_value != 0); } bool Debugger::SetUseExternalEditor(bool b) { @@ -365,7 +363,7 @@ bool Debugger::SetUseExternalEditor(bool bool Debugger::GetUseColor() const { const uint32_t idx = ePropertyUseColor; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_debugger_properties[idx].default_uint_value != 0); } bool Debugger::SetUseColor(bool b) { @@ -378,13 +376,13 @@ bool Debugger::SetUseColor(bool b) { bool Debugger::GetHighlightSource() const { const uint32_t idx = ePropertyHighlightSource; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } StopShowColumn Debugger::GetStopShowColumn() const { const uint32_t idx = ePropertyStopShowColumn; return (lldb::StopShowColumn)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } llvm::StringRef Debugger::GetStopShowColumnAnsiPrefix() const { @@ -401,20 +399,20 @@ uint32_t Debugger::GetStopSourceLineCoun const uint32_t idx = before ? ePropertyStopLineCountBefore : ePropertyStopLineCountAfter; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } Debugger::StopDisassemblyType Debugger::GetStopDisassemblyDisplay() const { const uint32_t idx = ePropertyStopDisassemblyDisplay; return (Debugger::StopDisassemblyType) m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } uint32_t Debugger::GetDisassemblyLineCount() const { const uint32_t idx = ePropertyStopDisassemblyCount; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } bool Debugger::GetAutoOneLineSummaries() const { @@ -450,7 +448,7 @@ bool Debugger::SetPrintDecls(bool b) { uint32_t Debugger::GetTabSize() const { const uint32_t idx = ePropertyTabSize; return m_collection_sp->GetPropertyAtIndexAsUInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_debugger_properties[idx].default_uint_value); } bool Debugger::SetTabSize(uint32_t tab_size) { @@ -684,7 +682,7 @@ Debugger::Debugger(lldb::LogOutputCallba assert(default_platform_sp); m_platform_list.Append(default_platform_sp, true); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_debugger_properties); m_collection_sp->AppendProperty( ConstString("target"), ConstString("Settings specify to debugging targets."), true, Modified: lldb/trunk/source/Core/ModuleList.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Core/ModuleList.cpp (original) +++ lldb/trunk/source/Core/ModuleList.cpp Mon Jul 29 09:41:30 2019 @@ -65,10 +65,8 @@ using namespace lldb_private; namespace { -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_modulelist #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_modulelist @@ -80,7 +78,7 @@ enum { ModuleListProperties::ModuleListProperties() { m_collection_sp = std::make_shared<OptionValueProperties>(ConstString("symbols")); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_modulelist_properties); llvm::SmallString<128> path; clang::driver::Driver::getDefaultModuleCachePath(path); @@ -90,7 +88,7 @@ ModuleListProperties::ModuleListProperti bool ModuleListProperties::GetEnableExternalLookup() const { const uint32_t idx = ePropertyEnableExternalLookup; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_modulelist_properties[idx].default_uint_value != 0); } bool ModuleListProperties::SetEnableExternalLookup(bool new_value) { Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original) +++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Jul 29 09:41:30 2019 @@ -89,13 +89,11 @@ static constexpr const char *InitFileWar "and\n" "accept the security risk."; -static constexpr PropertyDefinition g_properties[] = { -#define LLDB_PROPERTIES_commandinterpreter +#define LLDB_PROPERTIES_interpreter #include "Properties.inc" -}; enum { -#define LLDB_PROPERTIES_commandinterpreter +#define LLDB_PROPERTIES_interpreter #include "PropertiesEnum.inc" }; @@ -121,19 +119,19 @@ CommandInterpreter::CommandInterpreter(D SetEventName(eBroadcastBitResetPrompt, "reset-prompt"); SetEventName(eBroadcastBitQuitCommandReceived, "quit"); CheckInWithManager(); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_interpreter_properties); } bool CommandInterpreter::GetExpandRegexAliases() const { const uint32_t idx = ePropertyExpandRegexAliases; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } bool CommandInterpreter::GetPromptOnQuit() const { const uint32_t idx = ePropertyPromptOnQuit; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } void CommandInterpreter::SetPromptOnQuit(bool b) { @@ -144,7 +142,7 @@ void CommandInterpreter::SetPromptOnQuit bool CommandInterpreter::GetEchoCommands() const { const uint32_t idx = ePropertyEchoCommands; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } void CommandInterpreter::SetEchoCommands(bool b) { @@ -155,7 +153,7 @@ void CommandInterpreter::SetEchoCommands bool CommandInterpreter::GetEchoCommentCommands() const { const uint32_t idx = ePropertyEchoCommentCommands; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } void CommandInterpreter::SetEchoCommentCommands(bool b) { @@ -195,13 +193,13 @@ void CommandInterpreter::ResolveCommand( bool CommandInterpreter::GetStopCmdSourceOnError() const { const uint32_t idx = ePropertyStopCmdSourceOnError; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } bool CommandInterpreter::GetSpaceReplPrompts() const { const uint32_t idx = ePropertySpaceReplPrompts; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_interpreter_properties[idx].default_uint_value != 0); } void CommandInterpreter::Initialize() { Modified: lldb/trunk/source/Interpreter/Properties.td URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Properties.td?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Interpreter/Properties.td (original) +++ lldb/trunk/source/Interpreter/Properties.td Mon Jul 29 09:41:30 2019 @@ -1,6 +1,6 @@ include "../../include/lldb/Core/PropertiesBase.td" -let Definition = "commandinterpreter" in { +let Definition = "interpreter" in { def ExpandRegexAliases: Property<"expand-regex-aliases", "Boolean">, Global, DefaultFalse, Modified: lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Mon Jul 29 09:41:30 2019 @@ -72,10 +72,8 @@ static constexpr OptionEnumValueElement "Scan through the entire potential address range of Darwin kernel (only " "on 32-bit targets)."}}; -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_dynamicloaderdarwinkernel #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_dynamicloaderdarwinkernel @@ -91,7 +89,7 @@ public: DynamicLoaderDarwinKernelProperties() : Properties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_dynamicloaderdarwinkernel_properties); } ~DynamicLoaderDarwinKernelProperties() override {} @@ -99,13 +97,15 @@ public: bool GetLoadKexts() const { const uint32_t idx = ePropertyLoadKexts; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, + g_dynamicloaderdarwinkernel_properties[idx].default_uint_value != 0); } KASLRScanType GetScanType() const { const uint32_t idx = ePropertyScanType; return (KASLRScanType)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, + g_dynamicloaderdarwinkernel_properties[idx].default_uint_value); } }; Modified: lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp (original) +++ lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp Mon Jul 29 09:41:30 2019 @@ -66,10 +66,8 @@ static constexpr OptionEnumValueElement {eEnableJITLoaderGDBOff, "off", "Disable JIT compilation interface"} }; -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_jitloadergdb #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_jitloadergdb @@ -85,13 +83,13 @@ public: PluginProperties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_jitloadergdb_properties); } EnableJITLoaderGDB GetEnable() const { return (EnableJITLoaderGDB)m_collection_sp->GetPropertyAtIndexAsEnumeration( nullptr, ePropertyEnable, - g_properties[ePropertyEnable].default_uint_value); + g_jitloadergdb_properties[ePropertyEnable].default_uint_value); } }; Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp (original) +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp Mon Jul 29 09:41:30 2019 @@ -177,10 +177,8 @@ const char *PlatformDarwinKernel::GetDes /// Code to handle the PlatformDarwinKernel settings -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_platformdarwinkernel #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_platformdarwinkernel @@ -196,7 +194,7 @@ public: PlatformDarwinKernelProperties() : Properties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_platformdarwinkernel_properties); } virtual ~PlatformDarwinKernelProperties() {} @@ -204,7 +202,8 @@ public: bool GetSearchForKexts() const { const uint32_t idx = ePropertySearchForKexts; return m_collection_sp->GetPropertyAtIndexAsBoolean( - NULL, idx, g_properties[idx].default_uint_value != 0); + NULL, idx, + g_platformdarwinkernel_properties[idx].default_uint_value != 0); } FileSpecList GetKextDirectories() const { Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original) +++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Mon Jul 29 09:41:30 2019 @@ -52,10 +52,8 @@ using namespace lldb_private; namespace { -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_processkdp #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_processkdp @@ -70,7 +68,7 @@ public: PluginProperties() : Properties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_processkdp_properties); } virtual ~PluginProperties() {} @@ -78,7 +76,7 @@ public: uint64_t GetPacketTimeout() { const uint32_t idx = ePropertyKDPPacketTimeout; return m_collection_sp->GetPropertyAtIndexAsUInt64( - NULL, idx, g_properties[idx].default_uint_value); + NULL, idx, g_processkdp_properties[idx].default_uint_value); } }; Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Jul 29 09:41:30 2019 @@ -110,10 +110,8 @@ void DumpProcessGDBRemotePacketHistory(v namespace { -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_processgdbremote #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_processgdbremote @@ -128,7 +126,7 @@ public: PluginProperties() : Properties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_processgdbremote_properties); } ~PluginProperties() override {} @@ -136,7 +134,7 @@ public: uint64_t GetPacketTimeout() { const uint32_t idx = ePropertyPacketTimeout; return m_collection_sp->GetPropertyAtIndexAsUInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_processgdbremote_properties[idx].default_uint_value); } bool SetPacketTimeout(uint64_t timeout) { @@ -152,7 +150,8 @@ public: bool GetUseSVR4() const { const uint32_t idx = ePropertyUseSVR4; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, + g_processgdbremote_properties[idx].default_uint_value != 0); } }; @@ -4525,16 +4524,15 @@ bool ParseRegisters(XMLNode feature_node // information to the current process. It will call itself recursively // for nested register definition files. It returns true if it was able // to fetch and parse an xml file. -bool ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess(ArchSpec &arch_to_use, - std::string xml_filename, - uint32_t &cur_reg_num, - uint32_t ®_offset) { +bool ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess( + ArchSpec &arch_to_use, std::string xml_filename, uint32_t &cur_reg_num, + uint32_t ®_offset) { // request the target xml file std::string raw; lldb_private::Status lldberr; - if (!m_gdb_comm.ReadExtFeature(ConstString("features"), - ConstString(xml_filename.c_str()), - raw, lldberr)) { + if (!m_gdb_comm.ReadExtFeature(ConstString("features"), + ConstString(xml_filename.c_str()), raw, + lldberr)) { return false; } @@ -4636,8 +4634,8 @@ bool ProcessGDBRemote::GetGDBServerRegis } for (const auto &include : target_info.includes) { - GetGDBServerRegisterInfoXMLAndProcess(arch_to_use, include, - cur_reg_num, reg_offset); + GetGDBServerRegisterInfoXMLAndProcess(arch_to_use, include, cur_reg_num, + reg_offset); } } } else { Modified: lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp (original) +++ lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp Mon Jul 29 09:41:30 2019 @@ -104,10 +104,8 @@ void SetGlobalEnableOptions(const Debugg /// Code to handle the StructuredDataDarwinLog settings -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_darwinlog #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_darwinlog @@ -123,7 +121,7 @@ public: StructuredDataDarwinLogProperties() : Properties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_darwinlog_properties); } ~StructuredDataDarwinLogProperties() override {} @@ -131,13 +129,13 @@ public: bool GetEnableOnStartup() const { const uint32_t idx = ePropertyEnableOnStartup; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_darwinlog_properties[idx].default_uint_value != 0); } llvm::StringRef GetAutoEnableOptions() const { const uint32_t idx = ePropertyAutoEnableOptions; return m_collection_sp->GetPropertyAtIndexAsString( - nullptr, idx, g_properties[idx].default_cstr_value); + nullptr, idx, g_darwinlog_properties[idx].default_cstr_value); } const char *GetLoggingModuleName() const { return "libsystem_trace.dylib"; } Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jul 29 09:41:30 2019 @@ -113,10 +113,8 @@ using namespace lldb_private; namespace { -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_symbolfiledwarf #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_symbolfiledwarf @@ -131,7 +129,7 @@ public: PluginProperties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_symbolfiledwarf_properties); } FileSpecList GetSymLinkPaths() { Modified: lldb/trunk/source/Target/Platform.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Target/Platform.cpp (original) +++ lldb/trunk/source/Target/Platform.cpp Mon Jul 29 09:41:30 2019 @@ -63,10 +63,8 @@ const char *Platform::GetHostPlatformNam namespace { -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_platform #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_platform @@ -82,7 +80,7 @@ ConstString PlatformProperties::GetSetti PlatformProperties::PlatformProperties() { m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName()); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_platform_properties); auto module_cache_dir = GetModuleCacheDirectory(); if (module_cache_dir) @@ -101,7 +99,7 @@ PlatformProperties::PlatformProperties() bool PlatformProperties::GetUseModuleCache() const { const auto idx = ePropertyUseModuleCache; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_platform_properties[idx].default_uint_value != 0); } bool PlatformProperties::SetUseModuleCache(bool use_module_cache) { Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Mon Jul 29 09:41:30 2019 @@ -112,10 +112,8 @@ public: } }; -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_process #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_process @@ -130,7 +128,7 @@ ProcessProperties::ProcessProperties(lld // Global process properties, set them up one time m_collection_sp = std::make_shared<ProcessOptionValueProperties>(ConstString("process")); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_process_properties); m_collection_sp->AppendProperty( ConstString("thread"), ConstString("Settings specific to threads."), true, Thread::GetGlobalProperties()->GetValueProperties()); @@ -155,13 +153,13 @@ void ProcessProperties::OptionValueChang bool ProcessProperties::GetDisableMemoryCache() const { const uint32_t idx = ePropertyDisableMemCache; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } uint64_t ProcessProperties::GetMemoryCacheLineSize() const { const uint32_t idx = ePropertyMemCacheLineSize; return m_collection_sp->GetPropertyAtIndexAsUInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_process_properties[idx].default_uint_value); } Args ProcessProperties::GetExtraStartupCommands() const { @@ -189,7 +187,7 @@ void ProcessProperties::SetPythonOSPlugi bool ProcessProperties::GetIgnoreBreakpointsInExpressions() const { const uint32_t idx = ePropertyIgnoreBreakpointsInExpressions; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } void ProcessProperties::SetIgnoreBreakpointsInExpressions(bool ignore) { @@ -200,7 +198,7 @@ void ProcessProperties::SetIgnoreBreakpo bool ProcessProperties::GetUnwindOnErrorInExpressions() const { const uint32_t idx = ePropertyUnwindOnErrorInExpressions; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } void ProcessProperties::SetUnwindOnErrorInExpressions(bool ignore) { @@ -211,7 +209,7 @@ void ProcessProperties::SetUnwindOnError bool ProcessProperties::GetStopOnSharedLibraryEvents() const { const uint32_t idx = ePropertyStopOnSharedLibraryEvents; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } void ProcessProperties::SetStopOnSharedLibraryEvents(bool stop) { @@ -222,7 +220,7 @@ void ProcessProperties::SetStopOnSharedL bool ProcessProperties::GetDetachKeepsStopped() const { const uint32_t idx = ePropertyDetachKeepsStopped; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } void ProcessProperties::SetDetachKeepsStopped(bool stop) { @@ -233,19 +231,19 @@ void ProcessProperties::SetDetachKeepsSt bool ProcessProperties::GetWarningsOptimization() const { const uint32_t idx = ePropertyWarningOptimization; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } bool ProcessProperties::GetStopOnExec() const { const uint32_t idx = ePropertyStopOnExec; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_process_properties[idx].default_uint_value != 0); } std::chrono::seconds ProcessProperties::GetUtilityExpressionTimeout() const { const uint32_t idx = ePropertyUtilityExpressionTimeout; uint64_t value = m_collection_sp->GetPropertyAtIndexAsUInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_process_properties[idx].default_uint_value); return std::chrono::seconds(value); } Modified: lldb/trunk/source/Target/Target.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Target/Target.cpp (original) +++ lldb/trunk/source/Target/Target.cpp Mon Jul 29 09:41:30 2019 @@ -3273,10 +3273,8 @@ static constexpr OptionEnumValueElement "Load complete information when loading modules from memory. Currently " "this setting loads sections and all symbols."} }; -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_target #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_target @@ -3328,7 +3326,7 @@ protected: m_got_host_env = true; const uint32_t idx = ePropertyInheritEnv; if (GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0)) { + nullptr, idx, g_target_properties[idx].default_uint_value != 0)) { PlatformSP platform_sp(m_target->GetPlatform()); if (platform_sp) { Environment env = platform_sp->GetEnvironment(); @@ -3356,10 +3354,8 @@ protected: }; // TargetProperties -static constexpr PropertyDefinition g_experimental_properties[]{ #define LLDB_PROPERTIES_experimental #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_experimental @@ -3434,7 +3430,7 @@ TargetProperties::TargetProperties(Targe } else { m_collection_sp = std::make_shared<TargetOptionValueProperties>(ConstString("target")); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_target_properties); m_experimental_properties_up.reset(new TargetExperimentalProperties()); m_collection_sp->AppendProperty( ConstString(Properties::GetExperimentalSettingsName()), @@ -3503,14 +3499,14 @@ void TargetProperties::SetDefaultArchite bool TargetProperties::GetMoveToNearestCode() const { const uint32_t idx = ePropertyMoveToNearestCode; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } lldb::DynamicValueType TargetProperties::GetPreferDynamicValue() const { const uint32_t idx = ePropertyPreferDynamic; return (lldb::DynamicValueType) m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } bool TargetProperties::SetPreferDynamicValue(lldb::DynamicValueType d) { @@ -3521,7 +3517,7 @@ bool TargetProperties::SetPreferDynamicV bool TargetProperties::GetPreloadSymbols() const { const uint32_t idx = ePropertyPreloadSymbols; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } void TargetProperties::SetPreloadSymbols(bool b) { @@ -3532,7 +3528,7 @@ void TargetProperties::SetPreloadSymbols bool TargetProperties::GetDisableASLR() const { const uint32_t idx = ePropertyDisableASLR; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } void TargetProperties::SetDisableASLR(bool b) { @@ -3543,7 +3539,7 @@ void TargetProperties::SetDisableASLR(bo bool TargetProperties::GetDetachOnError() const { const uint32_t idx = ePropertyDetachOnError; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } void TargetProperties::SetDetachOnError(bool b) { @@ -3554,7 +3550,7 @@ void TargetProperties::SetDetachOnError( bool TargetProperties::GetDisableSTDIO() const { const uint32_t idx = ePropertyDisableSTDIO; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } void TargetProperties::SetDisableSTDIO(bool b) { @@ -3568,7 +3564,7 @@ const char *TargetProperties::GetDisasse x86DisassemblyFlavor flavor_value = (x86DisassemblyFlavor)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); return_value = g_x86_dis_flavor_value_types[flavor_value].string_value; return return_value; } @@ -3576,7 +3572,7 @@ const char *TargetProperties::GetDisasse InlineStrategy TargetProperties::GetInlineStrategy() const { const uint32_t idx = ePropertyInlineStrategy; return (InlineStrategy)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } llvm::StringRef TargetProperties::GetArg0() const { @@ -3620,7 +3616,7 @@ void TargetProperties::SetEnvironment(En bool TargetProperties::GetSkipPrologue() const { const uint32_t idx = ePropertySkipPrologue; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } PathMappingList &TargetProperties::GetSourcePathMap() const { @@ -3671,55 +3667,55 @@ FileSpecList TargetProperties::GetClangM bool TargetProperties::GetEnableAutoImportClangModules() const { const uint32_t idx = ePropertyAutoImportClangModules; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetEnableImportStdModule() const { const uint32_t idx = ePropertyImportStdModule; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetEnableAutoApplyFixIts() const { const uint32_t idx = ePropertyAutoApplyFixIts; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetEnableNotifyAboutFixIts() const { const uint32_t idx = ePropertyNotifyAboutFixIts; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetEnableSaveObjects() const { const uint32_t idx = ePropertySaveObjects; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetEnableSyntheticValue() const { const uint32_t idx = ePropertyEnableSynthetic; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } uint32_t TargetProperties::GetMaximumNumberOfChildrenToDisplay() const { const uint32_t idx = ePropertyMaxChildrenCount; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } uint32_t TargetProperties::GetMaximumSizeOfStringSummary() const { const uint32_t idx = ePropertyMaxSummaryLength; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } uint32_t TargetProperties::GetMaximumMemReadSize() const { const uint32_t idx = ePropertyMaxMemReadSize; return m_collection_sp->GetPropertyAtIndexAsSInt64( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } FileSpec TargetProperties::GetStandardInputPath() const { @@ -3779,52 +3775,52 @@ llvm::StringRef TargetProperties::GetExp bool TargetProperties::GetBreakpointsConsultPlatformAvoidList() { const uint32_t idx = ePropertyBreakpointUseAvoidList; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetUseHexImmediates() const { const uint32_t idx = ePropertyUseHexImmediates; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetUseFastStepping() const { const uint32_t idx = ePropertyUseFastStepping; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } bool TargetProperties::GetDisplayExpressionsInCrashlogs() const { const uint32_t idx = ePropertyDisplayExpressionsInCrashlogs; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } LoadScriptFromSymFile TargetProperties::GetLoadScriptFromSymbolFile() const { const uint32_t idx = ePropertyLoadScriptFromSymbolFile; return (LoadScriptFromSymFile) m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } LoadCWDlldbinitFile TargetProperties::GetLoadCWDlldbinitFile() const { const uint32_t idx = ePropertyLoadCWDlldbinitFile; return (LoadCWDlldbinitFile)m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } Disassembler::HexImmediateStyle TargetProperties::GetHexImmediateStyle() const { const uint32_t idx = ePropertyHexImmediateStyle; return (Disassembler::HexImmediateStyle) m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } MemoryModuleLoadLevel TargetProperties::GetMemoryModuleLoadLevel() const { const uint32_t idx = ePropertyMemoryModuleLoadLevel; return (MemoryModuleLoadLevel) m_collection_sp->GetPropertyAtIndexAsEnumeration( - nullptr, idx, g_properties[idx].default_uint_value); + nullptr, idx, g_target_properties[idx].default_uint_value); } bool TargetProperties::GetUserSpecifiedTrapHandlerNames(Args &args) const { @@ -3901,7 +3897,7 @@ void TargetProperties::SetProcessLaunchI bool TargetProperties::GetRequireHardwareBreakpoints() const { const uint32_t idx = ePropertyRequireHardwareBreakpoints; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_target_properties[idx].default_uint_value != 0); } void TargetProperties::SetRequireHardwareBreakpoints(bool b) { Modified: lldb/trunk/source/Target/Thread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/source/Target/Thread.cpp (original) +++ lldb/trunk/source/Target/Thread.cpp Mon Jul 29 09:41:30 2019 @@ -63,10 +63,8 @@ const ThreadPropertiesSP &Thread::GetGlo return *g_settings_sp_ptr; } -static constexpr PropertyDefinition g_properties[] = { #define LLDB_PROPERTIES_thread #include "Properties.inc" -}; enum { #define LLDB_PROPERTIES_thread @@ -108,7 +106,7 @@ ThreadProperties::ThreadProperties(bool if (is_global) { m_collection_sp = std::make_shared<ThreadOptionValueProperties>(ConstString("thread")); - m_collection_sp->Initialize(g_properties); + m_collection_sp->Initialize(g_thread_properties); } else m_collection_sp = std::make_shared<ThreadOptionValueProperties>( Thread::GetGlobalProperties().get()); @@ -133,25 +131,25 @@ FileSpecList ThreadProperties::GetLibrar bool ThreadProperties::GetTraceEnabledState() const { const uint32_t idx = ePropertyEnableThreadTrace; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_thread_properties[idx].default_uint_value != 0); } bool ThreadProperties::GetStepInAvoidsNoDebug() const { const uint32_t idx = ePropertyStepInAvoidsNoDebug; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_thread_properties[idx].default_uint_value != 0); } bool ThreadProperties::GetStepOutAvoidsNoDebug() const { const uint32_t idx = ePropertyStepOutAvoidsNoDebug; return m_collection_sp->GetPropertyAtIndexAsBoolean( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_thread_properties[idx].default_uint_value != 0); } uint64_t ThreadProperties::GetMaxBacktraceDepth() const { const uint32_t idx = ePropertyMaxBacktraceDepth; return m_collection_sp->GetPropertyAtIndexAsUInt64( - nullptr, idx, g_properties[idx].default_uint_value != 0); + nullptr, idx, g_thread_properties[idx].default_uint_value != 0); } // Thread Event Data Modified: lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp?rev=367238&r1=367237&r2=367238&view=diff ============================================================================== --- lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp (original) +++ lldb/trunk/utils/TableGen/LLDBPropertyDefEmitter.cpp Mon Jul 29 09:41:30 2019 @@ -124,8 +124,11 @@ static void emityProperties(std::string // user to define the macro for the options that are needed. OS << "// Property definitions for " << PropertyName << "\n"; OS << "#ifdef " << NeededMacro << "\n"; + OS << "static constexpr PropertyDefinition g_" << PropertyName + << "_properties[] = {\n"; for (Record *R : PropertyRecords) emitProperty(R, OS); + OS << "};\n"; // We undefine the macro for the user like Clang's include files are doing it. OS << "#undef " << NeededMacro << "\n"; OS << "#endif // " << PropertyName << " Property\n\n"; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits