diff options
Diffstat (limited to 'lldb/source/Plugins')
300 files changed, 0 insertions, 2185 deletions
diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp index de1f7d9fb7d..362a80be4b0 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp @@ -1316,9 +1316,7 @@ ABIMacOSX_arm::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_arm::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_arm::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) { @@ -2045,9 +2043,7 @@ lldb_private::ConstString ABIMacOSX_arm::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABIMacOSX_arm::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h index 74eadae2d58..ac9ba00b9d9 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h @@ -63,9 +63,7 @@ public: bool IsArmv7kProcess() const; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp index 6f952ffbcc8..368e3721324 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -1657,9 +1657,7 @@ ABIMacOSX_arm64::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_arm64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) { @@ -2439,9 +2437,7 @@ void ABIMacOSX_arm64::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ABIMacOSX_arm64::GetPluginNameStatic() { static ConstString g_plugin_name("ABIMacOSX_arm64"); diff --git a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h index 15b1b8dcfa3..bfacbcd54a9 100644 --- a/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ b/lldb/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -65,9 +65,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp index 48fca5d59ff..67371b432ff 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp @@ -703,9 +703,7 @@ ABIMacOSX_i386::GetRegisterInfoArray(uint32_t &count) { size_t ABIMacOSX_i386::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABIMacOSX_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1123,9 +1121,7 @@ lldb_private::ConstString ABIMacOSX_i386::GetPluginNameStatic() { return g_short_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABIMacOSX_i386::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h index 20117c4febf..57def683283 100644 --- a/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h +++ b/lldb/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h @@ -68,9 +68,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -78,9 +76,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp index 11f2d54c1ea..c97c76c0a91 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp @@ -1317,9 +1317,7 @@ ABISysV_arm::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_arm::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_arm::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -2149,9 +2147,7 @@ lldb_private::ConstString ABISysV_arm::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_arm::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h index 586dc631962..a0f00c8f227 100644 --- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h +++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h @@ -63,9 +63,7 @@ public: bool IsArmHardFloat(lldb_private::Thread &thread) const; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -75,9 +73,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp index a3daaef66be..1d547121e23 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp @@ -1660,9 +1660,7 @@ bool ABISysV_arm64::GetPointerReturnRegister(const char *&name) { size_t ABISysV_arm64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -2412,9 +2410,7 @@ lldb_private::ConstString ABISysV_arm64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ABISysV_arm64::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h index f12b727a4f0..1fbdc793ed6 100644 --- a/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h +++ b/lldb/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h @@ -70,9 +70,7 @@ public: bool GetPointerReturnRegister(const char *&name) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp index 402808ad4f3..93647564fe2 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp @@ -1009,9 +1009,7 @@ ABISysV_hexagon::GetRegisterInfoArray(uint32_t &count) { */ size_t ABISysV_hexagon::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1294,9 +1292,7 @@ lldb_private::ConstString ABISysV_hexagon::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_hexagon::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h index 46f913f6dac..459b6315dba 100644 --- a/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h +++ b/lldb/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h @@ -71,9 +71,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -83,9 +81,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp index d823c278dee..05f5dba9068 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp @@ -192,9 +192,7 @@ ABISysV_i386::GetRegisterInfoArray(uint32_t &count) { return g_register_infos; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -839,9 +837,7 @@ void ABISysV_i386::Terminate() { PluginManager::UnregisterPlugin(CreateInstance); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_i386::GetPluginNameStatic() { static ConstString g_name("sysv-i386"); diff --git a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h index 9e8fea479d9..982bdd676b7 100644 --- a/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h +++ b/lldb/source/Plugins/ABI/SysV-i386/ABISysV_i386.h @@ -76,9 +76,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -86,9 +84,7 @@ public: static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static lldb_private::ConstString GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp index dee5d26ddd2..121c7300b96 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp @@ -549,9 +549,7 @@ ABISysV_mips::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_mips::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_mips::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1062,9 +1060,7 @@ lldb_private::ConstString ABISysV_mips::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_mips::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h index 5964a4464d5..6cd9c19c22a 100644 --- a/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h +++ b/lldb/source/Plugins/ABI/SysV-mips/ABISysV_mips.h @@ -61,9 +61,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -73,9 +71,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp index e9be1c82455..b7a9fe1f52a 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp @@ -549,9 +549,7 @@ ABISysV_mips64::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_mips64::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1213,9 +1211,7 @@ lldb_private::ConstString ABISysV_mips64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_mips64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h index faa0108b5b4..7da71b36b4b 100644 --- a/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h +++ b/lldb/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h @@ -74,9 +74,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -86,9 +84,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp index 15762f8a0a7..faa995033ac 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp @@ -213,9 +213,7 @@ ABISysV_ppc::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_ppc::GetRedZoneSize() const { return 224; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -975,9 +973,7 @@ lldb_private::ConstString ABISysV_ppc::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_ppc::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h index ab6493404ba..3b199852c30 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h +++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h @@ -70,9 +70,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp index 50e280d4655..1648cd3bc2f 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp @@ -64,9 +64,7 @@ lldb::ByteOrder ABISysV_ppc64::GetByteOrder() const { return GetProcessSP()->GetByteOrder(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, @@ -1086,9 +1084,7 @@ lldb_private::ConstString ABISysV_ppc64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_ppc64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h index b832e360b10..d5fb09eec0d 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h @@ -70,9 +70,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -82,9 +80,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp index 61598201d6a..abe847b386a 100644 --- a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp +++ b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp @@ -195,9 +195,7 @@ ABISysV_s390x::GetRegisterInfoArray(uint32_t &count) { size_t ABISysV_s390x::GetRedZoneSize() const { return 0; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_s390x::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -742,9 +740,7 @@ lldb_private::ConstString ABISysV_s390x::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_s390x::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h index 026545b085d..13df477e84b 100644 --- a/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h +++ b/lldb/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h @@ -62,9 +62,7 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoArray(uint32_t &count) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -74,9 +72,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp index e20aad76bcd..69d4d403a46 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp @@ -1084,9 +1084,7 @@ bool ABISysV_x86_64::GetPointerReturnRegister(const char *&name) { size_t ABISysV_x86_64::GetRedZoneSize() const { return 128; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ABISP ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { @@ -1897,9 +1895,7 @@ lldb_private::ConstString ABISysV_x86_64::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ABISysV_x86_64::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h index 6d21894b558..f6704aff348 100644 --- a/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h +++ b/lldb/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h @@ -72,9 +72,7 @@ public: bool GetPointerReturnRegister(const char *&name) override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); @@ -84,9 +82,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h index be23f8f84bf..dc663b849c4 100644 --- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h +++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h @@ -24,10 +24,8 @@ public: void OverrideStopInfo(Thread &thread) const override {} - //------------------------------------------------------------------ /// This method compares current address with current function's /// local entry point, returning the bytes to skip if they match. - //------------------------------------------------------------------ size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const override; void AdjustBreakpointAddress(const Symbol &func, diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp index 49fd1d8d981..99ba9aa13c2 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp @@ -1433,9 +1433,7 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr, return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString DisassemblerLLVMC::GetPluginName() { return GetPluginNameStatic(); } uint32_t DisassemblerLLVMC::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h index 9af873fcd45..fd5775056d3 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h @@ -26,9 +26,7 @@ public: ~DisassemblerLLVMC() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -43,9 +41,7 @@ public: lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp index 45f6d49577c..b377c23abb0 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp @@ -119,11 +119,9 @@ static const DynamicLoaderDarwinKernelPropertiesSP &GetGlobalProperties() { return g_settings_sp; } -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process, bool force) { if (!force) { @@ -194,11 +192,9 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) { return kernel_load_address; } -//---------------------------------------------------------------------- // Check if the kernel binary is loaded in memory without a slide. First verify // that the ExecutableModule is a kernel before we proceed. Returns the address // of the kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) { Module *exe_module = process->GetTarget().GetExecutableModulePointer(); @@ -224,11 +220,9 @@ DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // If the debug flag is included in the boot-args nvram setting, the kernel's // load address will be noted in the lowglo page at a fixed address Returns the // address of the kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) { if (GetGlobalProperties()->GetScanType() == eKASLRScanNone) @@ -275,13 +269,11 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // If the kernel is currently executing when lldb attaches, and we don't have a // better way of finding the kernel's load address, try searching backwards // from the current pc value looking for the kernel's Mach header in memory. // Returns the address of the kernel if one was found, else // LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) { if (GetGlobalProperties()->GetScanType() == eKASLRScanNone || @@ -336,12 +328,10 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Scan through the valid address range for a kernel binary. This is uselessly // slow in 64-bit environments so we don't even try it. This scan is not // enabled by default even for 32-bit targets. Returns the address of the // kernel if one was found, else LLDB_INVALID_ADDRESS. -//---------------------------------------------------------------------- lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch( Process *process) { if (GetGlobalProperties()->GetScanType() != eKASLRScanExhaustiveScan) { @@ -381,12 +371,10 @@ lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch( return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Read the mach_header struct out of memory and return it. // Returns true if the mach_header was successfully read, // Returns false if there was a problem reading the header, or it was not // a Mach-O header. -//---------------------------------------------------------------------- bool DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::MachO::mach_header &header, @@ -427,12 +415,10 @@ DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::M return true; } -//---------------------------------------------------------------------- // Given an address in memory, look to see if there is a kernel image at that // address. // Returns a UUID; if a kernel was not found at that address, UUID.IsValid() // will be false. -//---------------------------------------------------------------------- lldb_private::UUID DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr, Process *process, @@ -504,9 +490,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr, return UUID(); } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process, lldb::addr_t kernel_addr) : DynamicLoader(process), m_kernel_load_address(kernel_addr), m_kernel(), @@ -524,40 +508,32 @@ DynamicLoaderDarwinKernel::DynamicLoaderDarwinKernel(Process *process, } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderDarwinKernel::~DynamicLoaderDarwinKernel() { Clear(true); } void DynamicLoaderDarwinKernel::UpdateIfNeeded() { LoadKernelModuleIfNeeded(); SetNotificationBreakpointIfNeeded(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwinKernel::DidAttach() { PrivateInitialize(m_process); UpdateIfNeeded(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwinKernel::DidLaunch() { PrivateInitialize(m_process); UpdateIfNeeded(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -985,11 +961,9 @@ DynamicLoaderDarwinKernel::KextImageInfo::GetArchitecture() const { return lldb_private::ArchSpec(); } -//---------------------------------------------------------------------- // Load the kernel module and initialize the "m_kernel" member. Return true // _only_ if the kernel is loaded the first time through (subsequent calls to // this function should return false after the kernel has been already loaded). -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() { if (!m_kext_summary_header_ptr_addr.IsValid()) { m_kernel.Clear(); @@ -1064,12 +1038,10 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() { } } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderDarwinKernel::BreakpointHitCallback( void *baton, StoppointCallbackContext *context, user_id_t break_id, user_id_t break_loc_id) { @@ -1439,9 +1411,7 @@ bool DynamicLoaderDarwinKernel::ReadAllKextSummaries() { return false; } -//---------------------------------------------------------------------- // Dump an image info structure to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const { if (m_load_address == LLDB_INVALID_ADDRESS) { LLDB_LOG(log, "uuid={0} name=\"{1}\" (UNLOADED)", m_uuid.GetAsString(), @@ -1452,10 +1422,8 @@ void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const { } } -//---------------------------------------------------------------------- // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::PutToLog(Log *log) const { if (log == NULL) return; @@ -1507,9 +1475,7 @@ void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() { } } -//---------------------------------------------------------------------- // Member function that gets called when the process state changes. -//---------------------------------------------------------------------- void DynamicLoaderDarwinKernel::PrivateProcessStateChanged(Process *process, StateType state) { DEBUG_PRINTF("DynamicLoaderDarwinKernel::%s(%s)\n", __FUNCTION__, @@ -1586,9 +1552,7 @@ const char *DynamicLoaderDarwinKernel::GetPluginDescriptionStatic() { "in the MacOSX kernel."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderDarwinKernel::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h index edcecd141d3..67734a3c3a5 100644 --- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h +++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h @@ -28,9 +28,7 @@ public: ~DynamicLoaderDarwinKernel() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -46,12 +44,10 @@ public: static lldb::addr_t SearchForDarwinKernel(lldb_private::Process *process); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; @@ -61,9 +57,7 @@ public: lldb_private::Status CanLoadImage() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h index b9b0a93e495..c171513c549 100644 --- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h @@ -31,9 +31,7 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ // DynamicLoader protocol - //------------------------------------------------------------------ void DidAttach() override; @@ -48,9 +46,7 @@ public: const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp index 086169d1336..39440fdcb63 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp @@ -51,46 +51,36 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderDarwin::DynamicLoaderDarwin(Process *process) : DynamicLoader(process), m_dyld_module_wp(), m_libpthread_module_wp(), m_pthread_getspecific_addr(), m_tid_to_tls_map(), m_dyld_image_infos(), m_dyld_image_infos_stop_id(UINT32_MAX), m_dyld(), m_mutex() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderDarwin::~DynamicLoaderDarwin() {} -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwin::DidAttach() { PrivateInitialize(m_process); DoInitialImageFetch(); SetNotificationBreakpoint(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderDarwin::DidLaunch() { PrivateInitialize(m_process); DoInitialImageFetch(); SetNotificationBreakpoint(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); if (clear_process) @@ -220,10 +210,8 @@ void DynamicLoaderDarwin::UnloadAllImages() { } } -//---------------------------------------------------------------------- // Update the load addresses for all segments in MODULE using the updated INFO // that is passed in. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module, ImageInfo &info) { bool changed = false; @@ -300,9 +288,7 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module, return changed; } -//---------------------------------------------------------------------- // Unload the segments in MODULE using the INFO that is passed in. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::UnloadModuleSections(Module *module, ImageInfo &info) { bool changed = false; @@ -683,7 +669,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos( return true; } -//---------------------------------------------------------------------- // On Mac OS X libobjc (the Objective-C runtime) has several critical dispatch // functions written in hand-written assembly, and also have hand-written // unwind information in the eh_frame section. Normally we prefer analyzing @@ -695,7 +680,6 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos( // extensible so they could have an Apple-specific flag) which indicates that // the instructions are asynchronous -- accurate at every instruction, instead // of our normal default assumption that they are not. -//---------------------------------------------------------------------- bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) { ModuleSP module_sp; @@ -713,9 +697,7 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) { return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp); } -//---------------------------------------------------------------------- // Dump a Segment to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::Segment::PutToLog(Log *log, lldb::addr_t slide) const { if (log) { @@ -740,9 +722,7 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(ConstString name) const { return NULL; } -//---------------------------------------------------------------------- // Dump an image info structure to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::ImageInfo::PutToLog(Log *log) const { if (!log) return; @@ -765,9 +745,7 @@ void DynamicLoaderDarwin::PrivateInitialize(Process *process) { m_process->GetTarget().ClearAllLoadedSections(); } -//---------------------------------------------------------------------- // Member function that gets called when the process state changes. -//---------------------------------------------------------------------- void DynamicLoaderDarwin::PrivateProcessStateChanged(Process *process, StateType state) { DEBUG_PRINTF("DynamicLoaderDarwin::%s(%s)\n", __FUNCTION__, diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h index 298e75ca1a3..8f4c65da5d5 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h @@ -30,12 +30,10 @@ public: virtual ~DynamicLoaderDarwin() override; - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp index 27ccb89f4be..53a9371696c 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp @@ -27,11 +27,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process, bool force) { bool create = force; @@ -73,17 +71,13 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderMacOS::DynamicLoaderMacOS(Process *process) : DynamicLoaderDarwin(process), m_image_infos_stop_id(UINT32_MAX), m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_maybe_image_infos_address(LLDB_INVALID_ADDRESS) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderMacOS::~DynamicLoaderMacOS() { if (LLDB_BREAK_ID_IS_VALID(m_break_id)) m_process->GetTarget().RemoveBreakpointByID(m_break_id); @@ -133,9 +127,7 @@ bool DynamicLoaderMacOS::ProcessDidExec() { return did_exec; } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::DoClear() { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -145,9 +137,7 @@ void DynamicLoaderMacOS::DoClear() { m_break_id = LLDB_INVALID_BREAK_ID; } -//---------------------------------------------------------------------- // Check if we have found DYLD yet -//---------------------------------------------------------------------- bool DynamicLoaderMacOS::DidSetNotificationBreakpoint() { return LLDB_BREAK_ID_IS_VALID(m_break_id); } @@ -159,12 +149,10 @@ void DynamicLoaderMacOS::ClearNotificationBreakpoint() { } } -//---------------------------------------------------------------------- // Try and figure out where dyld is by first asking the Process if it knows // (which currently calls down in the lldb::Process to get the DYLD info // (available on SnowLeopard only). If that fails, then check in the default // addresses. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::DoInitialImageFetch() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); @@ -200,12 +188,10 @@ void DynamicLoaderMacOS::DoInitialImageFetch() { bool DynamicLoaderMacOS::NeedToDoInitialImageFetch() { return true; } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, @@ -347,7 +333,6 @@ void DynamicLoaderMacOS::AddBinaries( // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderMacOS::PutToLog(Log *log) const { if (log == NULL) return; @@ -537,9 +522,7 @@ const char *DynamicLoaderMacOS::GetPluginDescriptionStatic() { "in MacOSX user processes."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderMacOS::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h index 77645e3c4e5..1e965a52ce6 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h @@ -34,9 +34,7 @@ public: virtual ~DynamicLoaderMacOS() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,12 +46,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ bool ProcessDidExec() override; lldb_private::Status CanLoadImage() override; @@ -63,9 +59,7 @@ public: lldb_private::LazyBool &using_shared_cache, lldb_private::LazyBool &private_shared_cache) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp index 58c46d850db..f4c50b888d4 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp @@ -47,11 +47,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process, bool force) { bool create = force; @@ -93,9 +91,7 @@ DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process) : DynamicLoaderDarwin(process), m_dyld_all_image_infos_addr(LLDB_INVALID_ADDRESS), @@ -103,9 +99,7 @@ DynamicLoaderMacOSXDYLD::DynamicLoaderMacOSXDYLD(Process *process) m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_process_image_addr_is_all_images_infos(false) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderMacOSXDYLD::~DynamicLoaderMacOSXDYLD() { if (LLDB_BREAK_ID_IS_VALID(m_break_id)) m_process->GetTarget().RemoveBreakpointByID(m_break_id); @@ -158,9 +152,7 @@ bool DynamicLoaderMacOSXDYLD::ProcessDidExec() { return did_exec; } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::DoClear() { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -172,9 +164,7 @@ void DynamicLoaderMacOSXDYLD::DoClear() { m_break_id = LLDB_INVALID_BREAK_ID; } -//---------------------------------------------------------------------- // Check if we have found DYLD yet -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::DidSetNotificationBreakpoint() { return LLDB_BREAK_ID_IS_VALID(m_break_id); } @@ -185,12 +175,10 @@ void DynamicLoaderMacOSXDYLD::ClearNotificationBreakpoint() { } } -//---------------------------------------------------------------------- // Try and figure out where dyld is by first asking the Process if it knows // (which currently calls down in the lldb::Process to get the DYLD info // (available on SnowLeopard only). If that fails, then check in the default // addresses. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() { if (m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS) { // Check the image info addr as it might point to the mach header for dyld, @@ -254,9 +242,7 @@ void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() { return; } -//---------------------------------------------------------------------- // Assume that dyld is in memory at ADDR and try to parse it's load commands -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback( lldb::addr_t addr) { std::lock_guard<std::recursive_mutex> baseclass_guard(GetMutex()); @@ -312,12 +298,10 @@ bool DynamicLoaderMacOSXDYLD::NeedToDoInitialImageFetch() { return m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // Static callback function that gets called when our DYLD notification // breakpoint gets hit. We update all of our image infos and then let our super // class DynamicLoader class decide if we should stop or not (based on global // preference). -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit( void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) { @@ -701,12 +685,10 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos( } } -//---------------------------------------------------------------------- // If we have found where the "_dyld_all_image_infos" lives in memory, read the // current info from it, and then update all image load addresses (or lack // thereof). Only do this if this is the first time we're reading the dyld // infos. Return true if we actually read anything, and false otherwise. -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER)); @@ -768,12 +750,10 @@ bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() { return false; } -//---------------------------------------------------------------------- // Read a mach_header at ADDR into HEADER, and also fill in the load command // data into LOAD_COMMAND_DATA if it is non-NULL. // // Returns true if we succeed, false if we fail for any reason. -//---------------------------------------------------------------------- bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr, llvm::MachO::mach_header *header, DataExtractor *load_command_data) { @@ -840,9 +820,7 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr, return false; // We failed the read the mach_header } -//---------------------------------------------------------------------- // Parse the load commands for an image -//---------------------------------------------------------------------- uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data, ImageInfo &dylib_info, FileSpec *lc_id_dylinker) { @@ -929,10 +907,8 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data, return cmd_idx; } -//---------------------------------------------------------------------- // Read the mach_header and load commands for each image that the // _dyld_all_image_infos structure points to and cache the results. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands( ImageInfo::collection &image_infos, uint32_t infos_count, @@ -990,10 +966,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands( } } -//---------------------------------------------------------------------- // Dump the _dyld_all_image_infos members and all current image infos that we // have parsed to the file handle provided. -//---------------------------------------------------------------------- void DynamicLoaderMacOSXDYLD::PutToLog(Log *log) const { if (log == NULL) return; @@ -1159,9 +1133,7 @@ const char *DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() { "in MacOSX user processes."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderMacOSXDYLD::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h index 10a3f31cd4b..656a2044c02 100644 --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h @@ -38,9 +38,7 @@ public: virtual ~DynamicLoaderMacOSXDYLD() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -52,12 +50,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ bool ProcessDidExec() override; lldb_private::Status CanLoadImage() override; @@ -67,9 +63,7 @@ public: lldb_private::LazyBool &using_shared_cache, lldb_private::LazyBool &private_shared_cache) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h index 1a2d40042c1..d61f1563497 100644 --- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h +++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h @@ -36,9 +36,7 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ // DynamicLoader protocol - //------------------------------------------------------------------ void DidAttach() override; @@ -53,9 +51,7 @@ public: const lldb::ThreadSP thread, lldb::addr_t tls_file_addr) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp index 2d3d7ea5c13..88ca2e2de01 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -17,11 +17,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process, bool force) { bool create = force; @@ -48,31 +46,23 @@ DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process, return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DynamicLoaderStatic::DynamicLoaderStatic(Process *process) : DynamicLoader(process) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- DynamicLoaderStatic::~DynamicLoaderStatic() {} -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderStatic::DidAttach() { LoadAllImagesAtFileAddresses(); } -//------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. -//------------------------------------------------------------------ void DynamicLoaderStatic::DidLaunch() { LoadAllImagesAtFileAddresses(); } void DynamicLoaderStatic::LoadAllImagesAtFileAddresses() { @@ -156,9 +146,7 @@ const char *DynamicLoaderStatic::GetPluginDescriptionStatic() { "addresses contained in each image."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString DynamicLoaderStatic::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h index 9075df6832c..fa9aded7286 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h @@ -20,9 +20,7 @@ public: ~DynamicLoaderStatic() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -34,12 +32,10 @@ public: static lldb_private::DynamicLoader * CreateInstance(lldb_private::Process *process, bool force); - //------------------------------------------------------------------ /// Called after attaching a process. /// /// Allow DynamicLoader plug-ins to execute some code after /// attaching to a process. - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; @@ -49,9 +45,7 @@ public: lldb_private::Status CanLoadImage() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h index b5242afcfbd..670ba6dce72 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h @@ -15,7 +15,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ASTResultSynthesizer ASTResultSynthesizer.h /// "lldb/Expression/ASTResultSynthesizer.h" Adds a result variable /// declaration to the ASTs for an expression. @@ -28,10 +27,8 @@ namespace lldb_private { /// ASTResultSynthesizer's job is to add the variable and its initialization /// to the ASTs for the expression, and it does so by acting as a SemaConsumer /// for Clang. -//---------------------------------------------------------------------- class ASTResultSynthesizer : public clang::SemaConsumer { public: - //---------------------------------------------------------------------- /// Constructor /// /// \param[in] passthrough @@ -47,25 +44,19 @@ public: /// \param[in] target /// The target, which contains the persistent variable store and the /// AST importer. - //---------------------------------------------------------------------- ASTResultSynthesizer(clang::ASTConsumer *passthrough, bool top_level, Target &target); - //---------------------------------------------------------------------- /// Destructor - //---------------------------------------------------------------------- ~ASTResultSynthesizer() override; - //---------------------------------------------------------------------- /// Link this consumer with a particular AST context /// /// \param[in] Context /// This AST context will be used for types and identifiers, and also /// forwarded to the passthrough consumer, if one exists. - //---------------------------------------------------------------------- void Initialize(clang::ASTContext &Context) override; - //---------------------------------------------------------------------- /// Examine a list of Decls to find the function $__lldb_expr and transform /// its code /// @@ -73,82 +64,58 @@ public: /// The list of Decls to search. These may contain LinkageSpecDecls, /// which need to be searched recursively. That job falls to /// TransformTopLevelDecl. - //---------------------------------------------------------------------- bool HandleTopLevelDecl(clang::DeclGroupRef D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTranslationUnit(clang::ASTContext &Ctx) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTagDeclDefinition(clang::TagDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void CompleteTentativeDefinition(clang::VarDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleVTable(clang::CXXRecordDecl *RD) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void PrintStats() override; - //---------------------------------------------------------------------- /// Set the Sema object to use when performing transforms, and pass it on /// /// \param[in] S /// The Sema to use. Because Sema isn't externally visible, this class /// casts it to an Action for actual use. - //---------------------------------------------------------------------- void InitializeSema(clang::Sema &S) override; - //---------------------------------------------------------------------- /// Reset the Sema to NULL now that transformations are done - //---------------------------------------------------------------------- void ForgetSema() override; - //---------------------------------------------------------------------- /// The parse has succeeded, so record its persistent decls - //---------------------------------------------------------------------- void CommitPersistentDecls(); private: - //---------------------------------------------------------------------- /// Hunt the given Decl for FunctionDecls named $__lldb_expr, recursing as /// necessary through LinkageSpecDecls, and calling SynthesizeResult on /// anything that was found /// /// \param[in] D /// The Decl to hunt. - //---------------------------------------------------------------------- void TransformTopLevelDecl(clang::Decl *D); - //---------------------------------------------------------------------- /// Process an Objective-C method and produce the result variable and /// initialization /// /// \param[in] MethodDecl /// The method to process. - //---------------------------------------------------------------------- bool SynthesizeObjCMethodResult(clang::ObjCMethodDecl *MethodDecl); - //---------------------------------------------------------------------- /// Process a function and produce the result variable and initialization /// /// \param[in] FunDecl /// The function to process. - //---------------------------------------------------------------------- bool SynthesizeFunctionResult(clang::FunctionDecl *FunDecl); - //---------------------------------------------------------------------- /// Process a function body and produce the result variable and /// initialization /// @@ -158,35 +125,28 @@ private: /// \param[in] DC /// The DeclContext of the function, into which the result variable /// is inserted. - //---------------------------------------------------------------------- bool SynthesizeBodyResult(clang::CompoundStmt *Body, clang::DeclContext *DC); - //---------------------------------------------------------------------- /// Given a DeclContext for a function or method, find all types declared in /// the context and record any persistent types found. /// /// \param[in] FunDeclCtx /// The context for the function to process. - //---------------------------------------------------------------------- void RecordPersistentTypes(clang::DeclContext *FunDeclCtx); - //---------------------------------------------------------------------- /// Given a TypeDecl, if it declares a type whose name starts with a dollar /// sign, register it as a pointer type in the target's scratch /// AST context. /// /// \param[in] Body /// The body of the function. - //---------------------------------------------------------------------- void MaybeRecordPersistentType(clang::TypeDecl *D); - //---------------------------------------------------------------------- /// Given a NamedDecl, register it as a pointer type in the target's scratch /// AST context. /// /// \param[in] Body /// The body of the function. - //---------------------------------------------------------------------- void RecordPersistentDecl(clang::NamedDecl *D); clang::ASTContext diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h index 33c06701539..7aef2e254e1 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h @@ -17,7 +17,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ASTStructExtractor ASTStructExtractor.h /// "lldb/Expression/ASTStructExtractor.h" Extracts and describes the argument /// structure for a wrapped function. @@ -32,10 +31,8 @@ namespace lldb_private { /// The definition of this struct is itself in the body of the wrapper /// function, so Clang does the structure layout itself. ASTStructExtractor /// reads through the AST for the wrapper function and finds the struct. -//---------------------------------------------------------------------- class ASTStructExtractor : public clang::SemaConsumer { public: - //---------------------------------------------------------------------- /// Constructor /// /// \param[in] passthrough @@ -52,25 +49,19 @@ public: /// about the argument struct. ClangFunctionCaller friends /// ASTStructExtractor /// for this purpose. - //---------------------------------------------------------------------- ASTStructExtractor(clang::ASTConsumer *passthrough, const char *struct_name, ClangFunctionCaller &function); - //---------------------------------------------------------------------- /// Destructor - //---------------------------------------------------------------------- ~ASTStructExtractor() override; - //---------------------------------------------------------------------- /// Link this consumer with a particular AST context /// /// \param[in] Context /// This AST context will be used for types and identifiers, and also /// forwarded to the passthrough consumer, if one exists. - //---------------------------------------------------------------------- void Initialize(clang::ASTContext &Context) override; - //---------------------------------------------------------------------- /// Examine a list of Decls to find the function $__lldb_expr and transform /// its code /// @@ -78,66 +69,47 @@ public: /// The list of Decls to search. These may contain LinkageSpecDecls, /// which need to be searched recursively. That job falls to /// TransformTopLevelDecl. - //---------------------------------------------------------------------- bool HandleTopLevelDecl(clang::DeclGroupRef D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTranslationUnit(clang::ASTContext &Ctx) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleTagDeclDefinition(clang::TagDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void CompleteTentativeDefinition(clang::VarDecl *D) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void HandleVTable(clang::CXXRecordDecl *RD) override; - //---------------------------------------------------------------------- /// Passthrough stub - //---------------------------------------------------------------------- void PrintStats() override; - //---------------------------------------------------------------------- /// Set the Sema object to use when performing transforms, and pass it on /// /// \param[in] S /// The Sema to use. Because Sema isn't externally visible, this class /// casts it to an Action for actual use. - //---------------------------------------------------------------------- void InitializeSema(clang::Sema &S) override; - //---------------------------------------------------------------------- /// Reset the Sema to NULL now that transformations are done - //---------------------------------------------------------------------- void ForgetSema() override; private: - //---------------------------------------------------------------------- /// Hunt the given FunctionDecl for the argument struct and place /// information about it into m_function /// /// \param[in] F /// The FunctionDecl to hunt. - //---------------------------------------------------------------------- void ExtractFromFunctionDecl(clang::FunctionDecl *F); - //---------------------------------------------------------------------- /// Hunt the given Decl for FunctionDecls named the same as the wrapper /// function name, recursing as necessary through LinkageSpecDecls, and /// calling ExtractFromFunctionDecl on anything that was found /// /// \param[in] D /// The Decl to hunt. - //---------------------------------------------------------------------- void ExtractFromTopLevelDecl(clang::Decl *D); clang::ASTContext diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 1c8e3c7a68c..8d96dbbef93 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -32,10 +32,8 @@ using namespace clang; using namespace lldb_private; -//------------------------------------------------------------------ // Scoped class that will remove an active lexical decl from the set when it // goes out of scope. -//------------------------------------------------------------------ namespace { class ScopedLexicalDeclEraser { public: diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h index e12f1c5c770..09d08d545e2 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangASTSource ClangASTSource.h "lldb/Expression/ClangASTSource.h" /// Provider for named objects defined in the debug info for Clang /// @@ -31,28 +30,21 @@ namespace lldb_private { /// knows the name it is looking for, but nothing else. The ExternalSemaSource /// class provides Decls (VarDecl, FunDecl, TypeDecl) to Clang for these /// names, consulting the ClangExpressionDeclMap to do the actual lookups. -//---------------------------------------------------------------------- class ClangASTSource : public ClangExternalASTSourceCommon, public ClangASTImporter::MapCompleter { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. /// /// \param[in] target /// A reference to the target containing debug information to use. - //------------------------------------------------------------------ ClangASTSource(const lldb::TargetSP &target); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangASTSource() override; - //------------------------------------------------------------------ /// Interface stubs. - //------------------------------------------------------------------ clang::Decl *GetExternalDecl(uint32_t) override { return NULL; } clang::Stmt *GetExternalDeclStmt(uint64_t) override { return NULL; } clang::Selector GetExternalSelector(uint32_t) override { @@ -73,7 +65,6 @@ public: // APIs for ExternalASTSource // - //------------------------------------------------------------------ /// Look up all Decls that match a particular name. Only handles /// Identifiers and DeclContexts that are either NamespaceDecls or /// TranslationUnitDecls. Calls SetExternalVisibleDeclsForName with the @@ -90,11 +81,9 @@ public: /// /// \return /// Whatever SetExternalVisibleDeclsForName returns. - //------------------------------------------------------------------ bool FindExternalVisibleDeclsByName(const clang::DeclContext *DC, clang::DeclarationName Name) override; - //------------------------------------------------------------------ /// Enumerate all Decls in a given lexical context. /// /// \param[in] DC @@ -106,13 +95,11 @@ public: /// /// \param[in] Decls /// A vector that is filled in with matching Decls. - //------------------------------------------------------------------ void FindExternalLexicalDecls( const clang::DeclContext *DC, llvm::function_ref<bool(clang::Decl::Kind)> IsKindWeWant, llvm::SmallVectorImpl<clang::Decl *> &Decls) override; - //------------------------------------------------------------------ /// Specify the layout of the contents of a RecordDecl. /// /// \param[in] Record @@ -144,7 +131,6 @@ public: /// /// \return /// True <=> the layout is valid. - //----------------------------------------------------------------- bool layoutRecordType( const clang::RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap<const clang::FieldDecl *, uint64_t> &FieldOffsets, @@ -153,37 +139,30 @@ public: llvm::DenseMap<const clang::CXXRecordDecl *, clang::CharUnits> &VirtualBaseOffsets) override; - //------------------------------------------------------------------ /// Complete a TagDecl. /// /// \param[in] Tag /// The Decl to be completed in place. - //------------------------------------------------------------------ void CompleteType(clang::TagDecl *Tag) override; - //------------------------------------------------------------------ /// Complete an ObjCInterfaceDecl. /// /// \param[in] Class /// The Decl to be completed in place. - //------------------------------------------------------------------ void CompleteType(clang::ObjCInterfaceDecl *Class) override; - //------------------------------------------------------------------ /// Called on entering a translation unit. Tells Clang by calling /// setHasExternalVisibleStorage() and setHasExternalLexicalStorage() that /// this object has something to say about undefined names. /// /// \param[in] ASTConsumer /// Unused. - //------------------------------------------------------------------ void StartTranslationUnit(clang::ASTConsumer *Consumer) override; // // APIs for NamespaceMapCompleter // - //------------------------------------------------------------------ /// Look up the modules containing a given namespace and put the appropriate /// entries in the namespace map. /// @@ -196,7 +175,6 @@ public: /// \param[in] parent_map /// The map for the namespace's parent namespace, if there is /// one. - //------------------------------------------------------------------ void CompleteNamespaceMap( ClangASTImporter::NamespaceMapSP &namespace_map, ConstString name, ClangASTImporter::NamespaceMapSP &parent_map) const override; @@ -209,12 +187,10 @@ public: AddNamespace(NameSearchContext &context, ClangASTImporter::NamespaceMapSP &namespace_decls); - //------------------------------------------------------------------ /// The worker function for FindExternalVisibleDeclsByName. /// /// \param[in] context /// The NameSearchContext to use when filing results. - //------------------------------------------------------------------ virtual void FindExternalVisibleDecls(NameSearchContext &context); void SetImportInProgress(bool import_in_progress) { @@ -227,13 +203,11 @@ public: } bool GetLookupsEnabled() { return m_lookups_enabled; } - //---------------------------------------------------------------------- /// \class ClangASTSourceProxy ClangASTSource.h /// "lldb/Expression/ClangASTSource.h" Proxy for ClangASTSource /// /// Clang AST contexts like to own their AST sources, so this is a state- /// free proxy object. - //---------------------------------------------------------------------- class ClangASTSourceProxy : public ClangExternalASTSourceCommon { public: ClangASTSourceProxy(ClangASTSource &original) : m_original(original) {} @@ -294,7 +268,6 @@ public: } protected: - //------------------------------------------------------------------ /// Look for the complete version of an Objective-C interface, and return it /// if found. /// @@ -304,11 +277,9 @@ protected: /// \return /// NULL if the complete interface couldn't be found; /// the complete interface otherwise. - //------------------------------------------------------------------ clang::ObjCInterfaceDecl * GetCompleteObjCInterface(const clang::ObjCInterfaceDecl *interface_decl); - //------------------------------------------------------------------ /// Find all entities matching a given name in a given module, using a /// NameSearchContext to make Decls for them. /// @@ -324,33 +295,27 @@ protected: /// \param[in] current_id /// The ID for the current FindExternalVisibleDecls invocation, /// for logging purposes. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, unsigned int current_id); - //------------------------------------------------------------------ /// Find all Objective-C methods matching a given selector. /// /// \param[in] context /// The NameSearchContext that can construct Decls for this name. /// Its m_decl_name contains the selector and its m_decl_context /// is the containing object. - //------------------------------------------------------------------ void FindObjCMethodDecls(NameSearchContext &context); - //------------------------------------------------------------------ /// Find all Objective-C properties and ivars with a given name. /// /// \param[in] context /// The NameSearchContext that can construct Decls for this name. /// Its m_decl_name contains the name and its m_decl_context /// is the containing object. - //------------------------------------------------------------------ void FindObjCPropertyAndIvarDecls(NameSearchContext &context); - //------------------------------------------------------------------ /// A wrapper for ClangASTContext::CopyType that sets a flag that /// indicates that we should not respond to queries during import. /// @@ -366,11 +331,9 @@ protected: /// /// \return /// The imported type. - //------------------------------------------------------------------ CompilerType GuardedCopyType(const CompilerType &src_type); public: - //------------------------------------------------------------------ /// Returns true if a name should be ignored by name lookup. /// /// \param[in] name @@ -382,11 +345,9 @@ public: /// \return /// True if the name is one of a class of names that are ignored by /// global lookup for performance reasons. - //------------------------------------------------------------------ bool IgnoreName(const ConstString name, bool ignore_all_dollar_names); public: - //------------------------------------------------------------------ /// Copies a single Decl into the parser's AST context. /// /// \param[in] src_decl @@ -394,10 +355,8 @@ public: /// /// \return /// A copy of the Decl in m_ast_context, or NULL if the copy failed. - //------------------------------------------------------------------ clang::Decl *CopyDecl(clang::Decl *src_decl); - //------------------------------------------------------------------ /// Copies a single Type to the target of the given ExternalASTMerger. /// /// \param[in] src_context @@ -412,12 +371,10 @@ public: /// /// \return /// A copy of the Type in the merger's target context. - //------------------------------------------------------------------ clang::QualType CopyTypeWithMerger(clang::ASTContext &src_context, clang::ExternalASTMerger &merger, clang::QualType type); - //------------------------------------------------------------------ /// Determined the origin of a single Decl, if it can be found. /// /// \param[in] decl @@ -431,20 +388,15 @@ public: /// /// \return /// True if lookup succeeded; false otherwise. - //------------------------------------------------------------------ bool ResolveDeclOrigin(const clang::Decl *decl, clang::Decl **original_decl, clang::ASTContext **original_ctx); - //------------------------------------------------------------------ /// Returns m_merger_up. Only call this if the target is configured to use /// modern lookup, - //------------------------------------------------------------------ clang::ExternalASTMerger &GetMergerUnchecked(); - //------------------------------------------------------------------ /// Returns true if there is a merger. This only occurs if the target is /// using modern lookup. - //------------------------------------------------------------------ bool HasMerger() { return (bool)m_merger_up; } protected: @@ -470,7 +422,6 @@ protected: std::set<const char *> m_active_lookups; }; -//---------------------------------------------------------------------- /// \class NameSearchContext ClangASTSource.h /// "lldb/Expression/ClangASTSource.h" Container for all objects relevant to a /// single name lookup @@ -478,7 +429,6 @@ protected: /// LLDB needs to create Decls for entities it finds. This class communicates /// what name is being searched for and provides helper functions to construct /// Decls given appropriate type information. -//---------------------------------------------------------------------- struct NameSearchContext { ClangASTSource &m_ast_source; ///< The AST source making the request llvm::SmallVectorImpl<clang::NamedDecl *> @@ -503,7 +453,6 @@ struct NameSearchContext { bool type : 1; } m_found; - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -520,7 +469,6 @@ struct NameSearchContext { /// /// \param[in] dc /// The DeclContext to register Decls in. - //------------------------------------------------------------------ NameSearchContext(ClangASTSource &astSource, llvm::SmallVectorImpl<clang::NamedDecl *> &decls, clang::DeclarationName &name, const clang::DeclContext *dc) @@ -529,16 +477,13 @@ struct NameSearchContext { memset(&m_found, 0, sizeof(m_found)); } - //------------------------------------------------------------------ /// Create a VarDecl with the name being searched for and the provided type /// and register it in the right places. /// /// \param[in] type /// The opaque QualType for the VarDecl being registered. - //------------------------------------------------------------------ clang::NamedDecl *AddVarDecl(const CompilerType &type); - //------------------------------------------------------------------ /// Create a FunDecl with the name being searched for and the provided type /// and register it in the right places. /// @@ -547,41 +492,32 @@ struct NameSearchContext { /// /// \param[in] extern_c /// If true, build an extern "C" linkage specification for this. - //------------------------------------------------------------------ clang::NamedDecl *AddFunDecl(const CompilerType &type, bool extern_c = false); - //------------------------------------------------------------------ /// Create a FunDecl with the name being searched for and generic type (i.e. /// intptr_t NAME_GOES_HERE(...)) and register it in the right places. - //------------------------------------------------------------------ clang::NamedDecl *AddGenericFunDecl(); - //------------------------------------------------------------------ /// Create a TypeDecl with the name being searched for and the provided type /// and register it in the right places. /// /// \param[in] compiler_type /// The opaque QualType for the TypeDecl being registered. - //------------------------------------------------------------------ clang::NamedDecl *AddTypeDecl(const CompilerType &compiler_type); - //------------------------------------------------------------------ /// Add Decls from the provided DeclContextLookupResult to the list of /// results. /// /// \param[in] result /// The DeclContextLookupResult, usually returned as the result /// of querying a DeclContext. - //------------------------------------------------------------------ void AddLookupResult(clang::DeclContextLookupResult result); - //------------------------------------------------------------------ /// Add a NamedDecl to the list of results. /// /// \param[in] decl /// The NamedDecl, usually returned as the result /// of querying a DeclContext. - //------------------------------------------------------------------ void AddNamedDecl(clang::NamedDecl *decl); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h index 9d2dd225ae7..a7e2ced2c45 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h @@ -29,7 +29,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangExpressionDeclMap ClangExpressionDeclMap.h /// "lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are /// defined in LLDB's debug information. @@ -53,10 +52,8 @@ namespace lldb_private { /// /// Fourth and finally, it "dematerializes" the struct after the JITted code /// has has executed, placing the new values back where it found the old ones. -//---------------------------------------------------------------------- class ClangExpressionDeclMap : public ClangASTSource { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -76,19 +73,15 @@ public: /// \param[in] ctx_obj /// If not empty, then expression is evaluated in context of this object. /// See the comment to `UserExpression::Evaluate` for details. - //------------------------------------------------------------------ ClangExpressionDeclMap( bool keep_result_in_memory, Materializer::PersistentVariableDelegate *result_delegate, ExecutionContext &exe_ctx, ValueObject *ctx_obj); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangExpressionDeclMap() override; - //------------------------------------------------------------------ /// Enable the state needed for parsing and IR transformation. /// /// \param[in] exe_ctx @@ -101,26 +94,20 @@ public: /// /// \return /// True if parsing is possible; false if it is unsafe to continue. - //------------------------------------------------------------------ bool WillParse(ExecutionContext &exe_ctx, Materializer *materializer); void InstallCodeGenerator(clang::ASTConsumer *code_gen); - //------------------------------------------------------------------ /// [Used by ClangExpressionParser] For each variable that had an unknown /// type at the beginning of parsing, determine its final type now. /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool ResolveUnknownTypes(); - //------------------------------------------------------------------ /// Disable the state needed for parsing and IR transformation. - //------------------------------------------------------------------ void DidParse(); - //------------------------------------------------------------------ /// [Used by IRForTarget] Add a variable to the list of persistent /// variables for the process. /// @@ -136,12 +123,10 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool AddPersistentVariable(const clang::NamedDecl *decl, ConstString name, TypeFromParser type, bool is_result, bool is_lvalue); - //------------------------------------------------------------------ /// [Used by IRForTarget] Add a variable to the struct that needs to /// be materialized each time the expression runs. /// @@ -162,21 +147,17 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool AddValueToStruct(const clang::NamedDecl *decl, ConstString name, llvm::Value *value, size_t size, lldb::offset_t alignment); - //------------------------------------------------------------------ /// [Used by IRForTarget] Finalize the struct, laying out the position of /// each object in it. /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool DoStructLayout(); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get general information about the laid-out struct /// after DoStructLayout() has been called. /// @@ -191,11 +172,9 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetStructInfo(uint32_t &num_elements, size_t &size, lldb::offset_t &alignment); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get specific information about one field of the /// laid-out struct after DoStructLayout() has been called. /// @@ -225,12 +204,10 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetStructElement(const clang::NamedDecl *&decl, llvm::Value *&value, lldb::offset_t &offset, ConstString &name, uint32_t index); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get information about a function given its Decl. /// /// \param[in] decl @@ -242,10 +219,8 @@ public: /// /// \return /// True if the information could be retrieved; false otherwise. - //------------------------------------------------------------------ bool GetFunctionInfo(const clang::NamedDecl *decl, uint64_t &ptr); - //------------------------------------------------------------------ /// [Used by IRForTarget] Get the address of a symbol given nothing but its /// name. /// @@ -266,7 +241,6 @@ public: /// /// \return /// Valid load address for the symbol - //------------------------------------------------------------------ lldb::addr_t GetSymbolAddress(Target &target, Process *process, ConstString name, lldb::SymbolType symbol_type, @@ -275,7 +249,6 @@ public: lldb::addr_t GetSymbolAddress(ConstString name, lldb::SymbolType symbol_type); - //------------------------------------------------------------------ /// [Used by IRInterpreter] Get basic target information. /// /// \param[out] byte_order @@ -287,7 +260,6 @@ public: /// \return /// True if the information could be determined; false /// otherwise. - //------------------------------------------------------------------ struct TargetInfo { lldb::ByteOrder byte_order; size_t address_byte_size; @@ -300,7 +272,6 @@ public: }; TargetInfo GetTargetInfo(); - //------------------------------------------------------------------ /// [Used by ClangASTSource] Find all entities matching a given name, using /// a NameSearchContext to make Decls for them. /// @@ -309,10 +280,8 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context) override; - //------------------------------------------------------------------ /// Find all entities matching a given name in a given module/namespace, /// using a NameSearchContext to make Decls for them. /// @@ -331,7 +300,6 @@ public: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ void FindExternalVisibleDecls(NameSearchContext &context, lldb::ModuleSP module, CompilerDeclContext &namespace_decl, @@ -353,9 +321,7 @@ private: ///For details see the comment to ///`UserExpression::Evaluate`. - //---------------------------------------------------------------------- /// The following values should not live beyond parsing - //---------------------------------------------------------------------- class ParserVars { public: ParserVars() {} @@ -388,23 +354,17 @@ private: std::unique_ptr<ParserVars> m_parser_vars; - //---------------------------------------------------------------------- /// Activate parser-specific variables - //---------------------------------------------------------------------- void EnableParserVars() { if (!m_parser_vars.get()) m_parser_vars = llvm::make_unique<ParserVars>(); } - //---------------------------------------------------------------------- /// Deallocate parser-specific variables - //---------------------------------------------------------------------- void DisableParserVars() { m_parser_vars.reset(); } - //---------------------------------------------------------------------- /// The following values contain layout information for the materialized /// struct, but are not specific to a single materialization - //---------------------------------------------------------------------- struct StructVars { StructVars() : m_struct_alignment(0), m_struct_size(0), m_struct_laid_out(false), @@ -424,26 +384,19 @@ private: std::unique_ptr<StructVars> m_struct_vars; - //---------------------------------------------------------------------- /// Activate struct variables - //---------------------------------------------------------------------- void EnableStructVars() { if (!m_struct_vars.get()) m_struct_vars.reset(new struct StructVars); } - //---------------------------------------------------------------------- /// Deallocate struct variables - //---------------------------------------------------------------------- void DisableStructVars() { m_struct_vars.reset(); } - //---------------------------------------------------------------------- /// Get this parser's ID for use in extracting parser- and JIT-specific data /// from persistent variables. - //---------------------------------------------------------------------- uint64_t GetParserID() { return (uint64_t) this; } - //------------------------------------------------------------------ /// Given a target, find a variable that matches the given name and type. /// /// \param[in] target @@ -465,13 +418,11 @@ private: /// /// \return /// The LLDB Variable found, or NULL if none was found. - //------------------------------------------------------------------ lldb::VariableSP FindGlobalVariable(Target &target, lldb::ModuleSP &module, ConstString name, CompilerDeclContext *namespace_decl, TypeFromUser *type = NULL); - //------------------------------------------------------------------ /// Get the value of a variable in a given execution context and return the /// associated Types if needed. /// @@ -496,13 +447,11 @@ private: /// /// \return /// Return true if the value was successfully filled in. - //------------------------------------------------------------------ bool GetVariableValue(lldb::VariableSP &var, lldb_private::Value &var_location, TypeFromUser *found_type = NULL, TypeFromParser *parser_type = NULL); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given LLDB /// Variable, and put it in the Tuple list. /// @@ -514,11 +463,9 @@ private: /// /// \param[in] valobj /// The LLDB ValueObject for that variable. - //------------------------------------------------------------------ void AddOneVariable(NameSearchContext &context, lldb::VariableSP var, lldb::ValueObjectSP valobj, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given persistent /// variable, and put it in the list of found entities. /// @@ -531,12 +478,10 @@ private: /// \param[in] current_id /// The ID of the current invocation of FindExternalVisibleDecls /// for logging purposes. - //------------------------------------------------------------------ void AddOneVariable(NameSearchContext &context, lldb::ExpressionVariableSP &pvar_sp, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given LLDB symbol /// (treated as a variable), and put it in the list of found entities. /// @@ -545,11 +490,9 @@ private: /// /// \param[in] var /// The LLDB Variable that needs a Decl. - //------------------------------------------------------------------ void AddOneGenericVariable(NameSearchContext &context, const Symbol &symbol, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given function. /// (Functions are not placed in the Tuple list.) Can handle both fully /// typed functions and generic functions. @@ -564,11 +507,9 @@ private: /// \param[in] sym /// The Symbol that corresponds to a function that needs to be /// created with generic type (unitptr_t foo(...)). - //------------------------------------------------------------------ void AddOneFunction(NameSearchContext &context, Function *fun, Symbol *sym, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given register. /// /// \param[in] context @@ -576,11 +517,9 @@ private: /// /// \param[in] reg_info /// The information corresponding to that register. - //------------------------------------------------------------------ void AddOneRegister(NameSearchContext &context, const RegisterInfo *reg_info, unsigned int current_id); - //------------------------------------------------------------------ /// Use the NameSearchContext to generate a Decl for the given type. (Types /// are not placed in the Tuple list.) /// @@ -589,11 +528,9 @@ private: /// /// \param[in] type /// The type that needs to be created. - //------------------------------------------------------------------ void AddOneType(NameSearchContext &context, const TypeFromUser &type, unsigned int current_id); - //------------------------------------------------------------------ /// Generate a Decl for "*this" and add a member function declaration to it /// for the expression, then report it. /// @@ -602,11 +539,9 @@ private: /// /// \param[in] type /// The type for *this. - //------------------------------------------------------------------ void AddThisType(NameSearchContext &context, const TypeFromUser &type, unsigned int current_id); - //------------------------------------------------------------------ /// Move a type out of the current ASTContext into another, but make sure to /// export all components of the type also. /// @@ -619,7 +554,6 @@ private: /// /// \return /// Returns the moved type, or an empty type if there was a problem. - //------------------------------------------------------------------ TypeFromUser DeportType(ClangASTContext &target, ClangASTContext &source, TypeFromParser parser_type); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h index 40e56637cfe..48da5abb912 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h @@ -23,9 +23,7 @@ namespace lldb_private { class RecordingMemoryManager; -//---------------------------------------------------------------------- // ClangExpressionHelper -//---------------------------------------------------------------------- class ClangExpressionHelper : public ExpressionTypeSystemHelper { public: static bool classof(const ExpressionTypeSystemHelper *ts) { @@ -36,25 +34,19 @@ public: : ExpressionTypeSystemHelper( ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {} - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ virtual ~ClangExpressionHelper() {} - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ virtual ClangExpressionDeclMap *DeclMap() = 0; - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. /// May be NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ virtual clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) = 0; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index f9ddb75ade9..46b711d2a0d 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -613,13 +613,11 @@ ClangExpressionParser::~ClangExpressionParser() {} namespace { -//---------------------------------------------------------------------- /// \class CodeComplete /// /// A code completion consumer for the clang Sema that is responsible for /// creating the completion suggestions when a user requests completion /// of an incomplete `expr` invocation. -//---------------------------------------------------------------------- class CodeComplete : public CodeCompleteConsumer { CodeCompletionTUInfo m_info; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h index 610008efdd4..a42c2190ffb 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h @@ -27,7 +27,6 @@ namespace lldb_private { class IRExecutionUnit; -//---------------------------------------------------------------------- /// \class ClangExpressionParser ClangExpressionParser.h /// "lldb/Expression/ClangExpressionParser.h" Encapsulates an instance of /// Clang that can parse expressions. @@ -37,10 +36,8 @@ class IRExecutionUnit; /// as a glorified parameter list, performing the required parsing and /// conversion to formats (DWARF bytecode, or JIT compiled machine code) that /// can be executed. -//---------------------------------------------------------------------- class ClangExpressionParser : public ExpressionParser { public: - //------------------------------------------------------------------ /// Constructor /// /// Initializes class variables. @@ -56,20 +53,16 @@ public: /// @param[in] include_directories /// List of include directories that should be used when parsing the /// expression. - //------------------------------------------------------------------ ClangExpressionParser(ExecutionContextScope *exe_scope, Expression &expr, bool generate_debug_info, std::vector<ConstString> include_directories = {}); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~ClangExpressionParser() override; bool Complete(CompletionRequest &request, unsigned line, unsigned pos, unsigned typed_pos) override; - //------------------------------------------------------------------ /// Parse a single expression and convert it to IR using Clang. Don't wrap /// the expression in anything at all. /// @@ -79,12 +72,10 @@ public: /// \return /// The number of errors encountered during parsing. 0 means /// success. - //------------------------------------------------------------------ unsigned Parse(DiagnosticManager &diagnostic_manager) override; bool RewriteExpression(DiagnosticManager &diagnostic_manager) override; - //------------------------------------------------------------------ /// Ready an already-parsed expression for execution, possibly evaluating it /// statically. /// @@ -120,14 +111,12 @@ public: /// \return /// An error code indicating the success or failure of the operation. /// Test with Success(). - //------------------------------------------------------------------ Status PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end, lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx, bool &can_interpret, lldb_private::ExecutionPolicy execution_policy) override; - //------------------------------------------------------------------ /// Run all static initializers for an execution unit. /// /// \param[in] execution_unit_sp @@ -138,11 +127,9 @@ public: /// /// \return /// The error code indicating the - //------------------------------------------------------------------ Status RunStaticInitializers(lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx); - //------------------------------------------------------------------ /// Returns a string representing current ABI. /// /// \param[in] target_arch @@ -150,11 +137,9 @@ public: /// /// \return /// A string representing target ABI for the current architecture. - //------------------------------------------------------------------- std::string GetClangTargetABI(const ArchSpec &target_arch); private: - //------------------------------------------------------------------ /// Parses the expression. /// /// \param[in] diagnostic_manager @@ -175,7 +160,6 @@ private: /// /// \return /// The number of parsing errors. - //------------------------------------------------------------------- unsigned ParseInternal(DiagnosticManager &diagnostic_manager, clang::CodeCompleteConsumer *completion = nullptr, unsigned completion_line = 0, diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h index a81f42dff61..bb5e6e79870 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h @@ -34,7 +34,6 @@ namespace lldb_private { class ValueObjectConstResult; -//---------------------------------------------------------------------- /// \class ClangExpressionVariable ClangExpressionVariable.h /// "lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for /// the expression parser. @@ -55,7 +54,6 @@ class ValueObjectConstResult; /// /// This class supports all of these use cases using simple type polymorphism, /// and provides necessary support methods. Its interface is RTTI-neutral. -//---------------------------------------------------------------------- class ClangExpressionVariable : public ExpressionVariable { public: ClangExpressionVariable(ExecutionContextScope *exe_scope, @@ -71,12 +69,9 @@ public: const TypeFromUser &user_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size); - //---------------------------------------------------------------------- /// Utility functions for dealing with ExpressionVariableLists in Clang- /// specific ways - //---------------------------------------------------------------------- - //---------------------------------------------------------------------- /// Finds a variable by NamedDecl in the list. /// /// \param[in] name @@ -84,7 +79,6 @@ public: /// /// \return /// The variable requested, or NULL if that variable is not in the list. - //---------------------------------------------------------------------- static ClangExpressionVariable * FindVariableInList(ExpressionVariableList &list, const clang::NamedDecl *decl, uint64_t parser_id) { @@ -104,7 +98,6 @@ public: return nullptr; } - //---------------------------------------------------------------------- /// If the variable contains its own data, make a Value point at it. If \a /// exe_ctx in not NULL, the value will be resolved in with that execution /// context. @@ -118,12 +111,9 @@ public: /// \return /// True on success; false otherwise (in particular, if this variable /// does not contain its own data). - //---------------------------------------------------------------------- bool PointValueAtData(Value &value, ExecutionContext *exe_ctx); - //---------------------------------------------------------------------- /// The following values should not live beyond parsing - //---------------------------------------------------------------------- class ParserVars { public: ParserVars() @@ -148,22 +138,16 @@ private: ParserVarMap m_parser_vars; public: - //---------------------------------------------------------------------- /// Make this variable usable by the parser by allocating space for parser- /// specific variables - //---------------------------------------------------------------------- void EnableParserVars(uint64_t parser_id) { m_parser_vars.insert(std::make_pair(parser_id, ParserVars())); } - //---------------------------------------------------------------------- /// Deallocate parser-specific variables - //---------------------------------------------------------------------- void DisableParserVars(uint64_t parser_id) { m_parser_vars.erase(parser_id); } - //---------------------------------------------------------------------- /// Access parser-specific variables - //---------------------------------------------------------------------- ParserVars *GetParserVars(uint64_t parser_id) { ParserVarMap::iterator i = m_parser_vars.find(parser_id); @@ -173,9 +157,7 @@ public: return &i->second; } - //---------------------------------------------------------------------- /// The following values are valid if the variable is used by JIT code - //---------------------------------------------------------------------- struct JITVars { JITVars() : m_alignment(0), m_size(0), m_offset(0) {} @@ -191,17 +173,13 @@ private: JITVarMap m_jit_vars; public: - //---------------------------------------------------------------------- /// Make this variable usable for materializing for the JIT by allocating /// space for JIT-specific variables - //---------------------------------------------------------------------- void EnableJITVars(uint64_t parser_id) { m_jit_vars.insert(std::make_pair(parser_id, JITVars())); } - //---------------------------------------------------------------------- /// Deallocate JIT-specific variables - //---------------------------------------------------------------------- void DisableJITVars(uint64_t parser_id) { m_jit_vars.erase(parser_id); } JITVars *GetJITVars(uint64_t parser_id) { @@ -215,16 +193,12 @@ public: TypeFromUser GetTypeFromUser(); - //------------------------------------------------------------------ // llvm casting support - //------------------------------------------------------------------ static bool classof(const ExpressionVariable *ev) { return ev->getKind() == ExpressionVariable::eKindClang; } - //---------------------------------------------------------------------- /// Members - //---------------------------------------------------------------------- DISALLOW_COPY_AND_ASSIGN(ClangExpressionVariable); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp index 27672078c92..eabc96aa8e5 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp @@ -42,9 +42,7 @@ using namespace lldb_private; -//---------------------------------------------------------------------- // ClangFunctionCaller constructor -//---------------------------------------------------------------------- ClangFunctionCaller::ClangFunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &functionAddress, @@ -58,9 +56,7 @@ ClangFunctionCaller::ClangFunctionCaller(ExecutionContextScope &exe_scope, assert(m_jit_process_wp.lock()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ClangFunctionCaller::~ClangFunctionCaller() {} unsigned diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h index 4b0e5869b4e..bdcead230c5 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h @@ -24,7 +24,6 @@ namespace lldb_private { class ASTStructExtractor; class ClangExpressionParser; -//---------------------------------------------------------------------- /// \class ClangFunctionCaller ClangFunctionCaller.h /// "lldb/Expression/ClangFunctionCaller.h" Encapsulates a function that can /// be called. @@ -57,7 +56,6 @@ class ClangExpressionParser; /// /// Any of the methods that take arg_addr_ptr can be passed NULL, and the /// argument space will be managed for you. -//---------------------------------------------------------------------- class ClangFunctionCaller : public FunctionCaller { friend class ASTStructExtractor; @@ -72,20 +70,16 @@ class ClangFunctionCaller : public FunctionCaller { ~ClangFunctionCallerHelper() override = default; - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return NULL; } - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override; @@ -98,7 +92,6 @@ class ClangFunctionCaller : public FunctionCaller { }; public: - //------------------------------------------------------------------ /// Constructor /// /// \param[in] exe_scope @@ -118,7 +111,6 @@ public: /// \param[in] arg_value_list /// The default values to use when calling this function. Can /// be overridden using WriteFunctionArguments(). - //------------------------------------------------------------------ ClangFunctionCaller(ExecutionContextScope &exe_scope, const CompilerType &return_type, const Address &function_address, @@ -126,7 +118,6 @@ public: ~ClangFunctionCaller() override; - //------------------------------------------------------------------ /// Compile the wrapper function /// /// \param[in] thread_to_use_sp @@ -139,7 +130,6 @@ public: /// /// \return /// The number of errors. - //------------------------------------------------------------------ unsigned CompileFunction(lldb::ThreadSP thread_to_use_sp, DiagnosticManager &diagnostic_manager) override; @@ -151,9 +141,7 @@ protected: const char *GetWrapperStructName() { return m_wrapper_struct_name.c_str(); } private: - //------------------------------------------------------------------ // For ClangFunctionCaller only - //------------------------------------------------------------------ // Note: the parser needs to be destructed before the execution unit, so // declare the execution unit first. diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h index 18850870eaf..d5c8757bdcd 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h @@ -21,9 +21,7 @@ namespace lldb_private { class ClangModulesDeclVendor : public DeclVendor { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ClangModulesDeclVendor(); ~ClangModulesDeclVendor() override; @@ -34,7 +32,6 @@ public: typedef uintptr_t ModuleID; typedef std::vector<ModuleID> ModuleVector; - //------------------------------------------------------------------ /// Add a module to the list of modules to search. /// /// \param[in] module @@ -53,12 +50,10 @@ public: /// True if the module could be loaded; false if not. If the /// compiler encountered a fatal error during a previous module /// load, then this will always return false for this ModuleImporter. - //------------------------------------------------------------------ virtual bool AddModule(const SourceModule &module, ModuleVector *exported_modules, Stream &error_stream) = 0; - //------------------------------------------------------------------ /// Add all modules referred to in a given compilation unit to the list /// of modules to search. /// @@ -78,12 +73,10 @@ public: /// loaded; false if one could not be loaded. If the compiler /// encountered a fatal error during a previous module /// load, then this will always return false for this ModuleImporter. - //------------------------------------------------------------------ virtual bool AddModulesForCompileUnit(CompileUnit &cu, ModuleVector &exported_modules, Stream &error_stream) = 0; - //------------------------------------------------------------------ /// Enumerate all the macros that are defined by a given set of modules /// that are already imported. /// @@ -97,12 +90,10 @@ public: /// #define directive). #undef directives are not included; we simply /// elide any corresponding #define. If this function returns true, /// we stop the iteration immediately. - //------------------------------------------------------------------ virtual void ForEachMacro(const ModuleVector &modules, std::function<bool(const std::string &)> handler) = 0; - //------------------------------------------------------------------ /// Query whether Clang supports modules for a particular language. /// LLDB uses this to decide whether to try to find the modules loaded /// by a given compile unit. @@ -112,7 +103,6 @@ public: /// /// \return /// True if Clang has modules for the given language. - //------------------------------------------------------------------ static bool LanguageSupportsClangModules(lldb::LanguageType language); }; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h index 77ecbe71d2e..9a8108d4b37 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h @@ -18,7 +18,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangPersistentVariables ClangPersistentVariables.h /// "lldb/Expression/ClangPersistentVariables.h" Manages persistent values /// that need to be preserved between expression invocations. @@ -26,16 +25,13 @@ namespace lldb_private { /// A list of variables that can be accessed and updated by any expression. See /// ClangPersistentVariable for more discussion. Also provides an increasing, /// 0-based counter for naming result variables. -//---------------------------------------------------------------------- class ClangPersistentVariables : public PersistentExpressionState { public: ClangPersistentVariables(); ~ClangPersistentVariables() override = default; - //------------------------------------------------------------------ // llvm casting support - //------------------------------------------------------------------ static bool classof(const PersistentExpressionState *pv) { return pv->getKind() == PersistentExpressionState::eKindClang; } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp index adad54ad228..42de8c4a5e6 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp @@ -686,7 +686,6 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager, return true; } -//------------------------------------------------------------------ /// Converts an absolute position inside a given code string into /// a column/line pair. /// @@ -704,7 +703,6 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager, /// \param[out] column /// The column in the line that contains the absolute position. /// The first character in a line is indexed as 0. -//------------------------------------------------------------------ static void AbsPosToLineColumnPos(size_t abs_pos, llvm::StringRef code, unsigned &line, unsigned &column) { // Reset to code position to beginning of the file. diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h index 3bfb9529b39..7cf15536649 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h @@ -28,7 +28,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangUserExpression ClangUserExpression.h /// "lldb/Expression/ClangUserExpression.h" Encapsulates a single expression /// for use with Clang @@ -37,7 +36,6 @@ namespace lldb_private { /// and as a backend for the expr command. ClangUserExpression encapsulates /// the objects needed to parse and interpret or JIT an expression. It uses /// the Clang parser to produce LLVM IR from the expression. -//---------------------------------------------------------------------- class ClangUserExpression : public LLVMUserExpression { public: /// LLVM-style RTTI support. @@ -54,10 +52,8 @@ public: ~ClangUserExpressionHelper() override = default; - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return m_expr_decl_map_up.get(); } @@ -69,14 +65,12 @@ public: bool keep_result_in_memory, ValueObject *ctx_obj); - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override; @@ -93,7 +87,6 @@ public: bool m_top_level; }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] expr @@ -116,7 +109,6 @@ public: /// The object (if any) in which context the expression /// must be evaluated. For details see the comment to /// `UserExpression::Evaluate`. - //------------------------------------------------------------------ ClangUserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, @@ -125,7 +117,6 @@ public: ~ClangUserExpression() override; - //------------------------------------------------------------------ /// Parse the expression /// /// \param[in] diagnostic_manager @@ -145,7 +136,6 @@ public: /// /// \return /// True on success (no errors); false otherwise. - //------------------------------------------------------------------ bool Parse(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info) override; @@ -175,10 +165,8 @@ public: bool DidImportCxxModules() const { return m_imported_cpp_modules; } private: - //------------------------------------------------------------------ /// Populate m_in_cplusplus_method and m_in_objectivec_method based on the /// environment. - //------------------------------------------------------------------ void ScanContext(ExecutionContext &exe_ctx, lldb_private::Status &err) override; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp index 780aefdf95f..684cffd815e 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp @@ -29,7 +29,6 @@ using namespace lldb_private; -//------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -37,7 +36,6 @@ using namespace lldb_private; /// /// \param[in] name /// The name of the function, as used in the text. -//------------------------------------------------------------------ ClangUtilityFunction::ClangUtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name) : UtilityFunction(exe_scope, text, name, eKindClangUtilityFunction) { @@ -48,7 +46,6 @@ ClangUtilityFunction::ClangUtilityFunction(ExecutionContextScope &exe_scope, ClangUtilityFunction::~ClangUtilityFunction() {} -//------------------------------------------------------------------ /// Install the utility function into a process /// /// \param[in] diagnostic_manager @@ -59,7 +56,6 @@ ClangUtilityFunction::~ClangUtilityFunction() {} /// /// \return /// True on success (no errors); false otherwise. -//------------------------------------------------------------------ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) { if (m_jit_start_addr != LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h index d6769562d7b..70ebb2f3ad8 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class ClangUtilityFunction ClangUtilityFunction.h /// "lldb/Expression/ClangUtilityFunction.h" Encapsulates a single expression /// for use with Clang @@ -33,7 +32,6 @@ namespace lldb_private { /// functions can perform error-checking for ClangUserExpressions, or can /// simply provide a way to push a function into the target for the debugger /// to call later on. -//---------------------------------------------------------------------- class ClangUtilityFunction : public UtilityFunction { public: /// LLVM-style RTTI support. @@ -47,10 +45,8 @@ public: ~ClangUtilityFunctionHelper() override {} - //------------------------------------------------------------------ /// Return the object that the parser should use when resolving external /// values. May be NULL if everything should be self-contained. - //------------------------------------------------------------------ ClangExpressionDeclMap *DeclMap() override { return m_expr_decl_map_up.get(); } @@ -59,14 +55,12 @@ public: void ResetDeclMap(ExecutionContext &exe_ctx, bool keep_result_in_memory); - //------------------------------------------------------------------ /// Return the object that the parser should allow to access ASTs. May be /// NULL if the ASTs do not need to be transformed. /// /// \param[in] passthrough /// The ASTConsumer that the returned transformer should send /// the ASTs to after transformation. - //------------------------------------------------------------------ clang::ASTConsumer * ASTTransformer(clang::ASTConsumer *passthrough) override { return nullptr; @@ -75,7 +69,6 @@ public: private: std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up; }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] text @@ -83,7 +76,6 @@ public: /// /// \param[in] name /// The name of the function, as used in the text. - //------------------------------------------------------------------ ClangUtilityFunction(ExecutionContextScope &exe_scope, const char *text, const char *name); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h index de3e1457703..f87fd8ac32c 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h @@ -43,7 +43,6 @@ class IRExecutionUnit; class IRMemoryMap; } -//---------------------------------------------------------------------- /// \class IRForTarget IRForTarget.h "lldb/Expression/IRForTarget.h" /// Transforms the IR for a function to run in the target /// @@ -55,12 +54,10 @@ class IRMemoryMap; /// transformations to the IR which make it relocatable. These /// transformations are discussed in more detail next to their relevant /// functions. -//---------------------------------------------------------------------- class IRForTarget : public llvm::ModulePass { public: enum class LookupResult { Success, Fail, Ignore }; - //------------------------------------------------------------------ /// Constructor /// /// \param[in] decl_map @@ -90,18 +87,14 @@ public: /// /// \param[in] func_name /// The name of the function to prepare for execution in the target. - //------------------------------------------------------------------ IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map, bool resolve_vars, lldb_private::IRExecutionUnit &execution_unit, lldb_private::Stream &error_stream, const char *func_name = "$__lldb_expr"); - //------------------------------------------------------------------ /// Destructor - //------------------------------------------------------------------ ~IRForTarget() override; - //------------------------------------------------------------------ /// Run this IR transformer on a single module /// /// Implementation of the llvm::ModulePass::runOnModule() function. @@ -117,28 +110,22 @@ public: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool runOnModule(llvm::Module &llvm_module) override; - //------------------------------------------------------------------ /// Interface stub /// /// Implementation of the llvm::ModulePass::assignPassManager() function. - //------------------------------------------------------------------ void assignPassManager(llvm::PMStack &pass_mgr_stack, llvm::PassManagerType pass_mgr_type = llvm::PMT_ModulePassManager) override; - //------------------------------------------------------------------ /// Returns PMT_ModulePassManager /// /// Implementation of the llvm::ModulePass::getPotentialPassManagerType() /// function. - //------------------------------------------------------------------ llvm::PassManagerType getPotentialPassManagerType() const override; private: - //------------------------------------------------------------------ /// Ensures that the current function's linkage is set to external. /// Otherwise the JIT may not return an address for it. /// @@ -147,15 +134,11 @@ private: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool FixFunctionLinkage(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A module-level pass to replace all function pointers with their /// integer equivalents. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_module @@ -166,15 +149,11 @@ private: /// /// \return /// True on success; false otherwise. - //------------------------------------------------------------------ bool HasSideEffects(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A function-level pass to check whether the function has side /// effects. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Get the address of a function, and a location to put the complete Value /// of the function if one is available. /// @@ -193,18 +172,14 @@ private: /// /// \return /// The pointer. - //------------------------------------------------------------------ LookupResult GetFunctionAddress(llvm::Function *function, uint64_t &ptr, lldb_private::ConstString &name, llvm::Constant **&value_ptr); - //------------------------------------------------------------------ /// A function-level pass to take the generated global value /// $__lldb_expr_result and make it into a persistent variable. Also see /// ASTResultSynthesizer. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Find the NamedDecl corresponding to a Value. This interface is exposed /// for the IR interpreter. /// @@ -216,7 +191,6 @@ private: /// /// \return /// The corresponding variable declaration - //------------------------------------------------------------------ public: static clang::NamedDecl *DeclForGlobal(const llvm::GlobalValue *global_val, llvm::Module *module); @@ -224,7 +198,6 @@ public: private: clang::NamedDecl *DeclForGlobal(llvm::GlobalValue *global); - //------------------------------------------------------------------ /// Set the constant result variable m_const_result to the provided /// constant, assuming it can be evaluated. The result variable will be /// reset to NULL later if the expression has side effects. @@ -237,22 +210,18 @@ private: /// /// \param[in] type /// The Clang type of the result variable. - //------------------------------------------------------------------ void MaybeSetConstantResult(llvm::Constant *initializer, lldb_private::ConstString name, lldb_private::TypeFromParser type); - //------------------------------------------------------------------ /// If the IR represents a cast of a variable, set m_const_result to the /// result of the cast. The result variable will be reset to /// NULL latger if the expression has side effects. /// /// \param[in] type /// The Clang type of the result variable. - //------------------------------------------------------------------ void MaybeSetCastResult(lldb_private::TypeFromParser type); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_function @@ -260,15 +229,11 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool CreateResultVariable(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A module-level pass to find Objective-C constant strings and /// transform them to calls to CFStringCreateWithBytes. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Rewrite a single Objective-C constant string. /// /// \param[in] NSStr @@ -280,19 +245,15 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCConstString(llvm::GlobalVariable *NSStr, llvm::GlobalVariable *CStr); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCConstStrings(); - //------------------------------------------------------------------ /// A basic block-level pass to find all Objective-C method calls and /// rewrite them to use sel_registerName instead of statically allocated /// selectors. The reason is that the selectors are created on the @@ -300,9 +261,7 @@ private: /// section and prepare them. This doesn't happen when code is copied into /// the target, though, and there's no easy way to induce the runtime to /// scan them. So instead we get our selectors from sel_registerName. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Replace a single selector reference /// /// \param[in] selector_load @@ -310,10 +269,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCSelector(llvm::Instruction *selector_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -321,16 +278,12 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCSelectors(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A basic block-level pass to find all Objective-C class references that /// use the old-style Objective-C runtime and rewrite them to use /// class_getClass instead of statically allocated class references. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Replace a single old-style class reference /// /// \param[in] selector_load @@ -338,10 +291,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCClassReference(llvm::Instruction *class_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -349,10 +300,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewriteObjCClassReferences(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A basic block-level pass to find all newly-declared persistent /// variables and register them with the ClangExprDeclMap. This allows them /// to be materialized and dematerialized like normal external variables. @@ -360,9 +309,7 @@ private: /// locals, so they have an allocation. This pass excises these allocations /// and makes references look like external references where they will be /// resolved -- like all other external references -- by ResolveExternals(). - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Handle a single allocation of a persistent variable /// /// \param[in] persistent_alloc @@ -370,26 +317,20 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RewritePersistentAlloc(llvm::Instruction *persistent_alloc); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block /// The basic block currently being processed. - //------------------------------------------------------------------ bool RewritePersistentAllocs(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A function-level pass to find all external variables and functions /// used in the IR. Each found external variable is added to the struct, /// and each external function is resolved in place, its call replaced with /// a call to a function pointer whose value is the address of the function /// in the target process. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Write an initializer to a memory array of assumed sufficient size. /// /// \param[in] data @@ -400,10 +341,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaterializeInitializer(uint8_t *data, llvm::Constant *initializer); - //------------------------------------------------------------------ /// Move an internal variable into the static allocation section. /// /// \param[in] global_variable @@ -411,10 +350,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaterializeInternalVariable(llvm::GlobalVariable *global_variable); - //------------------------------------------------------------------ /// Handle a single externally-defined variable /// /// \param[in] value @@ -422,10 +359,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaybeHandleVariable(llvm::Value *value); - //------------------------------------------------------------------ /// Handle a single externally-defined symbol /// /// \param[in] symbol @@ -433,10 +368,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool HandleSymbol(llvm::Value *symbol); - //------------------------------------------------------------------ /// Handle a single externally-defined Objective-C class /// /// \param[in] classlist_reference @@ -445,10 +378,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool HandleObjCClass(llvm::Value *classlist_reference); - //------------------------------------------------------------------ /// Handle all the arguments to a function call /// /// \param[in] C @@ -456,10 +387,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool MaybeHandleCallArguments(llvm::CallInst *call_inst); - //------------------------------------------------------------------ /// Resolve variable references in calls to external functions /// /// \param[in] basic_block @@ -467,10 +396,8 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ResolveCalls(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// Remove calls to __cxa_atexit, which should never be generated by /// expressions. /// @@ -480,10 +407,8 @@ private: /// \return /// True if the scan was successful; false if some operation /// failed - //------------------------------------------------------------------ bool RemoveCXAAtExit(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -491,25 +416,19 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ResolveExternals(llvm::Function &llvm_function); - //------------------------------------------------------------------ /// A basic block-level pass to excise guard variables from the code. /// The result for the function is passed through Clang as a static /// variable. Static variables normally have guard variables to ensure that /// they are only initialized once. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// Rewrite a load to a guard variable to return constant 0. /// /// \param[in] guard_load /// The load instruction to zero out. - //------------------------------------------------------------------ void TurnGuardLoadIntoZero(llvm::Instruction *guard_load); - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] basic_block @@ -517,17 +436,13 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool RemoveGuards(llvm::BasicBlock &basic_block); - //------------------------------------------------------------------ /// A function-level pass to make all external variable references /// point at the correct offsets from the void* passed into the function. /// ClangExpressionDeclMap::DoStructLayout() must be called beforehand, so /// that the offsets are valid. - //------------------------------------------------------------------ - //------------------------------------------------------------------ /// The top-level pass implementation /// /// \param[in] llvm_function @@ -535,7 +450,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool ReplaceVariables(llvm::Function &llvm_function); /// Flags @@ -585,7 +499,6 @@ private: ///final /// location of the static allocation. - //------------------------------------------------------------------ /// UnfoldConstant operates on a constant [Old] which has just been replaced /// with a value [New]. We assume that new_value has been properly placed /// early in the function, in front of the first instruction in the entry @@ -603,7 +516,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ class FunctionValueCache { public: @@ -627,7 +539,6 @@ private: FunctionValueCache &entry_instruction_finder, lldb_private::Stream &error_stream); - //------------------------------------------------------------------ /// Construct a reference to m_reloc_placeholder with a given type and /// offset. This typically happens after inserting data into /// m_data_allocator. @@ -640,10 +551,8 @@ private: /// /// \return /// The Constant for the reference, usually a ConstantExpr. - //------------------------------------------------------------------ llvm::Constant *BuildRelocation(llvm::Type *type, uint64_t offset); - //------------------------------------------------------------------ /// Commit the allocation in m_data_allocator and use its final location to /// replace m_reloc_placeholder. /// @@ -652,7 +561,6 @@ private: /// /// \return /// True on success; false otherwise - //------------------------------------------------------------------ bool CompleteDataAllocation(); }; diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp index 86f5cefe03d..46252b99de3 100644 --- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp @@ -36,11 +36,9 @@ using namespace lldb_private; #define AlignPC(pc_val) (pc_val & 0xFFFFFFFC) -//---------------------------------------------------------------------- // // ITSession implementation // -//---------------------------------------------------------------------- static bool GetARMDWARFRegisterInfo(unsigned reg_num, RegisterInfo ®_info) { ::memset(®_info, 0, sizeof(RegisterInfo)); @@ -709,11 +707,9 @@ uint32_t ITSession::GetCond() { #define VFPv2_ABOVE (VFPv2 | VFPv3 | AdvancedSIMD) #define VFPv2v3 (VFPv2 | VFPv3) -//---------------------------------------------------------------------- // // EmulateInstructionARM implementation // -//---------------------------------------------------------------------- void EmulateInstructionARM::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), @@ -12852,9 +12848,7 @@ EmulateInstructionARM::ARMOpcode * EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, uint32_t arm_isa) { static ARMOpcode g_arm_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0x0fff0000, 0x092d0000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -12893,9 +12887,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0fbf0f00, 0x0d2d0a00, ARMV6T2_ABOVE, eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPUSH, "vpush.32 <list>"}, - //---------------------------------------------------------------------- // Epilogue instructions - //---------------------------------------------------------------------- {0x0fff0000, 0x08bd0000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulatePOP, "pop <registers>"}, @@ -12906,15 +12898,11 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0fbf0f00, 0x0cbd0a00, ARMV6T2_ABOVE, eEncodingA2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPOP, "vpop.32 <list>"}, - //---------------------------------------------------------------------- // Supervisor Call (previously Software Interrupt) - //---------------------------------------------------------------------- {0x0f000000, 0x0f000000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSVC, "svc #imm24"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- // To resolve ambiguity, "blx <label>" should come before "b #imm24" and // "bl <label>". {0xfe000000, 0xfa000000, ARMV5_ABOVE, eEncodingA2, No_VFP, eSize32, @@ -12932,9 +12920,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, {0x0ffffff0, 0x012fff20, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateBXJRm, "bxj <Rm>"}, - //---------------------------------------------------------------------- // Data-processing instructions - //---------------------------------------------------------------------- // adc (immediate) {0x0fe00000, 0x02a00000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADCImm, "adc{s}<c> <Rd>, <Rn>, #const"}, @@ -13098,9 +13084,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateSUBSPcLrEtc, "<opc>S<c> PC,<Rn>,<Rm{,<shift>}"}, - //---------------------------------------------------------------------- // Load instructions - //---------------------------------------------------------------------- {0x0fd00000, 0x08900000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateLDM, "ldm<c> <Rn>{!} <registers>"}, {0x0fd00000, 0x08100000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -13165,9 +13149,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVLD1SingleAll, "vld1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Store instructions - //---------------------------------------------------------------------- {0x0fd00000, 0x08800000, ARMvAll, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSTM, "stm<c> <Rn>{!} <registers>"}, {0x0fd00000, 0x08000000, ARMvAll, eEncodingA1, No_VFP, eSize32, @@ -13211,9 +13193,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVST1Single, "vst1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Other instructions - //---------------------------------------------------------------------- {0x0fff00f0, 0x06af00f0, ARMV6_ABOVE, eEncodingA1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSXTB, "sxtb<c> <Rd>,<Rm>{,<rotation>}"}, {0x0fff00f0, 0x06bf0070, ARMV6_ABOVE, eEncodingA1, No_VFP, eSize32, @@ -13241,9 +13221,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, uint32_t arm_isa) { static ARMOpcode g_thumb_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0xfffffe00, 0x0000b400, ARMvAll, eEncodingT1, No_VFP, eSize16, @@ -13287,9 +13265,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffbf0f00, 0xed2d0a00, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPUSH, "vpush.32 <list>"}, - //---------------------------------------------------------------------- // Epilogue instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000a800, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateADDSPImm, "add<c> <Rd>, sp, #imm"}, @@ -13306,15 +13282,11 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffbf0f00, 0xecbd0a00, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateVPOP, "vpop.32 <list>"}, - //---------------------------------------------------------------------- // Supervisor Call (previously Software Interrupt) - //---------------------------------------------------------------------- {0xffffff00, 0x0000df00, ARMvAll, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSVC, "svc #imm8"}, - //---------------------------------------------------------------------- // If Then makes up to four following instructions conditional. - //---------------------------------------------------------------------- // The next 5 opcode _must_ come before the if then instruction {0xffffffff, 0x0000bf00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateNop, "nop"}, @@ -13329,9 +13301,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffffff00, 0x0000bf00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateIT, "it{<x>{<y>{<z>}}} <firstcond>"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- // To resolve ambiguity, "b<c> #imm8" should come after "svc #imm8". {0xfffff000, 0x0000d000, ARMvAll, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateB, "b<c> #imm8 (outside IT)"}, @@ -13366,9 +13336,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xfff0fff0, 0xe8d0f010, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateTB, "tbh<c> <Rn>, <Rm>, lsl #1"}, - //---------------------------------------------------------------------- // Data-processing instructions - //---------------------------------------------------------------------- // adc (immediate) {0xfbe08000, 0xf1400000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateADCImm, "adc{s}<c> <Rd>, <Rn>, #<const>"}, @@ -13596,20 +13564,16 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, {0xffffff00, 0xf3de8f00, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateSUBSPcLrEtc, "SUBS<c> PC, LR, #<imm8>"}, - //---------------------------------------------------------------------- // RFE instructions *** IMPORTANT *** THESE MUST BE LISTED **BEFORE** THE // LDM.. Instructions in this table; // otherwise the wrong instructions will be selected. - //---------------------------------------------------------------------- {0xffd0ffff, 0xe810c000, ARMV6T2_ABOVE, eEncodingT1, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfedb<c> <Rn>{!}"}, {0xffd0ffff, 0xe990c000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, &EmulateInstructionARM::EmulateRFE, "rfe{ia}<c> <Rn>{!}"}, - //---------------------------------------------------------------------- // Load instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000c800, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateLDM, "ldm<c> <Rn>{!} <registers>"}, {0xffd02000, 0xe8900000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, @@ -13717,9 +13681,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVLD1SingleAll, "vld1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Store instructions - //---------------------------------------------------------------------- {0xfffff800, 0x0000c000, ARMV4T_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSTM, "stm<c> <Rn>{!} <registers>"}, {0xffd00000, 0xe8800000, ARMV6T2_ABOVE, eEncodingT2, No_VFP, eSize32, @@ -13776,9 +13738,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode, &EmulateInstructionARM::EmulateVST1Single, "vst1<c>.<size> <list>, [<Rn>{@<align>}], <Rm>"}, - //---------------------------------------------------------------------- // Other instructions - //---------------------------------------------------------------------- {0xffffffc0, 0x0000b240, ARMV6_ABOVE, eEncodingT1, No_VFP, eSize16, &EmulateInstructionARM::EmulateSXTB, "sxtb<c> <Rd>,<Rm>"}, {0xfffff080, 0xfa4ff080, ARMV6_ABOVE, eEncodingT2, No_VFP, eSize32, diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp index 978eab1882c..c30d9bc906d 100644 --- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp +++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp @@ -117,11 +117,9 @@ ConstrainUnpredictable(EmulateInstructionARM64::Unpredictable which) { return result; } -//---------------------------------------------------------------------- // // EmulateInstructionARM implementation // -//---------------------------------------------------------------------- void EmulateInstructionARM64::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), @@ -207,9 +205,7 @@ bool EmulateInstructionARM64::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionARM64::Opcode * EmulateInstructionARM64::GetOpcodeForInstruction(const uint32_t opcode) { static EmulateInstructionARM64::Opcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue instructions - //---------------------------------------------------------------------- // push register(s) {0xff000000, 0xd1000000, No_VFP, diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp index b1fbe3215a9..b5a657819af 100644 --- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp +++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp @@ -42,11 +42,9 @@ using namespace lldb_private; #define UInt(x) ((uint64_t)x) #define integer int64_t -//---------------------------------------------------------------------- // // EmulateInstructionMIPS implementation // -//---------------------------------------------------------------------- #ifdef __mips__ extern "C" { @@ -677,9 +675,7 @@ bool EmulateInstructionMIPS::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionMIPS::MipsOpcode * EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { static EmulateInstructionMIPS::MipsOpcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"ADDiu", &EmulateInstructionMIPS::Emulate_ADDiu, "ADDIU rt, rs, immediate"}, {"SW", &EmulateInstructionMIPS::Emulate_SW, "SW rt, offset(rs)"}, @@ -688,9 +684,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"ADDU", &EmulateInstructionMIPS::Emulate_SUBU_ADDU, "ADDU rd, rs, rt"}, {"LUI", &EmulateInstructionMIPS::Emulate_LUI, "LUI rt, immediate"}, - //---------------------------------------------------------------------- // MicroMIPS Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"ADDIUSP_MM", &EmulateInstructionMIPS::Emulate_ADDIUSP, "ADDIU immediate"}, {"ADDIUS5_MM", &EmulateInstructionMIPS::Emulate_ADDIUS5, @@ -711,10 +705,8 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { "LWP rd,offset(base)"}, {"JRADDIUSP", &EmulateInstructionMIPS::Emulate_JRADDIUSP, "JRADDIUSP immediate"}, - //---------------------------------------------------------------------- // Load/Store instructions - //---------------------------------------------------------------------- /* Following list of emulated instructions are required by implementation of hardware watchpoint for MIPS in lldb. As we just need the address accessed by instructions, @@ -834,9 +826,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"SCDX", &EmulateInstructionMIPS::Emulate_LDST_Imm, "SCDX rt, offset(base)"}, - //---------------------------------------------------------------------- // MicroMIPS Load/Store instructions - //---------------------------------------------------------------------- {"LBU16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, "LBU16 rt, decoded_offset(base)"}, {"LHU16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, @@ -854,9 +844,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"SB16_MM", &EmulateInstructionMIPS::Emulate_LDST_Imm, "SB16 rt, offset(base)"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- {"BEQ", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BNE", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BNE rs,rt,offset"}, {"BEQL", &EmulateInstructionMIPS::Emulate_BXX_3ops, "BEQL rs,rt,offset"}, @@ -948,9 +936,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) { {"BNZ_V", &EmulateInstructionMIPS::Emulate_BNZV, "BNZ.V wt,s16"}, {"BZ_V", &EmulateInstructionMIPS::Emulate_BZV, "BZ.V wt,s16"}, - //---------------------------------------------------------------------- // MicroMIPS Branch instructions - //---------------------------------------------------------------------- {"B16_MM", &EmulateInstructionMIPS::Emulate_B16_MM, "B16 offset"}, {"BEQZ16_MM", &EmulateInstructionMIPS::Emulate_Branch_MM, "BEQZ16 rs, offset"}, diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp index 3eacb6611bd..7c1044c499a 100644 --- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp +++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp @@ -42,11 +42,9 @@ using namespace lldb_private; #define UInt(x) ((uint64_t)x) #define integer int64_t -//---------------------------------------------------------------------- // // EmulateInstructionMIPS64 implementation // -//---------------------------------------------------------------------- #ifdef __mips__ extern "C" { @@ -664,9 +662,7 @@ bool EmulateInstructionMIPS64::GetRegisterInfo(RegisterKind reg_kind, EmulateInstructionMIPS64::MipsOpcode * EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { static EmulateInstructionMIPS64::MipsOpcode g_opcodes[] = { - //---------------------------------------------------------------------- // Prologue/Epilogue instructions - //---------------------------------------------------------------------- {"DADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "DADDIU rt, rs, immediate"}, {"ADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, @@ -683,9 +679,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { "ADDU rd, rs, rt"}, {"LUI", &EmulateInstructionMIPS64::Emulate_LUI, "LUI rt, immediate"}, - //---------------------------------------------------------------------- // Load/Store instructions - //---------------------------------------------------------------------- /* Following list of emulated instructions are required by implementation of hardware watchpoint for MIPS in lldb. As we just need the address accessed by instructions, @@ -791,9 +785,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) { {"SWXC1", &EmulateInstructionMIPS64::Emulate_LDST_Reg, "SWXC1 fs, index (base)"}, - //---------------------------------------------------------------------- // Branch instructions - //---------------------------------------------------------------------- {"BEQ", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BEQ64", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BEQ rs,rt,offset"}, {"BNE", &EmulateInstructionMIPS64::Emulate_BXX_3ops, "BNE rs,rt,offset"}, diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp index a98f8601124..4fbdd22b84b 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp @@ -34,9 +34,7 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Debug Interface Structures -//------------------------------------------------------------------ typedef enum { JIT_NOACTION = 0, JIT_REGISTER_FN, @@ -177,9 +175,7 @@ void JITLoaderGDB::ModulesDidLoad(ModuleList &module_list) { SetJITBreakpoint(module_list); } -//------------------------------------------------------------------ // Setup the JIT Breakpoint -//------------------------------------------------------------------ void JITLoaderGDB::SetJITBreakpoint(lldb_private::ModuleList &module_list) { if (DidSetJITBreakpoint()) return; @@ -405,9 +401,7 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) { return false; // Continue Running. } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString JITLoaderGDB::GetPluginNameStatic() { static ConstString g_name("gdb"); return g_name; diff --git a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h index e9938d4c495..2a2537c3edd 100644 --- a/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h +++ b/lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h @@ -20,9 +20,7 @@ public: ~JITLoaderGDB() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -36,16 +34,12 @@ public: static void DebuggerInitialize(lldb_private::Debugger &debugger); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // JITLoader interface - //------------------------------------------------------------------ void DidAttach() override; void DidLaunch() override; diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 32562451c8c..d7232bd155d 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -56,9 +56,7 @@ lldb_private::ConstString CPlusPlusLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString CPlusPlusLanguage::GetPluginName() { return GetPluginNameStatic(); @@ -66,9 +64,7 @@ lldb_private::ConstString CPlusPlusLanguage::GetPluginName() { uint32_t CPlusPlusLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *CPlusPlusLanguage::CreateInstance(lldb::LanguageType language) { if (Language::LanguageIsCPlusPlus(language)) diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h index c6792e9a72a..d30e5608073 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h @@ -92,9 +92,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -127,9 +125,7 @@ public: FindAlternateFunctionManglings(const ConstString mangled, std::set<ConstString> &candidates); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp index 762d91706b3..ad2953417ab 100644 --- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp @@ -48,9 +48,7 @@ lldb_private::ConstString ObjCLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjCLanguage::GetPluginName() { return GetPluginNameStatic(); @@ -58,9 +56,7 @@ lldb_private::ConstString ObjCLanguage::GetPluginName() { uint32_t ObjCLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *ObjCLanguage::CreateInstance(lldb::LanguageType language) { switch (language) { diff --git a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h index aed867e2e36..8699060ebd4 100644 --- a/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h +++ b/lldb/source/Plugins/Language/ObjC/ObjCLanguage.h @@ -123,9 +123,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -154,9 +152,7 @@ public: return false; } - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp index 69e82510d19..81b3c5807c4 100644 --- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp @@ -38,18 +38,14 @@ lldb_private::ConstString ObjCPlusPlusLanguage::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjCPlusPlusLanguage::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjCPlusPlusLanguage::GetPluginVersion() { return 1; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ Language *ObjCPlusPlusLanguage::CreateInstance(lldb::LanguageType language) { switch (language) { case lldb::eLanguageTypeObjC_plus_plus: diff --git a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h index 6f801d02d33..6224a3f47b3 100644 --- a/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h +++ b/lldb/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h @@ -31,9 +31,7 @@ public: const Highlighter *GetHighlighter() const override { return &m_highlighter; } - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -42,9 +40,7 @@ public: static lldb_private::ConstString GetPluginNameStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp index d702f7c3666..66278cacc44 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -313,9 +313,7 @@ bool ItaniumABILanguageRuntime::IsVTableName(const char *name) { return strstr(name, "_vptr$") == name; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime * ItaniumABILanguageRuntime::CreateInstance(Process *process, lldb::LanguageType language) { @@ -427,9 +425,7 @@ lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ItaniumABILanguageRuntime::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h index 1507da952d7..80b53efdaed 100644 --- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h @@ -26,9 +26,7 @@ class ItaniumABILanguageRuntime : public lldb_private::CPPLanguageRuntime { public: ~ItaniumABILanguageRuntime() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -68,9 +66,7 @@ public: lldb::ValueObjectSP GetExceptionObjectForThread( lldb::ThreadSP thread_sp) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp index 96addf44fdb..419f209068d 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp @@ -343,9 +343,7 @@ ThreadPlanSP AppleObjCRuntime::GetStepThroughTrampolinePlan(Thread &thread, return thread_plan_sp; } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ ObjCLanguageRuntime::ObjCRuntimeVersions AppleObjCRuntime::GetObjCVersion(Process *process, ModuleSP &objc_module_sp) { if (!process) diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h index bd72cd734a0..fe716bbd5fa 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h @@ -23,9 +23,7 @@ class AppleObjCRuntime : public lldb_private::ObjCLanguageRuntime { public: ~AppleObjCRuntime() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ // Note there is no CreateInstance, Initialize & Terminate functions here, // because // you can't make an instance of this generic runtime. diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp index 1b177829363..116f4d78ea2 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp @@ -61,9 +61,7 @@ bool AppleObjCRuntimeV1::GetDynamicTypeAndAddress( return !class_type_or_name.IsEmpty(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ lldb_private::LanguageRuntime * AppleObjCRuntimeV1::CreateInstance(Process *process, lldb::LanguageType language) { @@ -97,9 +95,7 @@ lldb_private::ConstString AppleObjCRuntimeV1::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString AppleObjCRuntimeV1::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h index 47214ff3b62..85364966b2d 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h @@ -19,9 +19,7 @@ class AppleObjCRuntimeV1 : public AppleObjCRuntime { public: ~AppleObjCRuntimeV1() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -99,9 +97,7 @@ public: UtilityFunction *CreateObjectChecker(const char *) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp index 1264b63c333..49e3e877532 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -453,9 +453,7 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress( return !class_type_or_name.IsEmpty(); } -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime *AppleObjCRuntimeV2::CreateInstance(Process *process, LanguageType language) { // FIXME: This should be a MacOS or iOS process, and we need to look for the @@ -785,9 +783,7 @@ lldb_private::ConstString AppleObjCRuntimeV2::GetPluginNameStatic() { return g_name; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString AppleObjCRuntimeV2::GetPluginName() { return GetPluginNameStatic(); } @@ -868,20 +864,16 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, const char *class_name = parent_ast_type.GetConstTypeName().AsCString(); if (class_name && class_name[0] && ivar_name && ivar_name[0]) { - //---------------------------------------------------------------------- // Make the objective C V2 mangled name for the ivar offset from the class // name and ivar name - //---------------------------------------------------------------------- std::string buffer("OBJC_IVAR_$_"); buffer.append(class_name); buffer.push_back('.'); buffer.append(ivar_name); ConstString ivar_const_str(buffer.c_str()); - //---------------------------------------------------------------------- // Try to get the ivar offset address from the symbol table first using the // name we created above - //---------------------------------------------------------------------- SymbolContextList sc_list; Target &target = m_process->GetTarget(); target.GetImages().FindSymbolsWithNameAndType(ivar_const_str, @@ -898,10 +890,8 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type, ivar_offset_symbol.symbol->GetLoadAddress(&target); } - //---------------------------------------------------------------------- // If we didn't get the ivar offset address from the symbol table, fall // back to getting it from the runtime - //---------------------------------------------------------------------- if (ivar_offset_address == LLDB_INVALID_ADDRESS) ivar_offset_address = LookupRuntimeSymbol(ivar_const_str); diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h index 5a4fc6970ab..dc588526f02 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h @@ -25,9 +25,7 @@ class AppleObjCRuntimeV2 : public AppleObjCRuntime { public: ~AppleObjCRuntimeV2() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -55,9 +53,7 @@ public: UtilityFunction *CreateObjectChecker(const char *) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp index bbfd8075db9..3436464d024 100644 --- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp +++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp @@ -1,5 +1,4 @@ //===-- AppleThreadPlanStepThroughObjCTrampoline.cpp -//--------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -26,9 +25,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // ThreadPlanStepThroughObjCTrampoline constructor -//---------------------------------------------------------------------- AppleThreadPlanStepThroughObjCTrampoline:: AppleThreadPlanStepThroughObjCTrampoline( Thread &thread, AppleObjCTrampolineHandler *trampoline_handler, @@ -42,9 +39,7 @@ AppleThreadPlanStepThroughObjCTrampoline:: m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(NULL), m_stop_others(stop_others) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- AppleThreadPlanStepThroughObjCTrampoline:: ~AppleThreadPlanStepThroughObjCTrampoline() {} diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp index 81551e713aa..0ea4d91f8f7 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -790,9 +790,7 @@ const uint32_t RenderScriptRuntime::AllocationDetails::RSTypeToFormat[][3] = { // RS_TYPE_MATRIX_2X2 {eFormatVectorOfFloat32, eFormatVectorOfFloat32, sizeof(float) * 4}}; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ LanguageRuntime * RenderScriptRuntime::CreateInstance(Process *process, lldb::LanguageType language) { @@ -1030,9 +1028,7 @@ void RenderScriptRuntime::ModulesDidLoad(const ModuleList &module_list) { } } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString RenderScriptRuntime::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h index d416b923286..c3114b987a4 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -301,9 +301,7 @@ public: ~RenderScriptRuntime() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -395,9 +393,7 @@ public: return false; } - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp index a52c00107c1..c364dd07578 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp @@ -436,9 +436,7 @@ ObjectFileSP ObjectContainerBSDArchive::GetObjectFile(const FileSpec *file) { return ObjectFileSP(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectContainerBSDArchive::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h index 13afb98fa72..84ddd058571 100644 --- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h +++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h @@ -31,9 +31,7 @@ public: ~ObjectContainerBSDArchive() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -56,9 +54,7 @@ public: static bool MagicBytesMatch(const lldb_private::DataExtractor &data); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; size_t GetNumObjects() const override { @@ -71,9 +67,7 @@ public: lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -153,9 +147,7 @@ protected: protected: typedef lldb_private::UniqueCStringMap<uint32_t> ObjectNameToIndexMap; - //---------------------------------------------------------------------- // Member Variables - //---------------------------------------------------------------------- lldb_private::ArchSpec m_arch; llvm::sys::TimePoint<> m_time; lldb::offset_t m_file_offset; diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp index 9e4dc5af0a4..c392addc82b 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp @@ -202,9 +202,7 @@ ObjectContainerUniversalMachO::GetObjectFile(const FileSpec *file) { return ObjectFileSP(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectContainerUniversalMachO::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h index e2377fde35d..51304971034 100644 --- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h +++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h @@ -23,9 +23,7 @@ public: ~ObjectContainerUniversalMachO() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,9 +46,7 @@ public: static bool MagicBytesMatch(const lldb_private::DataExtractor &data); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; void Dump(lldb_private::Stream *s) const override; @@ -62,9 +58,7 @@ public: lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h index 15930815cf4..e8885e0cc89 100644 --- a/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h +++ b/lldb/source/Plugins/ObjectFile/Breakpad/ObjectFileBreakpad.h @@ -17,9 +17,7 @@ namespace breakpad { class ObjectFileBreakpad : public ObjectFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -45,16 +43,12 @@ public: lldb::offset_t length, ModuleSpecList &specs); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------------ // ObjectFile Protocol. - //------------------------------------------------------------------ bool ParseHeader() override; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp index 13d85d1c95b..7f9665af9a3 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -18,7 +18,6 @@ using namespace elf; using namespace lldb; using namespace llvm::ELF; -//------------------------------------------------------------------------------ // Static utility functions. // // GetMaxU64 and GetMaxS64 wrap the similarly named methods from DataExtractor @@ -67,7 +66,6 @@ static bool GetMaxS64(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFHeader ELFHeader::ELFHeader() { memset(this, 0, sizeof(ELFHeader)); } @@ -215,7 +213,6 @@ unsigned ELFHeader::GetRelocationJumpSlotType() const { return slot; } -//------------------------------------------------------------------------------ // ELFSectionHeader ELFSectionHeader::ELFSectionHeader() { @@ -249,7 +246,6 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFSymbol ELFSymbol::ELFSymbol() { memset(this, 0, sizeof(ELFSymbol)); } @@ -357,7 +353,6 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFProgramHeader ELFProgramHeader::ELFProgramHeader() { @@ -398,7 +393,6 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data, return true; } -//------------------------------------------------------------------------------ // ELFDynamic ELFDynamic::ELFDynamic() { memset(this, 0, sizeof(ELFDynamic)); } @@ -409,7 +403,6 @@ bool ELFDynamic::Parse(const lldb_private::DataExtractor &data, return GetMaxS64(data, offset, &d_tag, byte_size, 2); } -//------------------------------------------------------------------------------ // ELFRel ELFRel::ELFRel() { memset(this, 0, sizeof(ELFRel)); } @@ -422,7 +415,6 @@ bool ELFRel::Parse(const lldb_private::DataExtractor &data, return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false; } -//------------------------------------------------------------------------------ // ELFRela ELFRela::ELFRela() { memset(this, 0, sizeof(ELFRela)); } diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h index 2a2b13243fe..bb228e269d4 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.h @@ -31,7 +31,6 @@ class DataExtractor; namespace elf { -//------------------------------------------------------------------------------ /// \name ELF type definitions. /// /// Types used to represent the various components of ELF structures. All @@ -49,7 +48,6 @@ typedef uint64_t elf_xword; typedef int64_t elf_sxword; //@} -//------------------------------------------------------------------------------ /// \class ELFHeader /// Generic representation of an ELF file header. /// @@ -80,7 +78,6 @@ struct ELFHeader { ELFHeader(); - //-------------------------------------------------------------------------- /// Returns true if this is a 32 bit ELF file header. /// /// \return @@ -89,7 +86,6 @@ struct ELFHeader { return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS32; } - //-------------------------------------------------------------------------- /// Returns true if this is a 64 bit ELF file header. /// /// \return @@ -98,18 +94,15 @@ struct ELFHeader { return e_ident[llvm::ELF::EI_CLASS] == llvm::ELF::ELFCLASS64; } - //-------------------------------------------------------------------------- /// The byte order of this ELF file header. /// /// \return /// The byte order of this ELF file as described by the header. lldb::ByteOrder GetByteOrder() const; - //-------------------------------------------------------------------------- /// The jump slot relocation type of this ELF. unsigned GetRelocationJumpSlotType() const; - //-------------------------------------------------------------------------- /// Check if there should be header extension in section header #0 /// /// \return @@ -117,7 +110,6 @@ struct ELFHeader { /// and false otherwise. bool HasHeaderExtension() const; - //-------------------------------------------------------------------------- /// Parse an ELFHeader entry starting at position \p offset and update the /// data extractor with the address size and byte order attributes as /// defined by the header. @@ -135,7 +127,6 @@ struct ELFHeader { /// otherwise. bool Parse(lldb_private::DataExtractor &data, lldb::offset_t *offset); - //-------------------------------------------------------------------------- /// Examines at most EI_NIDENT bytes starting from the given pointer and /// determines if the magic ELF identification exists. /// @@ -143,7 +134,6 @@ struct ELFHeader { /// True if the given sequence of bytes identifies an ELF file. static bool MagicBytesMatch(const uint8_t *magic); - //-------------------------------------------------------------------------- /// Examines at most EI_NIDENT bytes starting from the given address and /// determines the address size of the underlying ELF file. This function /// should only be called on an pointer for which MagicBytesMatch returns @@ -156,7 +146,6 @@ struct ELFHeader { private: - //-------------------------------------------------------------------------- /// Parse an ELFHeader header extension entry. This method is called by /// Parse(). /// @@ -165,7 +154,6 @@ private: void ParseHeaderExtension(lldb_private::DataExtractor &data); }; -//------------------------------------------------------------------------------ /// \class ELFSectionHeader /// Generic representation of an ELF section header. struct ELFSectionHeader { @@ -182,7 +170,6 @@ struct ELFSectionHeader { ELFSectionHeader(); - //-------------------------------------------------------------------------- /// Parse an ELFSectionHeader entry from the given DataExtracter starting at /// position \p offset. /// @@ -200,7 +187,6 @@ struct ELFSectionHeader { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFProgramHeader /// Generic representation of an ELF program header. struct ELFProgramHeader { @@ -233,7 +219,6 @@ struct ELFProgramHeader { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFSymbol /// Represents a symbol within an ELF symbol table. struct ELFSymbol { @@ -286,7 +271,6 @@ struct ELFSymbol { const lldb_private::SectionList *section_list); }; -//------------------------------------------------------------------------------ /// \class ELFDynamic /// Represents an entry in an ELF dynamic table. struct ELFDynamic { @@ -316,7 +300,6 @@ struct ELFDynamic { bool Parse(const lldb_private::DataExtractor &data, lldb::offset_t *offset); }; -//------------------------------------------------------------------------------ /// \class ELFRel /// Represents a relocation entry with an implicit addend. struct ELFRel { @@ -358,7 +341,6 @@ struct ELFRel { static unsigned RelocSymbol64(const ELFRel &rel) { return rel.r_info >> 32; } }; -//------------------------------------------------------------------------------ /// \class ELFRela /// Represents a relocation entry with an explicit addend. struct ELFRela { diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d3a78239427..ac9642b2968 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -336,9 +336,7 @@ static uint32_t subTypeFromElfHeader(const elf::ELFHeader &header) { // Arbitrary constant used as UUID prefix for core files. const uint32_t ObjectFileELF::g_core_uuid_magic(0xE210C); -//------------------------------------------------------------------ // Static methods. -//------------------------------------------------------------------ void ObjectFileELF::Initialize() { PluginManager::RegisterPlugin(GetPluginNameStatic(), GetPluginDescriptionStatic(), CreateInstance, @@ -711,17 +709,13 @@ size_t ObjectFileELF::GetModuleSpecifications( return specs.GetSize() - initial_count; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileELF::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjectFileELF::GetPluginVersion() { return m_plugin_version; } -//------------------------------------------------------------------ // ObjectFile protocol -//------------------------------------------------------------------ ObjectFileELF::ObjectFileELF(const lldb::ModuleSP &module_sp, DataBufferSP &data_sp, lldb::offset_t data_offset, @@ -1009,9 +1003,7 @@ Address ObjectFileELF::GetBaseAddress() { return LLDB_INVALID_ADDRESS; } -//---------------------------------------------------------------------- // ParseDependentModules -//---------------------------------------------------------------------- size_t ObjectFileELF::ParseDependentModules() { if (m_filespec_up) return m_filespec_up->GetSize(); @@ -1070,9 +1062,7 @@ size_t ObjectFileELF::ParseDependentModules() { return m_filespec_up->GetSize(); } -//---------------------------------------------------------------------- // GetProgramHeaderInfo -//---------------------------------------------------------------------- size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers, DataExtractor &object_data, const ELFHeader &header) { @@ -1107,9 +1097,7 @@ size_t ObjectFileELF::GetProgramHeaderInfo(ProgramHeaderColl &program_headers, return program_headers.size(); } -//---------------------------------------------------------------------- // ParseProgramHeaders -//---------------------------------------------------------------------- bool ObjectFileELF::ParseProgramHeaders() { return GetProgramHeaderInfo(m_program_headers, m_data, m_header) != 0; } @@ -1302,8 +1290,6 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data, // the contents look like this in a 64 bit ELF core file: count = // 0x000000000000000a (10) page_size = 0x0000000000001000 (4096) Index // start end file_ofs path ===== - // ------------------ ------------------ ------------------ - // ------------------------------------- [ 0] 0x0000000000400000 // 0x0000000000401000 0x0000000000000000 /tmp/a.out [ 1] // 0x0000000000600000 0x0000000000601000 0x0000000000000000 /tmp/a.out [ // 2] 0x0000000000601000 0x0000000000602000 0x0000000000000001 /tmp/a.out @@ -1427,9 +1413,7 @@ void ObjectFileELF::ParseARMAttributes(DataExtractor &data, uint64_t length, } } -//---------------------------------------------------------------------- // GetSectionHeaderInfo -//---------------------------------------------------------------------- size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, DataExtractor &object_data, const elf::ELFHeader &header, @@ -1662,9 +1646,7 @@ ObjectFileELF::StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const { return symbol_name.substr(0, pos); } -//---------------------------------------------------------------------- // ParseSectionHeaders -//---------------------------------------------------------------------- size_t ObjectFileELF::ParseSectionHeaders() { return GetSectionHeaderInfo(m_section_headers, m_data, m_header, m_uuid, m_gnu_debuglink_file, m_gnu_debuglink_crc, @@ -2932,7 +2914,6 @@ bool ObjectFileELF::IsStripped() { // // Dump the specifics of the runtime file container (such as any headers // segments, sections, etc). -//---------------------------------------------------------------------- void ObjectFileELF::Dump(Stream *s) { ModuleSP module_sp(GetModule()); if (!module_sp) { @@ -2966,11 +2947,9 @@ void ObjectFileELF::Dump(Stream *s) { s->EOL(); } -//---------------------------------------------------------------------- // DumpELFHeader // // Dump the ELF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) { s->PutCString("ELF Header\n"); s->Printf("e_ident[EI_MAG0 ] = 0x%2.2x\n", header.e_ident[EI_MAG0]); @@ -3003,11 +2982,9 @@ void ObjectFileELF::DumpELFHeader(Stream *s, const ELFHeader &header) { s->Printf("e_shstrndx = 0x%8.8x\n", header.e_shstrndx); } -//---------------------------------------------------------------------- // DumpELFHeader_e_type // // Dump an token value for the ELF header member e_type -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) { switch (e_type) { case ET_NONE: @@ -3030,11 +3007,9 @@ void ObjectFileELF::DumpELFHeader_e_type(Stream *s, elf_half e_type) { } } -//---------------------------------------------------------------------- // DumpELFHeader_e_ident_EI_DATA // // Dump an token value for the ELF header member e_ident[EI_DATA] -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s, unsigned char ei_data) { switch (ei_data) { @@ -3052,11 +3027,9 @@ void ObjectFileELF::DumpELFHeader_e_ident_EI_DATA(Stream *s, } } -//---------------------------------------------------------------------- // DumpELFProgramHeader // // Dump a single ELF program header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader(Stream *s, const ELFProgramHeader &ph) { DumpELFProgramHeader_p_type(s, ph.p_type); @@ -3069,12 +3042,10 @@ void ObjectFileELF::DumpELFProgramHeader(Stream *s, s->Printf(") %8.8" PRIx64, ph.p_align); } -//---------------------------------------------------------------------- // DumpELFProgramHeader_p_type // // Dump an token value for the ELF program header member p_type which describes // the type of the program header -// ---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) { const int kStrWidth = 15; switch (p_type) { @@ -3093,11 +3064,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) { } } -//---------------------------------------------------------------------- // DumpELFProgramHeader_p_flags // // Dump an token value for the ELF program header member p_flags -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) { *s << ((p_flags & PF_X) ? "PF_X" : " ") << (((p_flags & PF_X) && (p_flags & PF_W)) ? '+' : ' ') @@ -3106,11 +3075,9 @@ void ObjectFileELF::DumpELFProgramHeader_p_flags(Stream *s, elf_word p_flags) { << ((p_flags & PF_R) ? "PF_R" : " "); } -//---------------------------------------------------------------------- // DumpELFProgramHeaders // // Dump all of the ELF program header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFProgramHeaders(Stream *s) { if (!ParseProgramHeaders()) return; @@ -3128,11 +3095,9 @@ void ObjectFileELF::DumpELFProgramHeaders(Stream *s) { } } -//---------------------------------------------------------------------- // DumpELFSectionHeader // // Dump a single ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader(Stream *s, const ELFSectionHeaderInfo &sh) { s->Printf("%8.8x ", sh.sh_name); @@ -3145,12 +3110,10 @@ void ObjectFileELF::DumpELFSectionHeader(Stream *s, s->Printf(" %8.8" PRIx64 " %8.8" PRIx64, sh.sh_addralign, sh.sh_entsize); } -//---------------------------------------------------------------------- // DumpELFSectionHeader_sh_type // // Dump an token value for the ELF section header member sh_type which // describes the type of the section -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) { const int kStrWidth = 12; switch (sh_type) { @@ -3176,11 +3139,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_type(Stream *s, elf_word sh_type) { } } -//---------------------------------------------------------------------- // DumpELFSectionHeader_sh_flags // // Dump an token value for the ELF section header member sh_flags -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, elf_xword sh_flags) { *s << ((sh_flags & SHF_WRITE) ? "WRITE" : " ") @@ -3190,11 +3151,9 @@ void ObjectFileELF::DumpELFSectionHeader_sh_flags(Stream *s, << ((sh_flags & SHF_EXECINSTR) ? "EXECINSTR" : " "); } -//---------------------------------------------------------------------- // DumpELFSectionHeaders // // Dump all of the ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFileELF::DumpELFSectionHeaders(Stream *s) { if (!ParseSectionHeaders()) return; diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h index b11a4bdbe17..b63a5d14d4f 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h @@ -49,7 +49,6 @@ struct ELFNote { } }; -//------------------------------------------------------------------------------ /// \class ObjectFileELF /// Generic ELF object file reader. /// @@ -59,9 +58,7 @@ class ObjectFileELF : public lldb_private::ObjectFile { public: ~ObjectFileELF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -89,16 +86,12 @@ public: static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // ObjectFile Protocol. - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp index 6dd72a3c8c0..ad15f961736 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp @@ -194,9 +194,7 @@ ArchSpec ObjectFileJIT::GetArchitecture() { return ArchSpec(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileJIT::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h index 694bbcdcc9a..99241126cd1 100644 --- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h +++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h @@ -12,10 +12,8 @@ #include "lldb/Core/Address.h" #include "lldb/Symbol/ObjectFile.h" -//---------------------------------------------------------------------- // This class needs to be hidden as eventually belongs in a plugin that // will export the ObjectFile protocol -//---------------------------------------------------------------------- class ObjectFileJIT : public lldb_private::ObjectFile { public: ObjectFileJIT(const lldb::ModuleSP &module_sp, @@ -23,9 +21,7 @@ public: ~ObjectFileJIT() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -50,9 +46,7 @@ public: lldb::offset_t length, lldb_private::ModuleSpecList &specs); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, @@ -94,9 +88,7 @@ public: ObjectFile::Strata CalculateStrata() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index bdc4e19c3e6..b6db8d77a26 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -3104,9 +3104,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLocal; break; - //---------------------------------------------------------------------- // INCL scopes - //---------------------------------------------------------------------- case N_BINCL: // include file beginning: name,,NO_SECT,0,sum We use // the current number of symbols in the symbol table @@ -3167,9 +3165,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLineEntry; break; - //---------------------------------------------------------------------- // Left and Right Braces - //---------------------------------------------------------------------- case N_LBRAC: // left bracket: 0,,NO_SECT,nesting level,address We // use the current number of symbols in the symbol @@ -3204,9 +3200,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeHeaderFile; break; - //---------------------------------------------------------------------- // COMM scopes - //---------------------------------------------------------------------- case N_BCOMM: // begin common: name,,NO_SECT,0,0 // We use the current number of symbols in the symbol @@ -4052,9 +4046,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLocal; break; - //---------------------------------------------------------------------- // INCL scopes - //---------------------------------------------------------------------- case N_BINCL: // include file beginning: name,,NO_SECT,0,sum We use the current // number of symbols in the symbol table in lieu of using nlist_idx @@ -4112,9 +4104,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeLineEntry; break; - //---------------------------------------------------------------------- // Left and Right Braces - //---------------------------------------------------------------------- case N_LBRAC: // left bracket: 0,,NO_SECT,nesting level,address We use the // current number of symbols in the symbol table in lieu of using @@ -4146,9 +4136,7 @@ size_t ObjectFileMachO::ParseSymtab() { type = eSymbolTypeHeaderFile; break; - //---------------------------------------------------------------------- // COMM scopes - //---------------------------------------------------------------------- case N_BCOMM: // begin common: name,,NO_SECT,0,0 // We use the current number of symbols in the symbol table in lieu @@ -5966,9 +5954,7 @@ bool ObjectFileMachO::AllowAssemblyEmulationUnwindPlans() { return m_allow_assembly_emulation_unwind_plans; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString ObjectFileMachO::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h index 527acae3cc1..ca4f3025b4d 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h @@ -17,10 +17,8 @@ #include "lldb/Utility/RangeMap.h" #include "lldb/Utility/UUID.h" -//---------------------------------------------------------------------- // This class needs to be hidden as eventually belongs in a plugin that // will export the ObjectFile protocol -//---------------------------------------------------------------------- class ObjectFileMachO : public lldb_private::ObjectFile { public: ObjectFileMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, @@ -33,9 +31,7 @@ public: ~ObjectFileMachO() override = default; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -67,9 +63,7 @@ public: static bool MagicBytesMatch(lldb::DataBufferSP &data_sp, lldb::addr_t offset, lldb::addr_t length); - //------------------------------------------------------------------ // Member Functions - //------------------------------------------------------------------ bool ParseHeader() override; bool SetLoadAddress(lldb_private::Target &target, lldb::addr_t value, @@ -132,9 +126,7 @@ public: bool AllowAssemblyEmulationUnwindPlans() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 91ed1a59671..74bb2227ef5 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -303,12 +303,10 @@ uint32_t ObjectFilePECOFF::GetAddressByteSize() const { return 4; } -//---------------------------------------------------------------------- // NeedsEndianSwap // // Return true if an endian swap needs to occur when extracting data from this // file. -//---------------------------------------------------------------------- bool ObjectFilePECOFF::NeedsEndianSwap() const { #if defined(__LITTLE_ENDIAN__) return false; @@ -316,9 +314,7 @@ bool ObjectFilePECOFF::NeedsEndianSwap() const { return true; #endif } -//---------------------------------------------------------------------- // ParseDOSHeader -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data, dos_header_t &dos_header) { bool success = false; @@ -377,9 +373,7 @@ bool ObjectFilePECOFF::ParseDOSHeader(DataExtractor &data, return success; } -//---------------------------------------------------------------------- // ParserCOFFHeader -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseCOFFHeader(DataExtractor &data, lldb::offset_t *offset_ptr, coff_header_t &coff_header) { @@ -489,9 +483,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) { return data; } -//---------------------------------------------------------------------- // ParseSectionHeaders -//---------------------------------------------------------------------- bool ObjectFilePECOFF::ParseSectionHeaders( uint32_t section_header_data_offset) { const uint32_t nsects = m_coff_header.nsects; @@ -544,9 +536,7 @@ llvm::StringRef ObjectFilePECOFF::GetSectionName(const section_header_t §) { return hdr_name; } -//---------------------------------------------------------------------- // GetNListSymtab -//---------------------------------------------------------------------- Symtab *ObjectFilePECOFF::GetSymtab() { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -930,12 +920,10 @@ Address ObjectFilePECOFF::GetBaseAddress() { return Address(GetSectionList()->GetSectionAtIndex(0), 0); } -//---------------------------------------------------------------------- // Dump // // Dump the specifics of the runtime file container (such as any headers // segments, sections, etc). -//---------------------------------------------------------------------- void ObjectFilePECOFF::Dump(Stream *s) { ModuleSP module_sp(GetModule()); if (module_sp) { @@ -972,11 +960,9 @@ void ObjectFilePECOFF::Dump(Stream *s) { } } -//---------------------------------------------------------------------- // DumpDOSHeader // // Dump the MS-DOS header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) { s->PutCString("MSDOS Header\n"); s->Printf(" e_magic = 0x%4.4x\n", header.e_magic); @@ -1006,11 +992,9 @@ void ObjectFilePECOFF::DumpDOSHeader(Stream *s, const dos_header_t &header) { s->Printf(" e_lfanew = 0x%8.8x\n", header.e_lfanew); } -//---------------------------------------------------------------------- // DumpCOFFHeader // // Dump the COFF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) { s->PutCString("COFF Header\n"); s->Printf(" machine = 0x%4.4x\n", header.machine); @@ -1021,11 +1005,9 @@ void ObjectFilePECOFF::DumpCOFFHeader(Stream *s, const coff_header_t &header) { s->Printf(" hdrsize = 0x%4.4x\n", header.hdrsize); } -//---------------------------------------------------------------------- // DumpOptCOFFHeader // // Dump the optional COFF header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s, const coff_opt_header_t &header) { s->PutCString("Optional COFF Header\n"); @@ -1079,11 +1061,9 @@ void ObjectFilePECOFF::DumpOptCOFFHeader(Stream *s, header.data_dirs[i].vmaddr, header.data_dirs[i].vmsize); } } -//---------------------------------------------------------------------- // DumpSectionHeader // // Dump a single ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpSectionHeader(Stream *s, const section_header_t &sh) { std::string name = GetSectionName(sh); @@ -1093,11 +1073,9 @@ void ObjectFilePECOFF::DumpSectionHeader(Stream *s, sh.lineoff, sh.nreloc, sh.nline, sh.flags); } -//---------------------------------------------------------------------- // DumpSectionHeaders // // Dump all of the ELF section header to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) { s->PutCString("Section Headers\n"); @@ -1115,11 +1093,9 @@ void ObjectFilePECOFF::DumpSectionHeaders(Stream *s) { } } -//---------------------------------------------------------------------- // DumpDependentModules // // Dump all of the dependent modules to the specified output stream -//---------------------------------------------------------------------- void ObjectFilePECOFF::DumpDependentModules(lldb_private::Stream *s) { auto num_modules = ParseDependentModules(); if (num_modules > 0) { @@ -1179,9 +1155,7 @@ ObjectFile::Type ObjectFilePECOFF::CalculateType() { ObjectFile::Strata ObjectFilePECOFF::CalculateStrata() { return eStrataUser; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString ObjectFilePECOFF::GetPluginName() { return GetPluginNameStatic(); } uint32_t ObjectFilePECOFF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h index d6cc14e4f22..a9faf7394cc 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h @@ -52,9 +52,7 @@ public: ~ObjectFilePECOFF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -123,9 +121,7 @@ public: ObjectFile::Strata CalculateStrata() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp index be7e9849323..ddf33bf015c 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp @@ -139,9 +139,7 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() { return m_register_info_up.get(); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString OperatingSystemPython::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h index b5779090072..e76227ddb98 100644 --- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h +++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h @@ -27,9 +27,7 @@ public: ~OperatingSystemPython() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static lldb_private::OperatingSystem * CreateInstance(lldb_private::Process *process, bool force); @@ -41,16 +39,12 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // lldb_private::PluginInterface Methods - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // lldb_private::OperatingSystem Methods - //------------------------------------------------------------------ bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list, lldb_private::ThreadList &new_thread_list) override; @@ -64,9 +58,7 @@ public: lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override; - //------------------------------------------------------------------ // Method for lazy creation of threads on demand - //------------------------------------------------------------------ lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override; protected: diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h index 2d004419984..b710a7f46d0 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h @@ -29,9 +29,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -42,9 +40,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ConnectRemote(Args &args) override; diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp index 4df466a007e..7d8f43a697a 100644 --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp @@ -38,7 +38,6 @@ using namespace lldb_private::platform_freebsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformFreeBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -119,9 +118,7 @@ void PlatformFreeBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformFreeBSD::PlatformFreeBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h index 30c95dc380e..e3a3aa7145f 100644 --- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h +++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp index 87a7e518173..11e3adeeb58 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_linux; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -118,9 +117,7 @@ void PlatformLinux::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformLinux::PlatformLinux(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h index 56c9ed3db31..a843558f1df 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp index f8df85deb66..12a63f0aacb 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp @@ -28,26 +28,20 @@ using namespace lldb_private; #define UNSUPPORTED_ERROR ("Apple simulators aren't supported on this platform") #endif -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleSimulator::Initialize() { PlatformDarwin::Initialize(); } void PlatformAppleSimulator::Terminate() { PlatformDarwin::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleSimulator::PlatformAppleSimulator() : PlatformDarwin(true), m_core_sim_path_mutex(), m_core_simulator_framework_path(), m_device() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleSimulator::~PlatformAppleSimulator() {} lldb_private::Status PlatformAppleSimulator::LaunchProcess( diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h index 705d563bef3..ec5f157e6f6 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h @@ -19,16 +19,12 @@ class PlatformAppleSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static void Initialize(); static void Terminate(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleSimulator(); virtual ~PlatformAppleSimulator(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp index 81dc1edf79c..6fc9d384ee4 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp @@ -32,14 +32,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleTVSimulator::Initialize() { PlatformDarwin::Initialize(); @@ -147,18 +143,14 @@ const char *PlatformAppleTVSimulator::GetDescriptionStatic() { return "Apple TV simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleTVSimulator::PlatformAppleTVSimulator() : PlatformDarwin(true), m_sdk_dir_mutex(), m_sdk_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleTVSimulator::~PlatformAppleTVSimulator() {} void PlatformAppleTVSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h index 534bfef7e74..0005eab4e67 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h @@ -13,9 +13,7 @@ class PlatformAppleTVSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -27,25 +25,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleTVSimulator(); virtual ~PlatformAppleTVSimulator(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp index 51a88e6cb4d..7f271a07998 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp @@ -30,14 +30,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformAppleWatchSimulator::Initialize() { PlatformDarwin::Initialize(); @@ -147,18 +143,14 @@ const char *PlatformAppleWatchSimulator::GetDescriptionStatic() { return "Apple Watch simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformAppleWatchSimulator::PlatformAppleWatchSimulator() : PlatformDarwin(true), m_sdk_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformAppleWatchSimulator::~PlatformAppleWatchSimulator() {} void PlatformAppleWatchSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h index 463dc2cee64..d8ffa05343a 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h @@ -13,9 +13,7 @@ class PlatformAppleWatchSimulator : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -27,25 +25,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformAppleWatchSimulator(); virtual ~PlatformAppleWatchSimulator(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 692b4517830..8e07095afbb 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -46,19 +46,15 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformDarwin::PlatformDarwin(bool is_host) : PlatformPOSIX(is_host), // This is the local host platform m_developer_directory() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformDarwin::~PlatformDarwin() {} FileSpecList PlatformDarwin::LocateExecutableScriptingResources( diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h index 78259c0f8a5..ccf6853cda7 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h @@ -25,9 +25,7 @@ public: ~PlatformDarwin() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveSymbolFile(lldb_private::Target &target, const lldb_private::ModuleSpec &sym_spec, diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp index 8aa1d144a10..f67ddda786e 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp @@ -42,14 +42,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformDarwinKernel::Initialize() { PlatformDarwin::Initialize(); @@ -180,9 +176,7 @@ const char *PlatformDarwinKernel::GetDescriptionStatic() { return "Darwin Kernel platform plug-in."; } -//------------------------------------------------------------------ /// Code to handle the PlatformDarwinKernel settings -//------------------------------------------------------------------ static constexpr PropertyDefinition g_properties[] = { {"search-locally-for-kexts", OptionValue::eTypeBoolean, true, true, NULL, @@ -246,9 +240,7 @@ void PlatformDarwinKernel::DebuggerInitialize( } } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformDarwinKernel::PlatformDarwinKernel( lldb_private::LazyBool is_ios_debug_session) : PlatformDarwin(false), // This is a remote platform @@ -265,12 +257,10 @@ PlatformDarwinKernel::PlatformDarwinKernel( } } -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformDarwinKernel::~PlatformDarwinKernel() {} void PlatformDarwinKernel::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h index bf965c08e1c..31c13d2daa5 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h @@ -22,9 +22,7 @@ class PlatformDarwinKernel : public PlatformDarwin { public: - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -38,25 +36,19 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // Class Methods - //------------------------------------------------------------ PlatformDarwinKernel(lldb_private::LazyBool is_ios_debug_session); virtual ~PlatformDarwinKernel(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } void GetStatus(lldb_private::Stream &strm) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index 6eba38f9812..8edcb8e0470 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -146,17 +146,13 @@ const char *PlatformMacOSX::GetDescriptionStatic(bool is_host) { return "Remote Mac OS X user platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformMacOSX::PlatformMacOSX(bool is_host) : PlatformDarwin(is_host) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformMacOSX::~PlatformMacOSX() {} ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h index 2475fcd2d46..5e942f090c9 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.h @@ -17,9 +17,7 @@ public: ~PlatformMacOSX() override; - //------------------------------------------------------------ // Class functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -31,9 +29,7 @@ public: static const char *GetDescriptionStatic(bool is_host); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp index ff61ced2bbf..8b45a867d85 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.cpp @@ -27,20 +27,14 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleBridge::PlatformRemoteAppleBridge() : PlatformRemoteDarwinDevice () {} -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleBridge::Initialize() { PlatformDarwin::Initialize(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h index 339c3c8689b..3ecd20f2ade 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleBridge.h @@ -23,9 +23,7 @@ public: ~PlatformRemoteAppleBridge() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,18 +35,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } @@ -57,9 +51,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp index 586db67ee52..5b50acda2ee 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp @@ -28,20 +28,14 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleTV::PlatformRemoteAppleTV() : PlatformRemoteDarwinDevice () {} -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleTV::Initialize() { PlatformDarwin::Initialize(); diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h index c302f7865c4..ce2e164f6a9 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h @@ -23,9 +23,7 @@ public: ~PlatformRemoteAppleTV() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,18 +35,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } @@ -57,9 +51,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp index 7ab9a469b44..5dec3a06652 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp @@ -28,14 +28,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteAppleWatch::Initialize() { PlatformDarwin::Initialize(); @@ -149,9 +145,7 @@ const char *PlatformRemoteAppleWatch::GetDescriptionStatic() { return "Remote Apple Watch platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteAppleWatch::PlatformRemoteAppleWatch() : PlatformRemoteDarwinDevice() {} diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h index 2c3462a999b..6cd470da722 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h @@ -24,9 +24,7 @@ public: ~PlatformRemoteAppleWatch() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -38,33 +36,25 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ bool GetSupportedArchitectureAtIndex(uint32_t idx, lldb_private::ArchSpec &arch) override; protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp index 59bf4831fbf..b77a54958b8 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp @@ -34,9 +34,7 @@ PlatformRemoteDarwinDevice::SDKDirectoryInfo::SDKDirectoryInfo( build.SetString(build_str); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice() : PlatformDarwin(false), // This is a remote platform m_sdk_directory_infos(), m_device_support_directory(), @@ -44,12 +42,10 @@ PlatformRemoteDarwinDevice::PlatformRemoteDarwinDevice() m_last_module_sdk_idx(UINT32_MAX), m_connected_module_sdk_idx(UINT32_MAX) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformRemoteDarwinDevice::~PlatformRemoteDarwinDevice() {} void PlatformRemoteDarwinDevice::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h index b0a04592bf2..5e0b7d92bbd 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h @@ -22,9 +22,7 @@ public: ~PlatformRemoteDarwinDevice() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp index 9e4c2b61065..9e916d8db03 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp @@ -25,14 +25,10 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformRemoteiOS::Initialize() { PlatformDarwin::Initialize(); @@ -136,9 +132,7 @@ const char *PlatformRemoteiOS::GetDescriptionStatic() { return "Remote iOS platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteiOS::PlatformRemoteiOS() : PlatformRemoteDarwinDevice() {} diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h index 4a739f8802f..a0eb523fd1e 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h @@ -22,9 +22,7 @@ public: ~PlatformRemoteiOS() override = default; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -36,15 +34,11 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetDescriptionStatic(); } - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } @@ -56,9 +50,7 @@ public: protected: - //------------------------------------------------------------ // lldb_private::PlatformRemoteDarwinDevice functions - //------------------------------------------------------------ void GetDeviceSupportDirectoryNames (std::vector<std::string> &dirnames) override; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp index 6acaa5af657..e455edd38a0 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp @@ -33,14 +33,10 @@ namespace lldb_private { class Process; } -//------------------------------------------------------------------ // Static Variables -//------------------------------------------------------------------ static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ // Static Functions -//------------------------------------------------------------------ void PlatformiOSSimulator::Initialize() { PlatformAppleSimulator::Initialize(); @@ -151,19 +147,15 @@ const char *PlatformiOSSimulator::GetDescriptionStatic() { return "iOS simulator platform plug-in."; } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformiOSSimulator::PlatformiOSSimulator() : PlatformAppleSimulator(), m_sdk_dir_mutex(), m_sdk_directory(), m_build_update() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformiOSSimulator::~PlatformiOSSimulator() {} void PlatformiOSSimulator::GetStatus(Stream &strm) { diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h index 5e415fc50c7..d766929b2b8 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h @@ -20,9 +20,7 @@ public: ~PlatformiOSSimulator() override; - //------------------------------------------------------------ // Class Functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -34,18 +32,14 @@ public: static const char *GetDescriptionStatic(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ lldb_private::ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::Status ResolveExecutable( const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const lldb_private::FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp index 294eddb8668..f741f4a0516 100644 --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_netbsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -111,9 +110,7 @@ void PlatformNetBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformNetBSD::PlatformNetBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h index 8558f3c2310..0584d92d6c9 100644 --- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h +++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp index 54971294ffb..9dfb8844c57 100644 --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp @@ -36,7 +36,6 @@ using namespace lldb_private::platform_openbsd; static uint32_t g_initialize_count = 0; -//------------------------------------------------------------------ PlatformSP PlatformOpenBSD::CreateInstance(bool force, const ArchSpec *arch) { Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM)); @@ -117,9 +116,7 @@ void PlatformOpenBSD::Terminate() { PlatformPOSIX::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformOpenBSD::PlatformOpenBSD(bool is_host) : PlatformPOSIX(is_host) // This is the local host platform {} diff --git a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h index 5c4c7a2b8fe..3cb724f3032 100644 --- a/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h +++ b/lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.h @@ -24,9 +24,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const ArchSpec *arch); static ConstString GetPluginNameStatic(bool is_host); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ const char *GetDescription() override { return GetPluginDescriptionStatic(IsHost()); } diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp index b815e895134..4b5a985b6d5 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -36,21 +36,17 @@ using namespace lldb; using namespace lldb_private; -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformPOSIX::PlatformPOSIX(bool is_host) : RemoteAwarePlatform(is_host), // This is the local host platform m_option_group_platform_rsync(new OptionGroupPlatformRSync()), m_option_group_platform_ssh(new OptionGroupPlatformSSH()), m_option_group_platform_caching(new OptionGroupPlatformCaching()) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformPOSIX::~PlatformPOSIX() {} lldb_private::OptionGroupOptions *PlatformPOSIX::GetConnectionOptions( diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h index 11d5bf9eaaa..5858f99088e 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h @@ -21,9 +21,7 @@ public: ~PlatformPOSIX() override; - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ lldb_private::OptionGroupOptions * GetConnectionOptions(lldb_private::CommandInterpreter &interpreter) override; diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp index df48d153101..c18939faa8f 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -147,17 +147,13 @@ void PlatformWindows::Terminate() { Platform::Terminate(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformWindows::PlatformWindows(bool is_host) : RemoteAwarePlatform(is_host) {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformWindows::~PlatformWindows() = default; Status PlatformWindows::ResolveExecutable( diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.h b/lldb/source/Plugins/Platform/Windows/PlatformWindows.h index 3027b4fec9f..5740001f0e0 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.h +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.h @@ -23,9 +23,7 @@ public: static void Terminate(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ static lldb::PlatformSP CreateInstance(bool force, const lldb_private::ArchSpec *arch); @@ -37,9 +35,7 @@ public: uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ResolveExecutable(const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp, diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index c73e29ef9af..dea7ccf0422 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -195,19 +195,15 @@ Status PlatformRemoteGDBServer::GetFileWithUUID(const FileSpec &platform_file, return Status(); } -//------------------------------------------------------------------ /// Default Constructor -//------------------------------------------------------------------ PlatformRemoteGDBServer::PlatformRemoteGDBServer() : Platform(false), // This is a remote platform m_gdb_client() {} -//------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. -//------------------------------------------------------------------ PlatformRemoteGDBServer::~PlatformRemoteGDBServer() {} bool PlatformRemoteGDBServer::GetSupportedArchitectureAtIndex(uint32_t idx, diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h index d67cfc2f5da..94d61bbc322 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h @@ -35,16 +35,12 @@ public: virtual ~PlatformRemoteGDBServer(); - //------------------------------------------------------------ // lldb_private::PluginInterface functions - //------------------------------------------------------------ ConstString GetPluginName() override { return GetPluginNameStatic(); } uint32_t GetPluginVersion() override { return 1; } - //------------------------------------------------------------ // lldb_private::Platform functions - //------------------------------------------------------------ Status ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) override; diff --git a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp index 9bdc6f56199..3cdd2fa575e 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.cpp @@ -13,37 +13,27 @@ #include "CFBundle.h" #include "CFString.h" -//---------------------------------------------------------------------- // CFBundle constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const char *path) : CFReleaser<CFBundleRef>(), m_bundle_url() { if (path && path[0]) SetPath(path); } -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle::CFBundle(const CFBundle &rhs) : CFReleaser<CFBundleRef>(rhs), m_bundle_url(rhs.m_bundle_url) {} -//---------------------------------------------------------------------- // CFBundle copy constructor -//---------------------------------------------------------------------- CFBundle &CFBundle::operator=(const CFBundle &rhs) { *this = rhs; return *this; } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFBundle::~CFBundle() {} -//---------------------------------------------------------------------- // Set the path for a bundle by supplying a -//---------------------------------------------------------------------- bool CFBundle::SetPath(const char *path) { CFAllocatorRef alloc = kCFAllocatorDefault; // Release our old bundle and ULR diff --git a/lldb/source/Plugins/Process/Darwin/CFBundle.h b/lldb/source/Plugins/Process/Darwin/CFBundle.h index c56edee7a03..f49dc30f1f8 100644 --- a/lldb/source/Plugins/Process/Darwin/CFBundle.h +++ b/lldb/source/Plugins/Process/Darwin/CFBundle.h @@ -17,9 +17,7 @@ class CFBundle : public CFReleaser<CFBundleRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFBundle(const char *path = NULL); CFBundle(const CFBundle &rhs); CFBundle &operator=(const CFBundle &rhs); diff --git a/lldb/source/Plugins/Process/Darwin/CFString.cpp b/lldb/source/Plugins/Process/Darwin/CFString.cpp index 21b3a0427c6..4dcc05c8665 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.cpp +++ b/lldb/source/Plugins/Process/Darwin/CFString.cpp @@ -14,19 +14,13 @@ #include <glob.h> #include <string> -//---------------------------------------------------------------------- // CFString constructor -//---------------------------------------------------------------------- CFString::CFString(CFStringRef s) : CFReleaser<CFStringRef>(s) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString::CFString(const CFString &rhs) : CFReleaser<CFStringRef>(rhs) {} -//---------------------------------------------------------------------- // CFString copy constructor -//---------------------------------------------------------------------- CFString &CFString::operator=(const CFString &rhs) { if (this != &rhs) *this = rhs; @@ -41,9 +35,7 @@ CFString::CFString(const char *cstr, CFStringEncoding cstr_encoding) } } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CFString::~CFString() {} const char *CFString::GetFileSystemRepresentation(std::string &s) { diff --git a/lldb/source/Plugins/Process/Darwin/CFString.h b/lldb/source/Plugins/Process/Darwin/CFString.h index 47db507ce38..d1bd5682689 100644 --- a/lldb/source/Plugins/Process/Darwin/CFString.h +++ b/lldb/source/Plugins/Process/Darwin/CFString.h @@ -18,9 +18,7 @@ class CFString : public CFReleaser<CFStringRef> { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CFString(CFStringRef cf_str = NULL); CFString(const char *s, CFStringEncoding encoding = kCFStringEncodingUTF8); CFString(const CFString &rhs); diff --git a/lldb/source/Plugins/Process/Darwin/CFUtils.h b/lldb/source/Plugins/Process/Darwin/CFUtils.h index 9dae40670f3..b567524ce63 100644 --- a/lldb/source/Plugins/Process/Darwin/CFUtils.h +++ b/lldb/source/Plugins/Process/Darwin/CFUtils.h @@ -17,11 +17,9 @@ #ifdef __cplusplus -//---------------------------------------------------------------------- // Templatized CF helper class that can own any CF pointer and will // call CFRelease() on any valid pointer it owns unless that pointer is // explicitly released using the release() member function. -//---------------------------------------------------------------------- template <class T> class CFReleaser { public: // Type names for the avlue diff --git a/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp index c72def37407..3ec410fe7d7 100644 --- a/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp +++ b/lldb/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp @@ -148,17 +148,13 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], memset(fork_error, 0, sizeof(fork_error)); *pid = static_cast<::pid_t>(pty.Fork(fork_error, sizeof(fork_error))); if (*pid < 0) { - //-------------------------------------------------------------- // Status during fork. - //-------------------------------------------------------------- *pid = static_cast<::pid_t>(LLDB_INVALID_PROCESS_ID); error.SetErrorStringWithFormat("%s(): fork failed: %s", __FUNCTION__, fork_error); return error; } else if (pid == 0) { - //-------------------------------------------------------------- // Child process - //-------------------------------------------------------------- // Debug this process. ::ptrace(PT_TRACE_ME, 0, 0, 0); @@ -186,9 +182,7 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[], // call and if the exec fails it will exit the child process below. ::exit(127); } else { - //-------------------------------------------------------------- // Parent process - //-------------------------------------------------------------- // Let the child have its own process group. We need to execute this call // in both the child and parent to avoid a race condition between the two // processes. diff --git a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp index 17116e819b3..1d7851d2dbe 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp @@ -37,9 +37,7 @@ using namespace lldb_private; using namespace lldb_private::process_darwin; using namespace lldb_private::darwin_process_launcher; -// ----------------------------------------------------------------------------- // Hidden Impl -// ----------------------------------------------------------------------------- namespace { struct hack_task_dyld_info { @@ -48,9 +46,7 @@ struct hack_task_dyld_info { }; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- Status NativeProcessProtocol::Launch( ProcessLaunchInfo &launch_info, @@ -153,9 +149,7 @@ Status NativeProcessProtocol::Attach( return error; } -// ----------------------------------------------------------------------------- // ctor/dtor -// ----------------------------------------------------------------------------- NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) : NativeProcessProtocol(pid), m_task(TASK_NULL), m_did_exec(false), @@ -170,9 +164,7 @@ NativeProcessDarwin::NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd) NativeProcessDarwin::~NativeProcessDarwin() {} -// ----------------------------------------------------------------------------- // Instance methods -// ----------------------------------------------------------------------------- Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop) { @@ -1547,9 +1539,7 @@ Status NativeProcessDarwin::GetFileLoadAddress(const llvm::StringRef &file_name, return error; } -// ----------------------------------------------------------------- // NativeProcessProtocol protected interface -// ----------------------------------------------------------------- Status NativeProcessDarwin::GetSoftwareBreakpointTrapOpcode( size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) { diff --git a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h index 1b50a8c5cf8..6741d4ddc5d 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeProcessDarwin.h @@ -59,9 +59,7 @@ class NativeProcessDarwin : public NativeProcessProtocol { public: ~NativeProcessDarwin() override; - // ----------------------------------------------------------------- // NativeProcessProtocol Interface - // ----------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -112,9 +110,7 @@ public: task_t GetTask() const { return m_task; } - // ----------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // ----------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); @@ -122,18 +118,14 @@ public: bool SupportHardwareSingleStepping() const; protected: - // ----------------------------------------------------------------- // NativeProcessProtocol protected interface - // ----------------------------------------------------------------- Status GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) override; private: - // ----------------------------------------------------------------- /// Mach task-related Member Variables - // ----------------------------------------------------------------- // The task port for the inferior process. mutable task_t m_task; @@ -145,9 +137,7 @@ private: // The CPU type of this process. mutable cpu_type_t m_cpu_type; - // ----------------------------------------------------------------- /// Exception/Signal Handling Member Variables - // ----------------------------------------------------------------- // Exception port on which we will receive child exceptions mach_port_t m_exception_port; @@ -175,15 +165,11 @@ private: // interrupt signal (if this is non-zero). int m_auto_resume_signo; - // ----------------------------------------------------------------- /// Thread-related Member Variables - // ----------------------------------------------------------------- NativeThreadListDarwin m_thread_list; ResumeActionList m_thread_actions; - // ----------------------------------------------------------------- /// Process Lifetime Member Variable - // ----------------------------------------------------------------- // The pipe over which the waitpid thread and the main loop will // communicate. @@ -195,12 +181,9 @@ private: // waitpid reader callback handle. MainLoop::ReadHandleUP m_waitpid_reader_handle; - // ----------------------------------------------------------------- // Private Instance Methods - // ----------------------------------------------------------------- NativeProcessDarwin(lldb::pid_t pid, int pty_master_fd); - // ----------------------------------------------------------------- /// Finalize the launch. /// /// This method associates the NativeProcessDarwin instance with the host @@ -220,7 +203,6 @@ private: /// Any error that occurred during the aforementioned /// operations. Failure here will force termination of the /// launched process and debugging session. - // ----------------------------------------------------------------- Status FinalizeLaunch(LaunchFlavor launch_flavor, MainLoop &main_loop); Status SaveExceptionPortInfo(); diff --git a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h index 9f53643ff71..616a9a7b9bf 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadDarwin.h @@ -45,9 +45,7 @@ public: lldb::tid_t unique_thread_id = 0, ::thread_t mach_thread_port = 0); - // ----------------------------------------------------------------- // NativeThreadProtocol Interface - // ----------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -62,15 +60,11 @@ public: Status RemoveWatchpoint(lldb::addr_t addr) override; - // ----------------------------------------------------------------- // New methods that are fine for others to call. - // ----------------------------------------------------------------- void Dump(Stream &stream) const; private: - // ----------------------------------------------------------------- // Interface for friend classes - // ----------------------------------------------------------------- /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -118,20 +112,16 @@ private: Status RequestStop(); - // ------------------------------------------------------------------------- /// Return the mach thread port number for this thread. /// /// \return /// The mach port number for this thread. Returns NULL_THREAD /// when the thread is invalid. - // ------------------------------------------------------------------------- thread_t GetMachPortNumber() const { return m_mach_thread_port; } static bool MachPortNumberIsValid(::thread_t thread); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- bool GetIdentifierInfo(); void MaybeLogStateChange(lldb::StateType new_state); @@ -144,9 +134,7 @@ private: inline void MaybeCleanupSingleStepWorkaround(); - // ----------------------------------------------------------------- // Member Variables - // ----------------------------------------------------------------- // The mach thread port for the thread. ::thread_t m_mach_thread_port; diff --git a/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp index 499db58e2d8..89de92a6df4 100644 --- a/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp +++ b/lldb/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp @@ -548,7 +548,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { return (uint32_t)m_threads.size(); } -//---------------------------------------------------------------------- // Check each thread in our thread list to see if we should notify our client // of the current halt in execution. // @@ -558,7 +557,6 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) { // RETURNS // true if we should stop and notify our clients // false if we should resume our child process and skip notification -//---------------------------------------------------------------------- bool NativeThreadListDarwin::ShouldStop(bool &step_more) { std::lock_guard<std::recursive_mutex> locker(m_threads_mutex); for (auto thread_sp : m_threads) { diff --git a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h index 92faee7480c..6d3c253a519 100644 --- a/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h +++ b/lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.h @@ -19,14 +19,11 @@ class ProcessMessage; class ProcessMonitor; class POSIXBreakpointProtocol; -//------------------------------------------------------------------------------ // @class FreeBSDThread // Abstraction of a FreeBSD thread. class FreeBSDThread : public lldb_private::Thread { public: - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ FreeBSDThread(lldb_private::Process &process, lldb::tid_t tid); virtual ~FreeBSDThread(); @@ -50,7 +47,6 @@ public: lldb::addr_t GetThreadPointer() override; - //-------------------------------------------------------------------------- // These functions provide a mapping from the register offset // back to the register index or name for use in debugging or log // output. @@ -61,14 +57,12 @@ public: const char *GetRegisterNameFromOffset(unsigned offset); - //-------------------------------------------------------------------------- // These methods form a specialized interface to POSIX threads. // bool Resume(); void Notify(const ProcessMessage &message); - //-------------------------------------------------------------------------- // These methods provide an interface to watchpoints // bool EnableHardwareWatchpoint(lldb_private::Watchpoint *wp); @@ -110,7 +104,6 @@ protected: lldb_private::Unwind *GetUnwinder() override; - //-------------------------------------------------------------------------- // FreeBSDThread internal API. // POSIXThread override diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp index d985a52ce44..efd8cade504 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp @@ -64,7 +64,6 @@ UnixSignalsSP &GetFreeBSDSignals() { } } -//------------------------------------------------------------------------------ // Static functions. lldb::ProcessSP @@ -96,7 +95,6 @@ const char *ProcessFreeBSD::GetPluginDescriptionStatic() { return "Process plugin for FreeBSD"; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessFreeBSD::GetPluginName() { @@ -250,7 +248,6 @@ void ProcessFreeBSD::SendMessage(const ProcessMessage &message) { m_message_queue.push(message); } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, @@ -269,7 +266,6 @@ ProcessFreeBSD::ProcessFreeBSD(lldb::TargetSP target_sp, ProcessFreeBSD::~ProcessFreeBSD() { delete m_monitor; } -//------------------------------------------------------------------------------ // Process protocol. void ProcessFreeBSD::Finalize() { Process::Finalize(); @@ -835,7 +831,6 @@ size_t ProcessFreeBSD::PutSTDIN(const char *buf, size_t len, Status &error) { return status; } -//------------------------------------------------------------------------------ // Utility functions. bool ProcessFreeBSD::HasExited() { diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h index e8a0cd9a9df..293f7b854b4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h @@ -23,9 +23,7 @@ class FreeBSDThread; class ProcessFreeBSD : public lldb_private::Process { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -38,9 +36,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessFreeBSD(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, lldb::UnixSignalsSP &unix_signals_sp); @@ -48,17 +44,13 @@ public: virtual lldb_private::Status WillResume() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ virtual lldb_private::ConstString GetPluginName() override; virtual uint32_t GetPluginVersion() override; public: - //------------------------------------------------------------------ // Process protocol. - //------------------------------------------------------------------ void Finalize() override; bool CanDebug(lldb::TargetSP target_sp, @@ -137,7 +129,6 @@ public: const lldb::DataBufferSP GetAuxvData() override; - //-------------------------------------------------------------------------- // ProcessFreeBSD internal API. /// Registers the given message with this process. diff --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp index 959e5f0dfd8..09a898ca7d4 100644 --- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp @@ -140,7 +140,6 @@ extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data) { PtraceWrapper((req), (pid), (addr), (data)) #endif -//------------------------------------------------------------------------------ // Static implementations of ProcessMonitor::ReadMemory and // ProcessMonitor::WriteMemory. This enables mutual recursion between these // functions without needed to go thru the thread funnel. @@ -195,7 +194,6 @@ static bool EnsureFDFlags(int fd, int flags, Status &error) { return true; } -//------------------------------------------------------------------------------ /// \class Operation /// Represents a ProcessMonitor operation. /// @@ -213,7 +211,6 @@ public: virtual void Execute(ProcessMonitor *monitor) = 0; }; -//------------------------------------------------------------------------------ /// \class ReadOperation /// Implements ProcessMonitor::ReadMemory. class ReadOperation : public Operation { @@ -239,7 +236,6 @@ void ReadOperation::Execute(ProcessMonitor *monitor) { m_result = DoReadMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class WriteOperation /// Implements ProcessMonitor::WriteMemory. class WriteOperation : public Operation { @@ -265,7 +261,6 @@ void WriteOperation::Execute(ProcessMonitor *monitor) { m_result = DoWriteMemory(pid, m_addr, m_buff, m_size, m_error); } -//------------------------------------------------------------------------------ /// \class ReadRegOperation /// Implements ProcessMonitor::ReadRegisterValue. class ReadRegOperation : public Operation { @@ -305,7 +300,6 @@ void ReadRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteRegOperation /// Implements ProcessMonitor::WriteRegisterValue. class WriteRegOperation : public Operation { @@ -338,7 +332,6 @@ void WriteRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadDebugRegOperation /// Implements ProcessMonitor::ReadDebugRegisterValue. class ReadDebugRegOperation : public Operation { @@ -373,7 +366,6 @@ void ReadDebugRegOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class WriteDebugRegOperation /// Implements ProcessMonitor::WriteDebugRegisterValue. class WriteDebugRegOperation : public Operation { @@ -406,7 +398,6 @@ void WriteDebugRegOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadGPROperation /// Implements ProcessMonitor::ReadGPR. class ReadGPROperation : public Operation { @@ -433,7 +424,6 @@ void ReadGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ReadFPROperation /// Implements ProcessMonitor::ReadFPR. class ReadFPROperation : public Operation { @@ -456,7 +446,6 @@ void ReadFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteGPROperation /// Implements ProcessMonitor::WriteGPR. class WriteGPROperation : public Operation { @@ -479,7 +468,6 @@ void WriteGPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class WriteFPROperation /// Implements ProcessMonitor::WriteFPR. class WriteFPROperation : public Operation { @@ -502,7 +490,6 @@ void WriteFPROperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class ResumeOperation /// Implements ProcessMonitor::Resume. class ResumeOperation : public Operation { @@ -533,7 +520,6 @@ void ResumeOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class SingleStepOperation /// Implements ProcessMonitor::SingleStep. class SingleStepOperation : public Operation { @@ -561,7 +547,6 @@ void SingleStepOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class LwpInfoOperation /// Implements ProcessMonitor::GetLwpInfo. class LwpInfoOperation : public Operation { @@ -590,7 +575,6 @@ void LwpInfoOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class ThreadSuspendOperation /// Implements ProcessMonitor::ThreadSuspend. class ThreadSuspendOperation : public Operation { @@ -610,7 +594,6 @@ void ThreadSuspendOperation::Execute(ProcessMonitor *monitor) { m_result = !PTRACE(m_suspend ? PT_SUSPEND : PT_RESUME, m_tid, NULL, 0); } -//------------------------------------------------------------------------------ /// \class EventMessageOperation /// Implements ProcessMonitor::GetEventMessage. class EventMessageOperation : public Operation { @@ -640,7 +623,6 @@ void EventMessageOperation::Execute(ProcessMonitor *monitor) { } } -//------------------------------------------------------------------------------ /// \class KillOperation /// Implements ProcessMonitor::Kill. class KillOperation : public Operation { @@ -662,7 +644,6 @@ void KillOperation::Execute(ProcessMonitor *monitor) { m_result = true; } -//------------------------------------------------------------------------------ /// \class DetachOperation /// Implements ProcessMonitor::Detach. class DetachOperation : public Operation { @@ -708,7 +689,6 @@ ProcessMonitor::AttachArgs::AttachArgs(ProcessMonitor *monitor, lldb::pid_t pid) ProcessMonitor::AttachArgs::~AttachArgs() {} -//------------------------------------------------------------------------------ /// The basic design of the ProcessMonitor is built around two threads. /// /// One thread (@see SignalThread) simply blocks on a call to waitpid() @@ -805,7 +785,6 @@ ProcessMonitor::ProcessMonitor(ProcessFreeBSD *process, lldb::pid_t pid, ProcessMonitor::~ProcessMonitor() { StopMonitor(); } -//------------------------------------------------------------------------------ // Thread setup and tear down. void ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Status &error) { static const char *g_thread_name = "lldb.process.freebsd.operation"; diff --git a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h index c9bfe0948e9..cf52a065232 100644 --- a/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h +++ b/lldb/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h @@ -13,7 +13,6 @@ #include "lldb/Target/RegisterContext.h" #include "lldb/Utility/ArchSpec.h" -//------------------------------------------------------------------------------ /// \class POSIXBreakpointProtocol /// /// Extends RegisterClass with a few virtual operations useful on POSIX. diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index bab2a71de3d..d85ec214218 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -206,9 +206,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -284,9 +282,7 @@ NativeProcessLinux::Factory::Attach( pid, -1, native_delegate, Info.GetArchitecture(), mainloop, *tids_or)); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h index 044f16754ff..006ae000168 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -49,9 +49,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -120,9 +118,7 @@ public: Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) override; - // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // --------------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); @@ -146,9 +142,7 @@ private: // the relevan breakpoint std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessLinux(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop, llvm::ArrayRef<::pid_t> tids); diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h index b7d77403ba5..d64bcdc82df 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h index 57af505db94..005843eebd7 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -40,9 +40,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware breakpoints/watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 590e8075a44..3ca9b436baf 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -87,9 +87,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR_linux_mips) + \ sizeof(MSA_linux_mips)) -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_mips64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h index ff3a740b99a..37f9f5f63f9 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h @@ -47,9 +47,7 @@ public: Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; - //------------------------------------------------------------------ // Hardware watchpoint management functions - //------------------------------------------------------------------ uint32_t NumSupportedHardwareWatchpoints() override; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp index f5565893c10..5d135574722 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp @@ -25,9 +25,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // s390x 64-bit general purpose registers. @@ -89,9 +87,7 @@ static const RegisterSet g_reg_sets_s390x[k_num_register_sets] = { #define REG_CONTEXT_SIZE (sizeof(s390_regs) + sizeof(s390_fp_regs) + 4) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ @@ -103,9 +99,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_s390x members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp index b7d5b6b6c1b..ad2d4329f85 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -24,9 +24,7 @@ using namespace lldb_private; using namespace lldb_private::process_linux; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 32-bit general purpose registers. @@ -207,9 +205,7 @@ static const RegisterSet g_reg_sets_x86_64[k_num_register_sets] = { #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize() + sizeof(FPR)) -// ---------------------------------------------------------------------------- // Required ptrace defines. -// ---------------------------------------------------------------------------- // Support ptrace extensions even when compiled without required kernel support #ifndef NT_X86_XSTATE @@ -225,18 +221,14 @@ static inline unsigned int fxsr_regset(const ArchSpec &arch) { return arch.GetAddressByteSize() == 8 ? NT_PRFPREG : NT_PRXFPREG; } -// ---------------------------------------------------------------------------- // Required MPX define. -// ---------------------------------------------------------------------------- // Support MPX extensions also if compiled with compiler without MPX support. #ifndef bit_MPX #define bit_MPX 0x4000 #endif -// ---------------------------------------------------------------------------- // XCR0 extended register sets masks. -// ---------------------------------------------------------------------------- #define mask_XSTATE_AVX (1ULL << 2) #define mask_XSTATE_BNDREGS (1ULL << 3) #define mask_XSTATE_BNDCFG (1ULL << 4) @@ -249,9 +241,7 @@ NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux( new NativeRegisterContextLinux_x86_64(target_arch, native_thread)); } -// ---------------------------------------------------------------------------- // NativeRegisterContextLinux_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h index e92908baeb5..fd43c89489f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h @@ -30,9 +30,7 @@ class NativeThreadLinux : public NativeThreadProtocol { public: NativeThreadLinux(NativeProcessLinux &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -54,9 +52,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- /// Resumes the thread. If \p signo is anything but /// LLDB_INVALID_SIGNAL_NUMBER, deliver that signal to the thread. @@ -91,18 +87,14 @@ private: Status RequestStop(); - // --------------------------------------------------------------------- // Private interface - // --------------------------------------------------------------------- void MaybeLogStateChange(lldb::StateType new_state); NativeProcessLinux &GetProcess(); void SetStopped(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContextLinux> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h index d105555705c..de9bd8c78e1 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessorTrace.h +++ b/lldb/source/Plugins/Process/Linux/ProcessorTrace.h @@ -23,7 +23,6 @@ namespace lldb_private { namespace process_linux { -// --------------------------------------------------------------------- // This class keeps track of one tracing instance of // Intel(R) Processor Trace on Linux OS. There is a map keeping track // of different tracing instances on each thread, which enables trace @@ -36,7 +35,6 @@ namespace process_linux { // The trace id could map to trace instances for a group of threads // (spanning to all the threads in the process) or a single thread. // The kernel interface for us is the perf_event_open. -// --------------------------------------------------------------------- class ProcessorTraceMonitor; typedef std::unique_ptr<ProcessorTraceMonitor> ProcessorTraceMonitorUP; @@ -115,7 +113,6 @@ public: Status GetTraceConfig(TraceOptions &config) const; - // --------------------------------------------------------------------- /// Read data from a cyclic buffer /// /// \param[in] [out] buf @@ -130,7 +127,6 @@ public: /// /// \param[in] offset /// The offset to begin reading the data in the cyclic buffer. - // --------------------------------------------------------------------- static void ReadCyclicBuffer(llvm::MutableArrayRef<uint8_t> &dst, llvm::MutableArrayRef<uint8_t> src, size_t src_cyc_index, size_t offset); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index 5da835d3525..ded0983fac7 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // CommunicationKDP constructor -//---------------------------------------------------------------------- CommunicationKDP::CommunicationKDP(const char *comm_name) : Communication(comm_name), m_addr_byte_size(4), m_byte_order(eByteOrderLittle), m_packet_timeout(5), m_sequence_mutex(), @@ -39,9 +37,7 @@ CommunicationKDP::CommunicationKDP(const char *comm_name) m_kdp_version_feature(0u), m_kdp_hostinfo_cpu_mask(0u), m_kdp_hostinfo_cpu_type(0u), m_kdp_hostinfo_cpu_subtype(0u) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- CommunicationKDP::~CommunicationKDP() { if (IsConnected()) { Disconnect(); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h index b5aa146ac39..fed6128c17f 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h @@ -76,9 +76,7 @@ public: ePacketTypeMask = 0x80u, eCommandTypeMask = 0x7fu } PacketType; - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ CommunicationKDP(const char *comm_name); virtual ~CommunicationKDP(); @@ -96,14 +94,12 @@ public: lldb_private::DataExtractor &packet); bool IsRunning() const { return m_is_running.GetValue(); } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this might not // get used, and if it doesn't this should be moved to the // CommunicationKDPClient. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -112,9 +108,7 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Public Request Packets - //------------------------------------------------------------------ bool SendRequestConnect(uint16_t reply_port, uint16_t exc_port, const char *greeting); @@ -188,10 +182,8 @@ protected: PacketStreamType &request_packet, uint16_t request_length); - //------------------------------------------------------------------ // Protected Request Packets (use public accessors which will cache // results. - //------------------------------------------------------------------ bool SendRequestVersion(); bool SendRequestHostInfo(); @@ -228,9 +220,7 @@ protected: bool SendRequestAndGetReply(const CommandType command, const PacketStreamType &request_packet, lldb_private::DataExtractor &reply_packet); - //------------------------------------------------------------------ // Classes that inherit from CommunicationKDP can see and modify these - //------------------------------------------------------------------ uint32_t m_addr_byte_size; lldb::ByteOrder m_byte_order; std::chrono::seconds m_packet_timeout; @@ -250,9 +240,7 @@ protected: // hang the KDP connection... lldb::addr_t m_last_read_memory_addr; // Last memory read address for logging private: - //------------------------------------------------------------------ // For CommunicationKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(CommunicationKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 605194d0726..c9e024fc498 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -143,9 +143,7 @@ bool ProcessKDP::CanDebug(TargetSP target_sp, bool plugin_specified_by_name) { return false; } -//---------------------------------------------------------------------- // ProcessKDP constructor -//---------------------------------------------------------------------- ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), m_comm("lldb.process.kdp-remote.communication"), @@ -162,9 +160,7 @@ ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp) m_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessKDP::~ProcessKDP() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -174,9 +170,7 @@ ProcessKDP::~ProcessKDP() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- lldb_private::ConstString ProcessKDP::GetPluginName() { return GetPluginNameStatic(); } @@ -369,9 +363,7 @@ Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessKDP::DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) { Status error; @@ -595,17 +587,13 @@ Status ProcessKDP::DoDestroy() { return DoDetach(keep_stopped); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessKDP::IsAlive() { return m_comm.IsConnected() && Process::IsAlive(); } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessKDP::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { uint8_t *data_buffer = (uint8_t *)buf; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h index 31de54c4665..a7f8466f984 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -30,9 +30,7 @@ class ThreadKDP; class ProcessKDP : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -47,23 +45,17 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessKDP(lldb::TargetSP target_sp, lldb::ListenerSP listener); ~ProcessKDP() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; lldb_private::CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status WillLaunch(lldb_private::Module *module) override; lldb_private::Status @@ -93,16 +85,12 @@ public: lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status WillResume() override; lldb_private::Status DoResume() override; @@ -117,14 +105,10 @@ public: void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -136,18 +120,14 @@ public: lldb_private::Status DoDeallocateMemory(lldb::addr_t ptr) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- lldb_private::Status EnableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; lldb_private::Status DisableBreakpointSite(lldb_private::BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- lldb_private::Status EnableWatchpoint(lldb_private::Watchpoint *wp, bool notify = true) override; @@ -160,9 +140,7 @@ protected: friend class ThreadKDP; friend class CommunicationKDP; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -191,9 +169,7 @@ protected: lldb::ThreadSP GetKernelThread(); - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ CommunicationKDP m_comm; lldb_private::Broadcaster m_async_broadcaster; lldb_private::HostThread m_async_thread; @@ -209,9 +185,7 @@ protected: static void *AsyncThread(void *arg); private: - //------------------------------------------------------------------ // For ProcessKDP only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ProcessKDP); }; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp index 341c6329ad6..77361ef705f 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp @@ -34,9 +34,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadKDP::ThreadKDP(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h index e7330f223ff..9971ea765a3 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h @@ -60,16 +60,12 @@ public: protected: friend class ProcessKDP; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::StopInfoSP m_cached_stop_info_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ virtual bool CalculateStopInfo(); }; diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index e9eceb0124f..5179f83c07e 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -54,9 +54,7 @@ static Status EnsureFDFlags(int fd, int flags) { return error; } -// ----------------------------------------------------------------------------- // Public Static Methods -// ----------------------------------------------------------------------------- llvm::Expected<std::unique_ptr<NativeProcessProtocol>> NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info, @@ -136,9 +134,7 @@ NativeProcessNetBSD::Factory::Attach( return std::move(process_up); } -// ----------------------------------------------------------------------------- // Public Instance Methods -// ----------------------------------------------------------------------------- NativeProcessNetBSD::NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h index 2e7b62d2ae2..e85ca3b7a92 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h @@ -38,9 +38,7 @@ public: MainLoop &mainloop) const override; }; - // --------------------------------------------------------------------- // NativeProcessProtocol Interface - // --------------------------------------------------------------------- Status Resume(const ResumeActionList &resume_actions) override; Status Halt() override; @@ -83,9 +81,7 @@ public: llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> GetAuxvData() const override; - // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. - // --------------------------------------------------------------------- static Status PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, int data = 0, int *result = nullptr); @@ -95,9 +91,7 @@ private: LazyBool m_supports_mem_region = eLazyBoolCalculate; std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; - // --------------------------------------------------------------------- // Private Instance Methods - // --------------------------------------------------------------------- NativeProcessNetBSD(::pid_t pid, int terminal_fd, NativeDelegate &delegate, const ArchSpec &arch, MainLoop &mainloop); diff --git a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp index 8c8e265aa4d..2c9eaaab010 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp @@ -31,9 +31,7 @@ using namespace lldb_private; using namespace lldb_private::process_netbsd; -// ---------------------------------------------------------------------------- // Private namespace. -// ---------------------------------------------------------------------------- namespace { // x86 64-bit general purpose registers. @@ -152,9 +150,7 @@ NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD( return new NativeRegisterContextNetBSD_x86_64(target_arch, native_thread); } -// ---------------------------------------------------------------------------- // NativeRegisterContextNetBSD_x86_64 members. -// ---------------------------------------------------------------------------- static RegisterInfoInterface * CreateRegisterInfoInterface(const ArchSpec &target_arch) { diff --git a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h index 01d169d661a..015d8995db3 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h +++ b/lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h @@ -26,9 +26,7 @@ class NativeThreadNetBSD : public NativeThreadProtocol { public: NativeThreadNetBSD(NativeProcessNetBSD &process, lldb::tid_t tid); - // --------------------------------------------------------------------- // NativeThreadProtocol Interface - // --------------------------------------------------------------------- std::string GetName() override; lldb::StateType GetState() override; @@ -48,9 +46,7 @@ public: Status RemoveHardwareBreakpoint(lldb::addr_t addr) override; private: - // --------------------------------------------------------------------- // Interface for friend classes - // --------------------------------------------------------------------- void SetStoppedBySignal(uint32_t signo, const siginfo_t *info = nullptr); void SetStoppedByBreakpoint(); @@ -61,9 +57,7 @@ private: void SetRunning(); void SetStepping(); - // --------------------------------------------------------------------- // Member Variables - // --------------------------------------------------------------------- lldb::StateType m_state; ThreadStopInfo m_stop_info; std::unique_ptr<NativeRegisterContext> m_reg_context_up; diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h index 116224a1af6..aacf547e187 100644 --- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h +++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h @@ -64,9 +64,7 @@ public: void Clear(); protected: - //------------------------------------------------------------------ // Classes that inherit from DynamicRegisterInfo can see and modify these - //------------------------------------------------------------------ typedef std::vector<lldb_private::RegisterInfo> reg_collection; typedef std::vector<lldb_private::RegisterSet> set_collection; typedef std::vector<uint32_t> reg_num_collection; diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.h b/lldb/source/Plugins/Process/Utility/HistoryThread.h index cbbb3fc3eef..2345d85da0e 100644 --- a/lldb/source/Plugins/Process/Utility/HistoryThread.h +++ b/lldb/source/Plugins/Process/Utility/HistoryThread.h @@ -22,7 +22,6 @@ namespace lldb_private { -//---------------------------------------------------------------------- /// \class HistoryThread HistoryThread.h "HistoryThread.h" /// A thread object representing a backtrace from a previous point in the /// process execution @@ -31,7 +30,6 @@ namespace lldb_private { /// process execution. It is given a backtrace list of pc addresses and /// optionally a stop_id of when those pc addresses were collected, and it /// will create stack frames for them. -//---------------------------------------------------------------------- class HistoryThread : public lldb_private::Thread { public: diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp index 10609ce88fa..ea950cee75a 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp @@ -960,11 +960,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -984,9 +982,7 @@ const RegisterSet *RegisterContextDarwin_arm::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_arm::GetSetForNativeRegNum(int reg) { if (reg < fpu_s0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp index 0f9e1e6b758..c264831c0dd 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp @@ -67,9 +67,7 @@ using namespace lldb_private; sizeof(RegisterContextDarwin_arm64::FPU) + \ sizeof(RegisterContextDarwin_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT @@ -140,11 +138,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -164,9 +160,7 @@ const RegisterSet *RegisterContextDarwin_arm64::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for arm64 -//---------------------------------------------------------------------- int RegisterContextDarwin_arm64::GetSetForNativeRegNum(int reg) { if (reg < fpu_v0) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp index 161af9f8c32..130a2673fde 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp @@ -460,11 +460,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, @@ -484,9 +482,7 @@ const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) { return NULL; } -//---------------------------------------------------------------------- // Register information definitions for 32 bit i386. -//---------------------------------------------------------------------- int RegisterContextDarwin_i386::GetSetForNativeRegNum(int reg_num) { if (reg_num < fpu_fcw) return GPRRegSet; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp index c611f6239b8..4a37454ba8c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp @@ -521,11 +521,9 @@ const size_t k_num_gpr_registers = llvm::array_lengthof(g_gpr_regnums); const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums); const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums); -//---------------------------------------------------------------------- // Register set definitions. The first definitions at register set index of // zero is for all registers, followed by other registers sets. The register // information for the all register set need not be filled in. -//---------------------------------------------------------------------- static const RegisterSet g_reg_sets[] = { { "General Purpose Registers", "gpr", k_num_gpr_registers, g_gpr_regnums, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h index 70d842389df..bdaa2217d20 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp index 41896615bb0..1c3f33d287c 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp @@ -53,9 +53,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp index 7c186ad3ca3..4331ef5ad14 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp @@ -79,10 +79,8 @@ typedef struct _GPR { uint64_t dummy; } GPR_freebsd_mips; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #include "RegisterInfos_mips64.h" #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp index d1b9e59b0c1..a0c314653af 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp @@ -168,10 +168,8 @@ typedef struct _VMX { uint32_t vscr; } VMX; -//--------------------------------------------------------------------------- // Include RegisterInfos_powerpc to declare our g_register_infos_powerpc // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_POWERPC_STRUCT #include "RegisterInfos_powerpc.h" #undef DECLARE_REGISTER_INFOS_POWERPC_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp index eedfdbbedfb..bcf3951ee07 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp @@ -61,10 +61,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -88,10 +86,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h index 8c29f1fe634..952e4263d95 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.h @@ -51,9 +51,7 @@ public: uint32_t num) override; private: - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ lldb_private::RegisterSet m_reg_set0; // register set 0 (PC only) lldb_private::RegisterInfo m_pc_reg_info; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h index 06100161c73..64dd394d233 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.h @@ -110,7 +110,6 @@ private: // user somehow. bool IsSkipFrame() const; - //------------------------------------------------------------------ /// Determines if a SymbolContext is a trap handler or not /// /// Given a SymbolContext, determines if this is a trap handler function @@ -118,7 +117,6 @@ private: /// /// \return /// Returns true if the SymbolContext is a trap handler. - //------------------------------------------------------------------ bool IsTrapHandlerSymbol(lldb_private::Process *process, const lldb_private::SymbolContext &m_sym_ctx) const; @@ -154,7 +152,6 @@ private: const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value); - //------------------------------------------------------------------ /// If the unwind has to the caller frame has failed, try something else /// /// If lldb is using an assembly language based UnwindPlan for a frame and @@ -165,10 +162,8 @@ private: /// /// \return /// Returns true if a fallback unwindplan was found & was installed. - //------------------------------------------------------------------ bool TryFallbackUnwindPlan(); - //------------------------------------------------------------------ /// Switch to the fallback unwind plan unconditionally without any safety /// checks that it is providing better results than the normal unwind plan. /// @@ -176,7 +171,6 @@ private: /// found to be fundamentally incorrect/impossible. /// /// Returns true if it was able to install the fallback unwind plan. - //------------------------------------------------------------------ bool ForceSwitchToFallbackUnwindPlan(); // Get the contents of a general purpose (address-size) register for this @@ -249,9 +243,7 @@ private: lldb_private::UnwindLLDB &m_parent_unwind; // The UnwindLLDB that is creating // this RegisterContextLLDB - //------------------------------------------------------------------ // For RegisterContextLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(RegisterContextLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp index 5b9f69a0671..1210a7e3857 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp @@ -81,9 +81,7 @@ struct UserArea { #define DR_OFFSET(reg_index) (DR_0_OFFSET + (reg_index * 4)) #define FPR_SIZE(reg) sizeof(((FPR_i386 *)NULL)->reg) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp index c2e3d959a88..4797afbc0ee 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp @@ -21,9 +21,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp index 9eab9cf59a2..3927883c47a 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp @@ -22,19 +22,15 @@ using namespace lldb; using namespace lldb_private; -//--------------------------------------------------------------------------- // Include RegisterInfos_mips64 to declare our g_register_infos_mips64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS64_STRUCT #define LINUX_MIPS64 #include "RegisterInfos_mips64.h" #undef LINUX_MIPS64 #undef DECLARE_REGISTER_INFOS_MIPS64_STRUCT -//--------------------------------------------------------------------------- // Include RegisterInfos_mips to declare our g_register_infos_mips structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_MIPS_STRUCT #include "RegisterInfos_mips.h" #undef DECLARE_REGISTER_INFOS_MIPS_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp index 672567acf3a..d6401d788ab 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp @@ -12,9 +12,7 @@ using namespace lldb_private; using namespace lldb; -//--------------------------------------------------------------------------- // Include RegisterInfos_s390x to declare our g_register_infos_s390x structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_S390X_STRUCT #include "RegisterInfos_s390x.h" #undef DECLARE_REGISTER_INFOS_S390X_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp index 5a6e766d999..6f78f84e93f 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp @@ -75,10 +75,8 @@ struct UserArea { (LLVM_EXTENSION offsetof(UserArea, dbg) + \ LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT @@ -102,10 +100,8 @@ GetRegisterInfo_i386(const lldb_private::ArchSpec &arch) { g_register_infos.insert(g_register_infos.end(), &base_info[0], &base_info[k_num_registers_i386]); -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to update the g_register_infos structure // with x86_64 offsets. -//--------------------------------------------------------------------------- #define UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS #include "RegisterInfos_x86_64.h" #undef UPDATE_REGISTER_INFOS_I386_STRUCT_WITH_X86_64_OFFSETS diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp index e60a03a09ee..bc78c1d6160 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp @@ -19,18 +19,14 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMacOSXFrameBackchain constructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::RegisterContextMacOSXFrameBackchain( Thread &thread, uint32_t concrete_frame_idx, const UnwindMacOSXFrameBackchain::Cursor &cursor) : RegisterContext(thread, concrete_frame_idx), m_cursor(cursor), m_cursor_is_valid(true) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMacOSXFrameBackchain::~RegisterContextMacOSXFrameBackchain() {} void RegisterContextMacOSXFrameBackchain::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp index 533bcb420ad..946d4fa9f8e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp @@ -18,9 +18,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // RegisterContextMemory constructor -//---------------------------------------------------------------------- RegisterContextMemory::RegisterContextMemory(Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo ®_infos, @@ -40,9 +38,7 @@ RegisterContextMemory::RegisterContextMemory(Thread &thread, m_reg_data.SetData(reg_data_sp); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- RegisterContextMemory::~RegisterContextMemory() {} void RegisterContextMemory::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h index 072e8b3eac4..68223eaeffd 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextMemory.h @@ -39,13 +39,11 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // If all of the thread register are in a contiguous buffer in // memory, then the default ReadRegister/WriteRegister and // ReadAllRegisterValues/WriteAllRegisterValues will work. If thread // registers are not contiguous, clients will want to subclass this // class and modify the read/write functions as needed. - //------------------------------------------------------------------ bool ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value) override; diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp index d0dc0becfed..e620ff66c92 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp @@ -77,10 +77,8 @@ struct UserArea { LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp index 6d2bc1a2f9b..c1f141cf2d6 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp @@ -50,9 +50,7 @@ struct UserArea { #define DR_SIZE sizeof(uint32_t) #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(dbreg, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_i386 to declare our g_register_infos_i386 structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_I386_STRUCT #include "RegisterInfos_i386.h" #undef DECLARE_REGISTER_INFOS_I386_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp index a2e82cca1f5..e210196d921 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_x86_64.cpp @@ -58,10 +58,8 @@ struct UserArea { #define DR_OFFSET(reg_index) (LLVM_EXTENSION offsetof(DBG, dr[reg_index])) -//--------------------------------------------------------------------------- // Include RegisterInfos_x86_64 to declare our g_register_infos_x86_64 // structure. -//--------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_X86_64_STRUCT #include "RegisterInfos_x86_64.h" #undef DECLARE_REGISTER_INFOS_X86_64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h index dbb3e6fa628..1a21a717b22 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h @@ -16,9 +16,7 @@ class ProcessMonitor; -// --------------------------------------------------------------------------- // Internal codes for all powerpc registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_powerpc, gpr_r0_powerpc = k_first_gpr_powerpc, diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h index 1642d52021c..932f97bb567 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h @@ -50,9 +50,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //--------------------------------------------------------------------------- // Note: prefer kernel definitions over user-land - //--------------------------------------------------------------------------- enum FPRType { eNotValid = 0, eFSAVE, // TODO diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp index 9cc90f0bce5..c21c02f2497 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp @@ -54,9 +54,7 @@ void RegisterContextThreadMemory::UpdateRegisterContext() { } } -//------------------------------------------------------------------ // Subclasses must override these functions -//------------------------------------------------------------------ void RegisterContextThreadMemory::InvalidateAllRegisters() { UpdateRegisterContext(); if (m_reg_ctx_sp) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h index 87e7b7d5e38..2cf39e9eb8e 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_s390x.h @@ -9,9 +9,7 @@ #ifndef liblldb_RegisterContext_s390x_h_ #define liblldb_RegisterContext_s390x_h_ -//--------------------------------------------------------------------------- // SystemZ ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) diff --git a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h index ad004c8c824..c3b1caba73d 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h +++ b/lldb/source/Plugins/Process/Utility/RegisterContext_x86.h @@ -16,9 +16,7 @@ #include "llvm/Support/Compiler.h" namespace lldb_private { -//--------------------------------------------------------------------------- // i386 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // Register numbers seen in eh_frame (eRegisterKindEHFrame) on i386 systems // (non-Darwin) @@ -131,9 +129,7 @@ enum { dwarf_bnd3_i386, }; -//--------------------------------------------------------------------------- // AMD x86_64, AMD64, Intel EM64T, or Intel 64 ehframe, dwarf regnums -//--------------------------------------------------------------------------- // EHFrame and DWARF Register numbers (eRegisterKindEHFrame & // eRegisterKindDWARF) @@ -241,9 +237,7 @@ enum { // dwarf_k7_x86_64, }; -//--------------------------------------------------------------------------- // Generic floating-point registers -//--------------------------------------------------------------------------- struct MMSReg { uint8_t bytes[10]; @@ -282,9 +276,7 @@ struct FXSAVE { uint8_t padding2[40]; }; -//--------------------------------------------------------------------------- // Extended floating-point registers -//--------------------------------------------------------------------------- struct YMMHReg { uint8_t bytes[16]; // 16 * 8 bits for the high bytes of each YMM register diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h index 3d8787515bf..4b58e749adc 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoInterface.h @@ -15,11 +15,9 @@ namespace lldb_private { -///------------------------------------------------------------------------------ /// \class RegisterInfoInterface /// /// RegisterInfo interface to patch RegisterInfo structure for archs. -///------------------------------------------------------------------------------ class RegisterInfoInterface { public: RegisterInfoInterface(const lldb_private::ArchSpec &target_arch) diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp index 1355c65442e..118c9ffe654 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp @@ -43,9 +43,7 @@ using namespace lldb_private; (sizeof(RegisterInfoPOSIX_arm::GPR) + sizeof(RegisterInfoPOSIX_arm::FPU) + \ sizeof(RegisterInfoPOSIX_arm::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm to declare our g_register_infos_arm structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM_STRUCT #include "RegisterInfos_arm.h" #undef DECLARE_REGISTER_INFOS_ARM_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp index e422bef4d46..14d11190264 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp @@ -48,9 +48,7 @@ sizeof(RegisterInfoPOSIX_arm64::FPU) + \ sizeof(RegisterInfoPOSIX_arm64::EXC)) -//----------------------------------------------------------------------------- // Include RegisterInfos_arm64 to declare our g_register_infos_arm64 structure. -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_ARM64_STRUCT #include "RegisterInfos_arm64.h" #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp index a0da646a3d1..63d35c291e9 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp @@ -15,9 +15,7 @@ #include "RegisterInfoPOSIX_ppc64le.h" -//----------------------------------------------------------------------------- // Include RegisterInfoPOSIX_ppc64le to declare our g_register_infos_ppc64le -//----------------------------------------------------------------------------- #define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT #include "RegisterInfos_ppc64le.h" #undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h index 7fa2e0feb49..74c05812ab0 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.h +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.h @@ -17,9 +17,7 @@ namespace lldb_private { class StopInfoMachException : public StopInfo { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ StopInfoMachException(Thread &thread, uint32_t exc_type, uint32_t exc_data_count, uint64_t exc_code, uint64_t exc_subcode) diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h index 808ef947b66..c512929c185 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.h +++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.h @@ -93,7 +93,6 @@ protected: uint32_t lldb_regnum, lldb_private::UnwindLLDB::RegisterLocation ®loc, uint32_t starting_frame_num, bool pc_register); - //------------------------------------------------------------------ /// Provide the list of user-specified trap handler functions /// /// The Platform is one source of trap handler function names; that @@ -104,7 +103,6 @@ protected: /// \return /// Vector of ConstStrings of trap handler function names. May be /// empty. - //------------------------------------------------------------------ const std::vector<ConstString> &GetUserSpecifiedTrapHandlerFunctionNames() { return m_user_supplied_trap_handler_functions; } @@ -138,12 +136,10 @@ private: std::vector<ConstString> m_user_supplied_trap_handler_functions; - //----------------------------------------------------------------- // Check if Full UnwindPlan of First frame is valid or not. // If not then try Fallback UnwindPlan of the frame. If Fallback // UnwindPlan succeeds then update the Full UnwindPlan with the // Fallback UnwindPlan. - //----------------------------------------------------------------- void UpdateUnwindPlanForFirstFrameIfInvalid(ABI *abi); CursorSP GetOneMoreFrame(ABI *abi); @@ -152,9 +148,7 @@ private: bool AddFirstFrame(); - //------------------------------------------------------------------ // For UnwindLLDB only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindLLDB); }; diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h index 573b6beb224..2208bcc2f2e 100644 --- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h +++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h @@ -46,9 +46,7 @@ private: size_t GetStackFrameData_x86_64(const lldb_private::ExecutionContext &exe_ctx); - //------------------------------------------------------------------ // For UnwindMacOSXFrameBackchain only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(UnwindMacOSXFrameBackchain); }; diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h index 969449d838e..39cbf01ea9d 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm = 0, gpr_r0_arm = k_first_gpr_arm, diff --git a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h index ea60db790d4..cc414dcde3c 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-arm64-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all ARM64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_arm64, gpr_x0_arm64 = k_first_gpr_arm64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h index 42bc4b54a52..d97f7712242 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h index 92a1e6e1ef2..2f68b8022c9 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h @@ -13,9 +13,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all mips registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips, gpr_zero_mips = k_first_gpr_mips, @@ -148,9 +146,7 @@ enum { k_num_msa_registers_mips }; -//--------------------------------------------------------------------------- // Internal codes for all mips64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_mips64, gpr_zero_mips64 = k_first_gpr_mips64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h index fb7eb267fea..6edf7ee3864 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64 registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64, gpr_r0_ppc64 = k_first_gpr_ppc64, diff --git a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h index 11b22f48796..0c381a5f391 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-ppc64le-register-enums.h @@ -11,9 +11,7 @@ // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -// --------------------------------------------------------------------------- // Internal codes for all ppc64le registers. -// --------------------------------------------------------------------------- enum { k_first_gpr_ppc64le, gpr_r0_ppc64le = k_first_gpr_ppc64le, diff --git a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h index 97baf81a59b..bd662610829 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-s390x-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all s390x registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_s390x, lldb_r0_s390x = k_first_gpr_s390x, diff --git a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h index 760aa275895..0d2149c8357 100644 --- a/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h +++ b/lldb/source/Plugins/Process/Utility/lldb-x86-register-enums.h @@ -12,9 +12,7 @@ namespace lldb_private { // LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB) -//--------------------------------------------------------------------------- // Internal codes for all i386 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_i386, lldb_eax_i386 = k_first_gpr_i386, @@ -135,9 +133,7 @@ enum { k_num_mpx_registers_i386, }; -//--------------------------------------------------------------------------- // Internal codes for all x86_64 registers. -//--------------------------------------------------------------------------- enum { k_first_gpr_x86_64, lldb_rax_x86_64 = k_first_gpr_x86_64, diff --git a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h index 04da09317cb..56701307fd7 100644 --- a/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h +++ b/lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h @@ -20,12 +20,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // DebuggerThread // // Debugs a single process, notifying listeners as appropriate when interesting // things occur. -//---------------------------------------------------------------------- class DebuggerThread : public std::enable_shared_from_this<DebuggerThread> { public: DebuggerThread(DebugDelegateSP debug_delegate); diff --git a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h index bc03b9784bf..dcff8d34712 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h +++ b/lldb/source/Plugins/Process/Windows/Common/ExceptionRecord.h @@ -18,12 +18,10 @@ namespace lldb_private { -//---------------------------------------------------------------------- // ExceptionRecord // // ExceptionRecord defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class ExceptionRecord { public: ExceptionRecord(const EXCEPTION_RECORD &record, lldb::tid_t thread_id) { diff --git a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h index 59f5cd92f5e..aff2dd610ee 100644 --- a/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/IDebugDelegate.h @@ -18,12 +18,10 @@ namespace lldb_private { class Status; class HostThread; -//---------------------------------------------------------------------- // IDebugDelegate // // IDebugDelegate defines an interface which allows implementors to receive // notification of events that happen in a debugged process. -//---------------------------------------------------------------------- class IDebugDelegate { public: virtual ~IDebugDelegate() {} diff --git a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h index 305ba9e0ad7..7494dbbb0cf 100644 --- a/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h +++ b/lldb/source/Plugins/Process/Windows/Common/LocalDebugDelegate.h @@ -20,7 +20,6 @@ namespace lldb_private { class ProcessWindows; typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; -//---------------------------------------------------------------------- // LocalDebugDelegate // // LocalDebugDelegate creates a connection between a ProcessWindows and the @@ -39,7 +38,6 @@ typedef std::shared_ptr<ProcessWindows> ProcessWindowsSP; // a ProcessSP (which is exactly what we are trying to decouple from the // driver), so this adapter serves as a way to transparently hold the // ProcessSP while still keeping it decoupled from the driver. -//---------------------------------------------------------------------- class LocalDebugDelegate : public IDebugDelegate { public: explicit LocalDebugDelegate(lldb::ProcessWP process); diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index e9146b558ef..e891f6c2367 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -136,7 +136,6 @@ const char *ProcessWindows::GetPluginDescriptionStatic() { return "Process plugin for Windows"; } -//------------------------------------------------------------------------------ // Constructors and destructors. ProcessWindows::ProcessWindows(lldb::TargetSP target_sp, @@ -161,7 +160,6 @@ size_t ProcessWindows::PutSTDIN(const char *buf, size_t buf_size, return 0; } -//------------------------------------------------------------------------------ // ProcessInterface protocol. lldb_private::ConstString ProcessWindows::GetPluginName() { diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h index 3ef6d56dd2e..1b1f173a364 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h @@ -25,9 +25,7 @@ class ProcessWindowsData; class ProcessWindows : public Process, public IDebugDelegate { public: - //------------------------------------------------------------------ // Static functions. - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *); @@ -40,9 +38,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and destructors - //------------------------------------------------------------------ ProcessWindows(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp); ~ProcessWindows(); diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp index 8ca1b5c2821..d46d3382917 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp @@ -23,9 +23,7 @@ using namespace lldb_private; const DWORD kWinContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER; -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows::RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx) : RegisterContext(thread, concrete_frame_idx), m_context(), @@ -78,9 +76,7 @@ uint32_t RegisterContextWindows::ConvertRegisterKindToRegisterNumber( return LLDB_INVALID_REGNUM; } -//------------------------------------------------------------------ // Subclasses can these functions if desired -//------------------------------------------------------------------ uint32_t RegisterContextWindows::NumSupportedHardwareBreakpoints() { // Support for hardware breakpoints not yet implemented. return 0; diff --git a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h index e269af95ed8..916f9f3a156 100644 --- a/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h +++ b/lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows : public lldb_private::RegisterContext { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ void InvalidateAllRegisters() override; bool ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; @@ -37,9 +33,7 @@ public: uint32_t ConvertRegisterKindToRegisterNumber(lldb::RegisterKind kind, uint32_t num) override; - //------------------------------------------------------------------ // Subclasses can override these functions if desired - //------------------------------------------------------------------ uint32_t NumSupportedHardwareBreakpoints() override; uint32_t SetHardwareBreakpoint(lldb::addr_t addr, size_t size) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp index 6c92d098e73..9b0e1d4de8f 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp @@ -172,9 +172,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x64::RegisterContextWindows_x64( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h index 68793bffa0f..5f252e16293 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h +++ b/lldb/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x64 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x64(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x64(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp index b2c64a9199e..0c25853e1c1 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp @@ -142,9 +142,7 @@ RegisterSet g_register_sets[] = { }; } -//------------------------------------------------------------------ // Constructors and Destructors -//------------------------------------------------------------------ RegisterContextWindows_x86::RegisterContextWindows_x86( Thread &thread, uint32_t concrete_frame_idx) : RegisterContextWindows(thread, concrete_frame_idx) {} diff --git a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h index 7823ff98b8c..8dca1dc995b 100644 --- a/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h +++ b/lldb/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h @@ -18,16 +18,12 @@ class Thread; class RegisterContextWindows_x86 : public RegisterContextWindows { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ RegisterContextWindows_x86(Thread &thread, uint32_t concrete_frame_idx); virtual ~RegisterContextWindows_x86(); - //------------------------------------------------------------------ // Subclasses must override these functions - //------------------------------------------------------------------ size_t GetRegisterCount() override; const RegisterInfo *GetRegisterInfoAtIndex(size_t reg) override; diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp index 21c9be552cf..25074f85492 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp @@ -90,17 +90,13 @@ bool ProcessElfCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessElfCore constructor -//---------------------------------------------------------------------- ProcessElfCore::ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec &core_file) : Process(target_sp, listener_sp), m_core_file(core_file) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessElfCore::~ProcessElfCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -110,9 +106,7 @@ ProcessElfCore::~ProcessElfCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessElfCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessElfCore::GetPluginVersion() { return 1; } @@ -146,9 +140,7 @@ lldb::addr_t ProcessElfCore::AddAddressRangeFromLoadSegment( return addr; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessElfCore::DoLoadCore() { Status error; if (!m_core_module_sp) { @@ -279,15 +271,11 @@ void ProcessElfCore::RefreshStateAfterStop() {} Status ProcessElfCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessElfCore::IsAlive() { return true; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessElfCore::ReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h index 328474eb475..6828f5a42ff 100644 --- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.h @@ -30,9 +30,7 @@ struct ThreadData; class ProcessElfCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec *crash_file_path); @@ -45,37 +43,27 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const lldb_private::FileSpec &core_file); ~ProcessElfCore() override; - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; @@ -88,16 +76,12 @@ public: return error; } - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override { return false; } - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -131,9 +115,7 @@ private: lldb_private::ConstString path; }; - //------------------------------------------------------------------ // For ProcessElfCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp index 948f52ca008..a5d1fc4a7bf 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp @@ -43,9 +43,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Construct a Thread object with given data -//---------------------------------------------------------------------- ThreadElfCore::ThreadElfCore(Process &process, const ThreadData &td) : Thread(process, td.tid), m_thread_name(td.name), m_thread_reg_ctx_sp(), m_signo(td.signo), m_gpregset_data(td.gpregset), m_notes(td.notes) {} @@ -248,9 +246,7 @@ bool ThreadElfCore::CalculateStopInfo() { return false; } -//---------------------------------------------------------------- // Parse PRSTATUS from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrStatus::ELFLinuxPrStatus() { memset(this, 0, sizeof(ELFLinuxPrStatus)); } @@ -324,9 +320,7 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse PRPSINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxPrPsInfo::ELFLinuxPrPsInfo() { memset(this, 0, sizeof(ELFLinuxPrPsInfo)); } @@ -402,9 +396,7 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data, return error; } -//---------------------------------------------------------------- // Parse SIGINFO from NOTE entry -//---------------------------------------------------------------- ELFLinuxSigInfo::ELFLinuxSigInfo() { memset(this, 0, sizeof(ELFLinuxSigInfo)); } size_t ELFLinuxSigInfo::GetSize(const lldb_private::ArchSpec &arch) { diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h index f0cc4daba20..13291d56a0c 100644 --- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h +++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h @@ -161,9 +161,7 @@ public: } protected: - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; lldb::RegisterContextSP m_thread_reg_ctx_sp; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 228b79768fc..c5a449783bd 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -53,9 +53,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunication constructor -//---------------------------------------------------------------------- GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, const char *listener_name) : Communication(comm_name), @@ -69,9 +67,7 @@ GDBRemoteCommunication::GDBRemoteCommunication(const char *comm_name, m_listen_url() { } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunication::~GDBRemoteCommunication() { if (IsConnected()) { Disconnect(); @@ -300,7 +296,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, case eConnectionStatusTimedOut: case eConnectionStatusInterrupted: if (sync_on_timeout) { - //------------------------------------------------------------------ /// Sync the remote GDB server and make sure we get a response that /// corresponds to what we send. /// @@ -323,7 +318,6 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet, /// packets. So if we timeout, we need to ensure that we can get /// back on track. If we can't get back on track, we must /// disconnect. - //------------------------------------------------------------------ bool sync_success = false; bool got_actual_response = false; // We timed out, we need to sync back up with the diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index 4ef22240614..e3dc9d2d1d7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -109,13 +109,11 @@ public: bool GetSendAcks() { return m_send_acks; } - //------------------------------------------------------------------ // Set the global packet timeout. // // For clients, this is the timeout that gets used when sending // packets and waiting for responses. For servers, this is used when waiting // for ACKs. - //------------------------------------------------------------------ std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout) { const auto old_packet_timeout = m_packet_timeout; m_packet_timeout = packet_timeout; @@ -124,10 +122,8 @@ public: std::chrono::seconds GetPacketTimeout() const { return m_packet_timeout; } - //------------------------------------------------------------------ // Start a debugserver instance on the current host using the // supplied connection URL. - //------------------------------------------------------------------ Status StartDebugserverProcess( const char *url, Platform *platform, // If non nullptr, then check with the platform for diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 60d33cc74e3..5e310aac98a 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -48,9 +48,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace std::chrono; -//---------------------------------------------------------------------- // GDBRemoteCommunicationClient constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() : GDBRemoteClientBase("gdb-remote.client", "gdb-remote.client.rx_packet"), m_supports_not_sending_acks(eLazyBoolCalculate), @@ -105,9 +103,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient() m_supported_async_json_packets_sp(), m_qXfer_memory_map(), m_qXfer_memory_map_loaded(false) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient() { if (IsConnected()) Disconnect(); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index 6cbb44dad99..0210aac3c47 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -33,10 +33,8 @@ public: ~GDBRemoteCommunicationClient() override; - //------------------------------------------------------------------ // After connecting, send the handshake to the server to make sure // we are communicating with it. - //------------------------------------------------------------------ bool HandshakeWithServer(Status *error_ptr); // For packets which specify a range of output to be returned, @@ -84,7 +82,6 @@ public: bool KillSpawnedProcess(lldb::pid_t pid); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'A' packet that delivers program /// arguments to the remote server. /// @@ -97,10 +94,8 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendArgumentsPacket(const ProcessLaunchInfo &launch_info); - //------------------------------------------------------------------ /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the /// environment that will get used when launching an application /// in conjunction with the 'A' packet. This function can be called @@ -116,7 +111,6 @@ public: /// the response was "Exx" where xx are two hex digits, or /// -1 if the call is unsupported or any other unexpected /// response was received. - //------------------------------------------------------------------ int SendEnvironmentPacket(char const *name_equal_value); int SendEnvironment(const Environment &env); @@ -125,7 +119,6 @@ public: int SendLaunchEventDataPacket(const char *data, bool *was_supported = nullptr); - //------------------------------------------------------------------ /// Sends a "vAttach:PID" where PID is in hex. /// /// \param[in] pid @@ -139,10 +132,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendAttach(lldb::pid_t pid, StringExtractorGDBRemote &response); - //------------------------------------------------------------------ /// Sends a GDB remote protocol 'I' packet that delivers stdin /// data to the remote process. /// @@ -155,10 +146,8 @@ public: /// \return /// Zero if the attach was successful, or an error indicating /// an error code. - //------------------------------------------------------------------ int SendStdinNotification(const char *data, size_t data_len); - //------------------------------------------------------------------ /// Sets the path to use for stdin/out/err for a process /// that will be launched with the 'A' packet. /// @@ -167,12 +156,10 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetSTDIN(const FileSpec &file_spec); int SetSTDOUT(const FileSpec &file_spec); int SetSTDERR(const FileSpec &file_spec); - //------------------------------------------------------------------ /// Sets the disable ASLR flag to \a enable for a process that will /// be launched with the 'A' packet. /// @@ -181,10 +168,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDisableASLR(bool enable); - //------------------------------------------------------------------ /// Sets the DetachOnError flag to \a enable for the process controlled by the /// stub. /// @@ -193,10 +178,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetDetachOnError(bool enable); - //------------------------------------------------------------------ /// Sets the working directory to \a path for a process that will /// be launched with the 'A' packet for non platform based /// connections. If this packet is sent to a GDB server that @@ -208,10 +191,8 @@ public: /// /// \return /// Zero if the for success, or an error code for failure. - //------------------------------------------------------------------ int SetWorkingDir(const FileSpec &working_dir); - //------------------------------------------------------------------ /// Gets the current working directory of a remote platform GDB /// server. /// @@ -220,7 +201,6 @@ public: /// /// \return /// Boolean for success - //------------------------------------------------------------------ bool GetWorkingDir(FileSpec &working_dir); lldb::addr_t AllocateMemory(size_t size, uint32_t permissions); @@ -455,7 +435,6 @@ public: // Sends QPassSignals packet to the server with given signals to ignore. Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals); - //------------------------------------------------------------------ /// Return the feature set supported by the gdb-remote server. /// /// This method returns the remote side's response to the qSupported @@ -464,12 +443,10 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ const std::string &GetServerSupportedFeatures() const { return m_qSupported_response; } - //------------------------------------------------------------------ /// Return the array of async JSON packet types supported by the remote. /// /// This method returns the remote side's array of supported JSON @@ -487,14 +464,11 @@ public: /// /// \return /// The string returned by the server to the qSupported query. - //------------------------------------------------------------------ lldb_private::StructuredData::Array *GetSupportedStructuredDataPlugins(); - //------------------------------------------------------------------ /// Configure a StructuredData feature on the remote end. /// /// \see \b Process::ConfigureStructuredData(...) for details. - //------------------------------------------------------------------ Status ConfigureRemoteStructuredData(ConstString type_name, const StructuredData::ObjectSP &config_sp); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 5bc0c25c587..3e8fb9f4749 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -55,9 +55,7 @@ const static uint32_t g_default_packet_timeout_sec = 20; // seconds const static uint32_t g_default_packet_timeout_sec = 0; // not specified #endif -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerCommon constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( const char *comm_name, const char *listener_name) : GDBRemoteCommunicationServer(comm_name, listener_name), @@ -176,9 +174,7 @@ GDBRemoteCommunicationServerCommon::GDBRemoteCommunicationServerCommon( &GDBRemoteCommunicationServerCommon::Handle_vFile_unlink); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerCommon::~GDBRemoteCommunicationServerCommon() {} GDBRemoteCommunication::PacketResult diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h index d0615869d03..bc322118063 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h @@ -131,7 +131,6 @@ protected: }); } - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -141,7 +140,6 @@ protected: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ virtual Status LaunchProcess() = 0; virtual FileSpec FindModuleFile(const std::string &module_path, diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index c4b5c69f761..045f4b43b40 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -51,9 +51,7 @@ using namespace lldb_private; using namespace lldb_private::process_gdb_remote; using namespace llvm; -//---------------------------------------------------------------------- // GDBRemote Errors -//---------------------------------------------------------------------- namespace { enum GDBRemoteServerError { @@ -65,9 +63,7 @@ enum GDBRemoteServerError { }; } -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerLLGS constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerLLGS::GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory) : GDBRemoteCommunicationServerCommon("gdb-remote.server", diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index 786910ed93f..1609174b1d3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -31,16 +31,13 @@ class GDBRemoteCommunicationServerLLGS : public GDBRemoteCommunicationServerCommon, public NativeProcessProtocol::NativeDelegate { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ GDBRemoteCommunicationServerLLGS( MainLoop &mainloop, const NativeProcessProtocol::Factory &process_factory); void SetLaunchInfo(const ProcessLaunchInfo &info); - //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar @@ -50,10 +47,8 @@ public: /// \return /// An Status object indicating the success or failure of the /// launch. - //------------------------------------------------------------------ Status LaunchProcess() override; - //------------------------------------------------------------------ /// Attach to a process. /// /// This method supports attaching llgs to a process accessible via the @@ -62,12 +57,9 @@ public: /// \return /// An Status object indicating the success or failure of the /// attach operation. - //------------------------------------------------------------------ Status AttachToProcess(lldb::pid_t pid); - //------------------------------------------------------------------ // NativeProcessProtocol::NativeDelegate overrides - //------------------------------------------------------------------ void InitializeDelegate(NativeProcessProtocol *process) override; void ProcessStateChanged(NativeProcessProtocol *process, @@ -222,9 +214,7 @@ private: void StopSTDIOForwarding(); - //------------------------------------------------------------------ // For GDBRemoteCommunicationServerLLGS only - //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerLLGS); }; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index e19eb23ced5..32e4452483e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -40,9 +40,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteCommunicationServerPlatform constructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( const Socket::SocketProtocol socket_protocol, const char *socket_scheme) : GDBRemoteCommunicationServerCommon("gdb-remote.server", @@ -86,9 +84,7 @@ GDBRemoteCommunicationServerPlatform::GDBRemoteCommunicationServerPlatform( }); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteCommunicationServerPlatform::~GDBRemoteCommunicationServerPlatform() {} Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer( diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h index f0ee77dc1d6..eacc99a012d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -35,7 +35,6 @@ public: // a port chosen by the OS. void SetPortMap(PortMap &&port_map); - //---------------------------------------------------------------------- // If we are using a port map where we can only use certain ports, // get the next available port. // @@ -43,7 +42,6 @@ public: // // If we aren't using a port map, return 0 to indicate we should bind to // port 0 and then figure out which port we used. - //---------------------------------------------------------------------- uint16_t GetNextAvailablePort(); bool AssociatePortWithProcess(uint16_t port, lldb::pid_t pid); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index a51c693cbe8..56ee0a1463c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // GDBRemoteRegisterContext constructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::GDBRemoteRegisterContext( ThreadGDBRemote &thread, uint32_t concrete_frame_idx, GDBRemoteDynamicRegisterInfo ®_info, bool read_all_at_once) @@ -48,9 +46,7 @@ GDBRemoteRegisterContext::GDBRemoteRegisterContext( m_reg_data.SetByteOrder(thread.GetProcess()->GetByteOrder()); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- GDBRemoteRegisterContext::~GDBRemoteRegisterContext() {} void GDBRemoteRegisterContext::InvalidateAllRegisters() { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index a5efbc01813..15975f6825d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -288,9 +288,7 @@ bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp, return true; } -//---------------------------------------------------------------------- // ProcessGDBRemote constructor -//---------------------------------------------------------------------- ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, ListenerSP listener_sp) : Process(target_sp, listener_sp), @@ -353,9 +351,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp, m_gdb_comm.SetPacketTimeout(std::chrono::seconds(timeout_seconds)); } -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessGDBRemote::~ProcessGDBRemote() { // m_mach_process.UnregisterNotificationCallbacks (this); Clear(); @@ -373,9 +369,7 @@ ProcessGDBRemote::~ProcessGDBRemote() { KillDebugserverProcess(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessGDBRemote::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessGDBRemote::GetPluginVersion() { return 1; } @@ -809,9 +803,7 @@ Status ProcessGDBRemote::WillLaunchOrAttach() { return error; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module, ProcessLaunchInfo &launch_info) { Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS)); @@ -2724,9 +2716,7 @@ void ProcessGDBRemote::SetUnixSignals(const UnixSignalsSP &signals_sp) { Process::SetUnixSignals(std::make_shared<GDBRemoteSignals>(signals_sp)); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessGDBRemote::IsAlive() { return m_gdb_comm.IsConnected() && Process::IsAlive(); @@ -2770,9 +2760,7 @@ void ProcessGDBRemote::WillPublicStop() { } } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size, Status &error) { GetMaxMemorySize(); @@ -3133,9 +3121,7 @@ Status ProcessGDBRemote::DoDeallocateMemory(lldb::addr_t addr) { return error; } -//------------------------------------------------------------------ // Process STDIO -//------------------------------------------------------------------ size_t ProcessGDBRemote::PutSTDIN(const char *src, size_t src_len, Status &error) { if (m_stdio_communication.IsConnected()) { diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index efa7d28f178..a82b0950a6e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -67,17 +67,13 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; CommandObject *GetPluginCommandObject() override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ Status WillLaunch(Module *module) override; Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) override; @@ -102,16 +98,12 @@ public: void DidAttach(ArchSpec &process_arch) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ Status WillResume() override; Status DoResume() override; @@ -130,18 +122,14 @@ public: void SetUnixSignals(const lldb::UnixSignalsSP &signals_sp); - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; lldb::addr_t GetImageInfoAddress() override; void WillPublicStop() override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) override; @@ -159,21 +147,15 @@ public: Status DoDeallocateMemory(lldb::addr_t ptr) override; - //------------------------------------------------------------------ // Process STDIO - //------------------------------------------------------------------ size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) override; - //---------------------------------------------------------------------- // Process Breakpoints - //---------------------------------------------------------------------- Status EnableBreakpointSite(BreakpointSite *bp_site) override; Status DisableBreakpointSite(BreakpointSite *bp_site) override; - //---------------------------------------------------------------------- // Process Watchpoints - //---------------------------------------------------------------------- Status EnableWatchpoint(Watchpoint *wp, bool notify = true) override; Status DisableWatchpoint(Watchpoint *wp, bool notify = true) override; @@ -205,9 +187,7 @@ public: Status SendEventData(const char *data) override; - //---------------------------------------------------------------------- // Override DidExit so we can disconnect from the remote GDB server - //---------------------------------------------------------------------- void DidExit() override; void SetUserSpecifiedMaxMemoryTransferSize(uint64_t user_specified_max); @@ -255,9 +235,7 @@ protected: friend class GDBRemoteCommunicationClient; friend class GDBRemoteRegisterContext; - //------------------------------------------------------------------ /// Broadcaster event bits definitions. - //------------------------------------------------------------------ enum { eBroadcastBitAsyncContinue = (1 << 0), eBroadcastBitAsyncThreadShouldExit = (1 << 1), @@ -312,9 +290,7 @@ protected: using FlashRange = FlashRangeVector::Entry; FlashRangeVector m_erased_flash_ranges; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- bool IsRunning(lldb::StateType state) { return state == lldb::eStateRunning || IsStepping(state); } @@ -427,9 +403,7 @@ protected: bool HasErased(FlashRange range); private: - //------------------------------------------------------------------ // For ProcessGDBRemote only - //------------------------------------------------------------------ std::string m_partial_profile_data; std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; uint64_t m_last_signals_version = 0; @@ -439,9 +413,7 @@ private: lldb::user_id_t break_id, lldb::user_id_t break_loc_id); - //------------------------------------------------------------------ // ContinueDelegate interface - //------------------------------------------------------------------ void HandleAsyncStdout(llvm::StringRef out) override; void HandleAsyncMisc(llvm::StringRef data) override; void HandleStopReply() override; diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 9f9fcca71bc..6607bce4488 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -31,9 +31,7 @@ using namespace lldb; using namespace lldb_private; using namespace lldb_private::process_gdb_remote; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadGDBRemote::ThreadGDBRemote(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp index ed2cb7f2a97..f27c80b5d1a 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp @@ -104,9 +104,7 @@ bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp, return false; } -//---------------------------------------------------------------------- // ProcessMachCore constructor -//---------------------------------------------------------------------- ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, ListenerSP listener_sp, const FileSpec &core_file) @@ -115,9 +113,7 @@ ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp, m_dyld_addr(LLDB_INVALID_ADDRESS), m_mach_kernel_addr(LLDB_INVALID_ADDRESS), m_dyld_plugin_name() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- ProcessMachCore::~ProcessMachCore() { Clear(); // We need to call finalize on the process before destroying ourselves to @@ -127,9 +123,7 @@ ProcessMachCore::~ProcessMachCore() { Finalize(); } -//---------------------------------------------------------------------- // PluginInterface -//---------------------------------------------------------------------- ConstString ProcessMachCore::GetPluginName() { return GetPluginNameStatic(); } uint32_t ProcessMachCore::GetPluginVersion() { return 1; } @@ -191,9 +185,7 @@ bool ProcessMachCore::GetDynamicLoaderAddress(lldb::addr_t addr) { return false; } -//---------------------------------------------------------------------- // Process Control -//---------------------------------------------------------------------- Status ProcessMachCore::DoLoadCore() { Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_PROCESS)); @@ -493,17 +485,13 @@ void ProcessMachCore::RefreshStateAfterStop() { Status ProcessMachCore::DoDestroy() { return Status(); } -//------------------------------------------------------------------ // Process Queries -//------------------------------------------------------------------ bool ProcessMachCore::IsAlive() { return true; } bool ProcessMachCore::WarnBeforeDetach() const { return false; } -//------------------------------------------------------------------ // Process Memory -//------------------------------------------------------------------ size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) { // Don't allow the caching that lldb_private::Process::ReadMemory does since @@ -517,7 +505,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, size_t bytes_read = 0; if (core_objfile) { - //---------------------------------------------------------------------- // Segments are not always contiguous in mach-o core files. We have core // files that have segments like: // Address Size File off File size @@ -534,7 +521,6 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size, // We would attempt to read 32 bytes from 0xf6ff0 but would only get 16 // unless we loop through consecutive memory ranges that are contiguous in // the address space, but not in the file data. - //---------------------------------------------------------------------- while (bytes_read < size) { const addr_t curr_addr = addr + bytes_read; const VMRangeToFileOffset::Entry *core_memory_entry = diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h index e973679557a..3e446f67e12 100644 --- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.h @@ -20,9 +20,7 @@ class ThreadKDP; class ProcessMachCore : public lldb_private::Process { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ ProcessMachCore(lldb::TargetSP target_sp, lldb::ListenerSP listener, const lldb_private::FileSpec &core_file); @@ -40,43 +38,31 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // Check if a given Process - //------------------------------------------------------------------ bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override; - //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one - //------------------------------------------------------------------ lldb_private::Status DoLoadCore() override; lldb_private::DynamicLoader *GetDynamicLoader() override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - //------------------------------------------------------------------ // Process Control - //------------------------------------------------------------------ lldb_private::Status DoDestroy() override; void RefreshStateAfterStop() override; - //------------------------------------------------------------------ // Process Queries - //------------------------------------------------------------------ bool IsAlive() override; bool WarnBeforeDetach() const override; - //------------------------------------------------------------------ // Process Memory - //------------------------------------------------------------------ size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size, lldb_private::Status &error) override; @@ -107,7 +93,6 @@ private: eKernelCorefile } CorefilePreferences; - //------------------------------------------------------------------ /// If a core file can be interpreted multiple ways, this establishes /// which style wins. /// @@ -117,7 +102,6 @@ private: /// memory. Or it could be a user process coredump of lldb while doing /// kernel debugging - so a copy of the kernel is in its heap. This /// should become a setting so it can be over-ridden when necessary. - //------------------------------------------------------------------ CorefilePreference GetCorefilePreference() { // For now, if both user process and kernel binaries a present, // assume this is a kernel coredump which has a copy of a user @@ -125,9 +109,7 @@ private: return eKernelCorefile; } - //------------------------------------------------------------------ // For ProcessMachCore only - //------------------------------------------------------------------ typedef lldb_private::Range<lldb::addr_t, lldb::addr_t> FileRange; typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, FileRange> VMRangeToFileOffset; diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp index 3b128dbca8c..b71e48449b7 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Thread Registers -//---------------------------------------------------------------------- ThreadMachCore::ThreadMachCore(Process &process, lldb::tid_t tid) : Thread(process, tid), m_thread_name(), m_dispatch_queue_name(), diff --git a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h index baaec422cf5..ac5957e9020 100644 --- a/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h +++ b/lldb/source/Plugins/Process/mach-core/ThreadMachCore.h @@ -52,17 +52,13 @@ public: protected: friend class ProcessMachCore; - //------------------------------------------------------------------ // Member variables. - //------------------------------------------------------------------ std::string m_thread_name; std::string m_dispatch_queue_name; lldb::addr_t m_thread_dispatch_qaddr; lldb::RegisterContextSP m_thread_reg_ctx_sp; - //------------------------------------------------------------------ // Protected member functions. - //------------------------------------------------------------------ bool CalculateStopInfo() override; }; diff --git a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h index 2b0e272f6f3..23a8473daa9 100644 --- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h +++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h @@ -25,9 +25,7 @@ public: void ExecuteInterpreterLoop() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -39,9 +37,7 @@ public: static const char *GetPluginDescriptionStatic(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index f11192b7c80..ef4f738b54d 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -33,9 +33,7 @@ void StructuredPythonObject::Dump(Stream &s, bool pretty_print) const { s << "Python Obj: 0x" << GetValue(); } -//---------------------------------------------------------------------- // PythonObject -//---------------------------------------------------------------------- void PythonObject::Dump(Stream &strm) const { if (m_py_obj) { @@ -202,9 +200,7 @@ StructuredData::ObjectSP PythonObject::CreateStructuredObject() const { } } -//---------------------------------------------------------------------- // PythonString -//---------------------------------------------------------------------- PythonBytes::PythonBytes() : PythonObject() {} PythonBytes::PythonBytes(llvm::ArrayRef<uint8_t> bytes) : PythonObject() { @@ -338,9 +334,7 @@ StructuredData::StringSP PythonByteArray::CreateStructuredString() const { return result; } -//---------------------------------------------------------------------- // PythonString -//---------------------------------------------------------------------- PythonString::PythonString(PyRefType type, PyObject *py_obj) : PythonObject() { Reset(type, py_obj); // Use "Reset()" to ensure that py_obj is a string @@ -438,9 +432,7 @@ StructuredData::StringSP PythonString::CreateStructuredString() const { return result; } -//---------------------------------------------------------------------- // PythonInteger -//---------------------------------------------------------------------- PythonInteger::PythonInteger() : PythonObject() {} @@ -530,9 +522,7 @@ StructuredData::IntegerSP PythonInteger::CreateStructuredInteger() const { return result; } -//---------------------------------------------------------------------- // PythonBoolean -//---------------------------------------------------------------------- PythonBoolean::PythonBoolean(PyRefType type, PyObject *py_obj) : PythonObject() { @@ -579,9 +569,7 @@ StructuredData::BooleanSP PythonBoolean::CreateStructuredBoolean() const { return result; } -//---------------------------------------------------------------------- // PythonList -//---------------------------------------------------------------------- PythonList::PythonList(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) @@ -660,9 +648,7 @@ StructuredData::ArraySP PythonList::CreateStructuredArray() const { return result; } -//---------------------------------------------------------------------- // PythonTuple -//---------------------------------------------------------------------- PythonTuple::PythonTuple(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) @@ -756,9 +742,7 @@ StructuredData::ArraySP PythonTuple::CreateStructuredArray() const { return result; } -//---------------------------------------------------------------------- // PythonDictionary -//---------------------------------------------------------------------- PythonDictionary::PythonDictionary(PyInitialValue value) : PythonObject() { if (value == PyInitialValue::Empty) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index d30855d4758..7a0cf7403d4 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -267,9 +267,7 @@ public: m_command_thread_state = s; } - //---------------------------------------------------------------------- // IOHandlerDelegate - //---------------------------------------------------------------------- void IOHandlerActivated(IOHandler &io_handler, bool interactive) override; void IOHandlerInputComplete(IOHandler &io_handler, @@ -278,9 +276,7 @@ public: static lldb::ScriptInterpreterSP CreateInstance(CommandInterpreter &interpreter); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp index 3ab50613c56..3994dd0677f 100644 --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp @@ -39,9 +39,7 @@ using namespace lldb_private; #pragma mark - #pragma mark Anonymous Namespace -// ----------------------------------------------------------------------------- // Anonymous namespace -// ----------------------------------------------------------------------------- namespace sddarwinlog_private { const uint64_t NANOS_PER_MICRO = 1000; @@ -52,13 +50,11 @@ const uint64_t NANOS_PER_HOUR = NANOS_PER_MINUTE * 60; static bool DEFAULT_FILTER_FALLTHROUGH_ACCEPTS = true; -//------------------------------------------------------------------ /// Global, sticky enable switch. If true, the user has explicitly /// run the enable command. When a process launches or is attached to, /// we will enable DarwinLog if either the settings for auto-enable is /// on, or if the user had explicitly run enable at some point prior /// to the launch/attach. -//------------------------------------------------------------------ static bool s_is_explicitly_enabled; class EnableOptions; @@ -106,9 +102,7 @@ void SetGlobalEnableOptions(const DebuggerSP &debugger_sp, #pragma mark - #pragma mark Settings Handling -//------------------------------------------------------------------ /// Code to handle the StructuredDataDarwinLog settings -//------------------------------------------------------------------ static constexpr PropertyDefinition g_properties[] = { { @@ -391,12 +385,10 @@ static void RegisterFilterOperations() { // Commands // ========================================================================= -// ------------------------------------------------------------------------- /// Provides the main on-off switch for enabling darwin logging. /// /// It is valid to run the enable command when logging is already enabled. /// This resets the logging with whatever settings are currently set. -// ------------------------------------------------------------------------- static constexpr OptionDefinition g_enable_option_table[] = { // Source stream include/exclude options (the first-level filter). This one @@ -890,9 +882,7 @@ private: EnableOptionsSP m_options_sp; }; -// ------------------------------------------------------------------------- /// Provides the status command. -// ------------------------------------------------------------------------- class StatusCommand : public CommandObjectParsed { public: StatusCommand(CommandInterpreter &interpreter) @@ -968,9 +958,7 @@ protected: } }; -// ------------------------------------------------------------------------- /// Provides the darwin-log base command -// ------------------------------------------------------------------------- class BaseCommand : public CommandObjectMultiword { public: BaseCommand(CommandInterpreter &interpreter) @@ -1082,9 +1070,7 @@ using namespace sddarwinlog_private; #pragma mark - #pragma mark Public static API -// ----------------------------------------------------------------------------- // Public static API -// ----------------------------------------------------------------------------- void StructuredDataDarwinLog::Initialize() { RegisterFilterOperations(); @@ -1105,9 +1091,7 @@ ConstString StructuredDataDarwinLog::GetStaticPluginName() { #pragma mark - #pragma mark PluginInterface API -// ----------------------------------------------------------------------------- // PluginInterface API -// ----------------------------------------------------------------------------- ConstString StructuredDataDarwinLog::GetPluginName() { return GetStaticPluginName(); @@ -1118,9 +1102,7 @@ uint32_t StructuredDataDarwinLog::GetPluginVersion() { return 1; } #pragma mark - #pragma mark StructuredDataPlugin API -// ----------------------------------------------------------------------------- // StructuredDataPlugin API -// ----------------------------------------------------------------------------- bool StructuredDataDarwinLog::SupportsStructuredDataType( ConstString type_name) { @@ -1370,9 +1352,7 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process, EnableNow(); } -// ----------------------------------------------------------------------------- // public destructor -// ----------------------------------------------------------------------------- StructuredDataDarwinLog::~StructuredDataDarwinLog() { if (m_breakpoint_id != LLDB_INVALID_BREAK_ID) { @@ -1387,9 +1367,7 @@ StructuredDataDarwinLog::~StructuredDataDarwinLog() { #pragma mark - #pragma mark Private instance methods -// ----------------------------------------------------------------------------- // Private constructors -// ----------------------------------------------------------------------------- StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp) : StructuredDataPlugin(process_wp), m_recorded_first_timestamp(false), @@ -1397,9 +1375,7 @@ StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp) m_added_breakpoint_mutex(), m_added_breakpoint(), m_breakpoint_id(LLDB_INVALID_BREAK_ID) {} -// ----------------------------------------------------------------------------- // Private static methods -// ----------------------------------------------------------------------------- StructuredDataPluginSP StructuredDataDarwinLog::CreateInstance(Process &process) { diff --git a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h index d17e3cbe222..7ff3721d59f 100644 --- a/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h +++ b/lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h @@ -24,9 +24,7 @@ class StructuredDataDarwinLog : public StructuredDataPlugin { friend sddarwinlog_private::EnableCommand; public: - // ------------------------------------------------------------------------- // Public static API - // ------------------------------------------------------------------------- static void Initialize(); @@ -34,7 +32,6 @@ public: static ConstString GetStaticPluginName(); - // ------------------------------------------------------------------------- /// Return whether the DarwinLog functionality is enabled. /// /// The DarwinLog functionality is enabled if the user expicitly enabled @@ -45,20 +42,15 @@ public: /// \return /// True if DarwinLog support is/will be enabled for existing or /// newly launched/attached processes. - // ------------------------------------------------------------------------- static bool IsEnabled(); - // ------------------------------------------------------------------------- // PluginInterface API - // ------------------------------------------------------------------------- ConstString GetPluginName() override; uint32_t GetPluginVersion() override; - // ------------------------------------------------------------------------- // StructuredDataPlugin API - // ------------------------------------------------------------------------- bool SupportsStructuredDataType(ConstString type_name) override; @@ -76,15 +68,11 @@ public: ~StructuredDataDarwinLog(); private: - // ------------------------------------------------------------------------- // Private constructors - // ------------------------------------------------------------------------- StructuredDataDarwinLog(const lldb::ProcessWP &process_wp); - // ------------------------------------------------------------------------- // Private static methods - // ------------------------------------------------------------------------- static lldb::StructuredDataPluginSP CreateInstance(Process &process); @@ -98,16 +86,12 @@ private: static Status FilterLaunchInfo(ProcessLaunchInfo &launch_info, Target *target); - // ------------------------------------------------------------------------- // Internal helper methods used by friend classes - // ------------------------------------------------------------------------- void SetEnabled(bool enabled); void AddInitCompletionHook(Process &process); - // ------------------------------------------------------------------------- // Private methods - // ------------------------------------------------------------------------- void DumpTimestamp(Stream &stream, uint64_t timestamp); @@ -116,16 +100,12 @@ private: size_t HandleDisplayOfEvent(const StructuredData::Dictionary &event, Stream &stream); - // ------------------------------------------------------------------------- /// Call the enable command again, using whatever settings were initially /// made. - // ------------------------------------------------------------------------- void EnableNow(); - // ------------------------------------------------------------------------- // Private data - // ------------------------------------------------------------------------- bool m_recorded_first_timestamp; uint64_t m_first_timestamp_seen; bool m_is_enabled; diff --git a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h index 42bb1186437..2760a5a573e 100644 --- a/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h +++ b/lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h @@ -20,9 +20,7 @@ namespace breakpad { class SymbolFileBreakpad : public SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static void DebuggerInitialize(Debugger &debugger) {} @@ -36,9 +34,7 @@ public: return new SymbolFileBreakpad(obj_file); } - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileBreakpad(ObjectFile *object_file) : SymbolFile(object_file) {} ~SymbolFileBreakpad() override {} @@ -47,9 +43,7 @@ public: void InitializeObject() override {} - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp index 626d1a95b76..fd6f66b645e 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp @@ -51,14 +51,12 @@ DIERef::DIERef(const DWARFFormValue &form_value) } lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf) const { - //---------------------------------------------------------------------- // Each SymbolFileDWARF will set its ID to what is expected. // // SymbolFileDWARF, when used for DWARF with .o files on MacOSX, has the // ID set to the compile unit index. // // SymbolFileDWARFDwo sets the ID to the compile unit offset. - //---------------------------------------------------------------------- if (dwarf && die_offset != DW_INVALID_OFFSET) return dwarf->GetID() | die_offset; else diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h index a867a5f41d1..b2bb4de2ecc 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h @@ -20,22 +20,18 @@ struct DIERef { DIERef(dw_offset_t c, dw_offset_t d) : cu_offset(c), die_offset(d) {} - //---------------------------------------------------------------------- // In order to properly decode a lldb::user_id_t back into a DIERef we // need the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- explicit DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf); explicit DIERef(const DWARFFormValue &form_value); - //---------------------------------------------------------------------- // In order to properly encode a DIERef unto a lldb::user_id_t we need // the DWARF file since it knows if DWARF in .o files is being used // (MacOSX) or if DWO files are being used. The encoding of the user ID // differs between the two types of DWARF. - //---------------------------------------------------------------------- lldb::user_id_t GetUID(SymbolFileDWARF *dwarf) const; bool operator<(const DIERef &ref) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 63617c286eb..360c1249f87 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2115,7 +2115,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, return false; #if defined LLDB_CONFIGURATION_DEBUG - //---------------------------------------------------------------------- // For debugging purposes, the LLDB_DWARF_DONT_COMPLETE_TYPENAMES environment // variable can be set with one or more typenames separated by ';' // characters. This will cause this function to not complete any types whose @@ -2125,7 +2124,6 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die, // // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo // LLDB_DWARF_DONT_COMPLETE_TYPENAMES=Foo;Bar;Baz - //---------------------------------------------------------------------- const char *dont_complete_typenames_cstr = getenv("LLDB_DWARF_DONT_COMPLETE_TYPENAMES"); if (dont_complete_typenames_cstr && dont_complete_typenames_cstr[0]) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h index 38cd0bf38a1..e561ac5b3b8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -128,10 +128,8 @@ protected: lldb::TypeSP ParseTypeFromDWO(const DWARFDIE &die, lldb_private::Log *log); - //---------------------------------------------------------------------- // Return true if this type is a declaration to a type in an external // module. - //---------------------------------------------------------------------- lldb::ModuleSP GetModuleForType(const DWARFDIE &die); typedef llvm::SmallPtrSet<const DWARFDebugInfoEntry *, 4> DIEPointerSet; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h index 486572a4c80..278c2b6188b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h @@ -37,9 +37,7 @@ public: : m_cu(const_cast<DWARFUnit *>(cu)), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {} - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } bool IsValid() const { return m_cu && m_die; } @@ -48,9 +46,7 @@ public: bool Supports_DW_AT_APPLE_objc_complete_type() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- SymbolFileDWARF *GetDWARF() const; DWARFUnit *GetCU() const { return m_cu; } @@ -77,31 +73,25 @@ public: m_die = nullptr; } - //---------------------------------------------------------------------- // Get the data that contains the attribute values for this DIE. Support // for .debug_types means that any DIE can have its data either in the // .debug_info or the .debug_types section; this method will return the // correct section data. // // Clients must validate that this object is valid before calling this. - //---------------------------------------------------------------------- const lldb_private::DWARFDataExtractor &GetData() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- dw_tag_t Tag() const; const char *GetTagAsCString() const; dw_offset_t GetOffset() const; - //---------------------------------------------------------------------- // Get the LLDB user ID for this DIE. This is often just the DIE offset, // but it might have a SymbolFileDWARF::GetID() in the high 32 bits if // we are doing Darwin DWARF in .o file, or DWARF stand alone debug // info. - //---------------------------------------------------------------------- lldb::user_id_t GetID() const; const char *GetName() const; @@ -112,13 +102,11 @@ public: lldb_private::CompileUnit *GetLLDBCompileUnit() const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- const char *GetAttributeValueAsString(const dw_attr_t attr, const char *fail_value) const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h index dce99fbcbd9..b191ecb5fbb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h @@ -20,22 +20,18 @@ public: lldb::offset_t *offset_ptr); void Dump(lldb_private::Stream *s) const override; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// \return /// The correct data (.debug_types for DWARF 4 and earlier, and /// .debug_info for DWARF 5 and later) for the DIE information in /// this unit. - //------------------------------------------------------------------ const lldb_private::DWARFDataExtractor &GetData() const override; - //------------------------------------------------------------------ /// Get the size in bytes of the header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ uint32_t GetHeaderByteSize() const override; private: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h index af3323efe9f..854e05493d5 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h @@ -16,24 +16,18 @@ class DWARFDIE : public DWARFBaseDIE { public: using DWARFBaseDIE::DWARFBaseDIE; - //---------------------------------------------------------------------- // Tests - //---------------------------------------------------------------------- bool IsStructUnionOrClass() const; bool IsMethod() const; - //---------------------------------------------------------------------- // Accessors - //---------------------------------------------------------------------- lldb::ModuleSP GetContainingDWOModule() const; DWARFDIE GetContainingDWOModuleDIE() const; - //---------------------------------------------------------------------- // Accessing information about a DIE - //---------------------------------------------------------------------- const char *GetMangledName() const; const char *GetPubname() const; @@ -42,14 +36,10 @@ public: lldb_private::Type *ResolveType() const; - //---------------------------------------------------------------------- // Resolve a type by UID using this DIE's DWARF file - //---------------------------------------------------------------------- lldb_private::Type *ResolveTypeUID(const DIERef &die_ref) const; - //---------------------------------------------------------------------- // Functions for obtaining DIE relations and references - //---------------------------------------------------------------------- DWARFDIE GetParent() const; @@ -63,11 +53,9 @@ public: DWARFDIE GetReferencedDIE(const dw_attr_t attr) const; - //---------------------------------------------------------------------- // Get a another DIE from the same DWARF file as this DIE. This will // check the current DIE's compile unit first to see if "die_offset" is // in the same compile unit, and fall back to checking the DWARF file. - //---------------------------------------------------------------------- DWARFDIE GetDIE(dw_offset_t die_offset) const; using DWARFBaseDIE::GetDIE; @@ -78,9 +66,7 @@ public: DWARFDIE GetParentDeclContextDIE() const; - //---------------------------------------------------------------------- // DeclContext related functions - //---------------------------------------------------------------------- std::vector<DWARFDIE> GetDeclContextDIEs() const; void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const; @@ -90,13 +76,11 @@ public: void GetDeclContext(std::vector<lldb_private::CompilerContext> &context) const; - //---------------------------------------------------------------------- // Getting attribute values from the DIE. // // GetAttributeValueAsXXX() functions should only be used if you are // looking for one or two attributes on a DIE. If you are trying to // parse all attributes, use GetAttributes (...) instead - //---------------------------------------------------------------------- DWARFDIE GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const; @@ -106,9 +90,7 @@ public: int &call_line, int &call_column, lldb_private::DWARFExpression *frame_base) const; - //---------------------------------------------------------------------- // CompilerDecl related functions - //---------------------------------------------------------------------- lldb_private::CompilerDecl GetDecl() const; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp index 17a55a26611..25d64d4f62f 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp @@ -14,17 +14,13 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Clear() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::Clear() { m_idx_offset = 0; m_decls.clear(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::Extract() -//---------------------------------------------------------------------- llvm::Error DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, lldb::offset_t *offset_ptr) { @@ -54,9 +50,7 @@ DWARFAbbreviationDeclarationSet::extract(const DWARFDataExtractor &data, return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclaration * DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( dw_uleb128_t abbrCode) const { @@ -76,9 +70,7 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration( } -//---------------------------------------------------------------------- // DWARFAbbreviationDeclarationSet::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &abbr_decl : m_decls) { @@ -91,13 +83,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( } } -//---------------------------------------------------------------------- // Encode // // Encode the abbreviation table onto the end of the buffer provided into a // byte representation as would be found in a ".debug_abbrev" debug information // section. -//---------------------------------------------------------------------- // void // DWARFAbbreviationDeclarationSet::Encode(BinaryStreamBuf& debug_abbrev_buf) // const @@ -109,15 +99,11 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms( // debug_abbrev_buf.Append8(0); //} -//---------------------------------------------------------------------- // DWARFDebugAbbrev constructor -//---------------------------------------------------------------------- DWARFDebugAbbrev::DWARFDebugAbbrev() : m_abbrevCollMap(), m_prev_abbr_offset_pos(m_abbrevCollMap.end()) {} -//---------------------------------------------------------------------- // DWARFDebugAbbrev::Parse() -//---------------------------------------------------------------------- llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { lldb::offset_t offset = 0; @@ -135,9 +121,7 @@ llvm::Error DWARFDebugAbbrev::parse(const DWARFDataExtractor &data) { return llvm::ErrorSuccess(); } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetAbbreviationDeclarationSet() -//---------------------------------------------------------------------- const DWARFAbbreviationDeclarationSet * DWARFDebugAbbrev::GetAbbreviationDeclarationSet( dw_offset_t cu_abbr_offset) const { @@ -156,9 +140,7 @@ DWARFDebugAbbrev::GetAbbreviationDeclarationSet( return NULL; } -//---------------------------------------------------------------------- // DWARFDebugAbbrev::GetUnsupportedForms() -//---------------------------------------------------------------------- void DWARFDebugAbbrev::GetUnsupportedForms( std::set<dw_form_t> &invalid_forms) const { for (const auto &pair : m_abbrevCollMap) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp index f00b97c7b52..fcacf59d8b8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp @@ -24,14 +24,10 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugAranges::DWARFDebugAranges() : m_aranges() {} -//---------------------------------------------------------------------- // CountArangeDescriptors -//---------------------------------------------------------------------- class CountArangeDescriptors { public: CountArangeDescriptors(uint32_t &count_ref) : count(count_ref) { @@ -43,9 +39,7 @@ public: uint32_t &count; }; -//---------------------------------------------------------------------- // Extract -//---------------------------------------------------------------------- llvm::Error DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) { assert(debug_aranges_data.ValidOffset(0)); @@ -103,9 +97,7 @@ void DWARFDebugAranges::Sort(bool minimize) { m_aranges.CombineConsecutiveEntriesWithEqualData(); } -//---------------------------------------------------------------------- // FindAddress -//---------------------------------------------------------------------- dw_offset_t DWARFDebugAranges::FindAddress(dw_addr_t address) const { const RangeToDIE::Entry *entry = m_aranges.FindEntryThatContains(address); if (entry) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index 9f235ffad6c..a85e621a7a2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -27,16 +27,12 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context) : m_dwarf2Data(NULL), m_context(context), m_compile_units(), m_cu_aranges_up() {} -//---------------------------------------------------------------------- // SetDwarfData -//---------------------------------------------------------------------- void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) { m_dwarf2Data = dwarf2Data; m_compile_units.clear(); @@ -201,11 +197,9 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) { return DWARFDIE(); } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset. -//---------------------------------------------------------------------- DWARFDIE DWARFDebugInfo::GetDIE(const DIERef &die_ref) { DWARFUnit *cu = GetCompileUnit(die_ref); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h index a29e3b17a75..4c8e0700743 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h @@ -62,9 +62,7 @@ protected: typedef std::vector<DWARFUnitSP> CompileUnitColl; - //---------------------------------------------------------------------- // Member variables - //---------------------------------------------------------------------- SymbolFileDWARF *m_dwarf2Data; lldb_private::DWARFContext &m_context; CompileUnitColl m_compile_units; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 5de245d657f..13b539955ac 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -199,13 +199,11 @@ bool DWARFDebugInfoEntry::FastExtract( return false; } -//---------------------------------------------------------------------- // Extract // // Extract a debug info entry for a given compile unit from the .debug_info and // .debug_abbrev data within the SymbolFileDWARF class starting at the given // offset -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::Extract(const DWARFUnit *cu, lldb::offset_t *offset_ptr) { const DWARFDataExtractor &debug_info_data = cu->GetData(); @@ -370,12 +368,10 @@ static dw_offset_t GetRangesOffset(const DWARFDebugRangesBase *debug_ranges, return form_value.Unsigned(); } -//---------------------------------------------------------------------- // GetDIENamesAndRanges // // Gets the valid address ranges for a given DIE by looking for a // DW_AT_low_pc/DW_AT_high_pc pair, DW_AT_entry_pc, or DW_AT_ranges attributes. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetDIENamesAndRanges( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, @@ -572,12 +568,10 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges( return !ranges.IsEmpty(); } -//---------------------------------------------------------------------- // Dump // // Dumps a debug information entry and all of it's attributes to the specified // stream. -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, Stream &s, uint32_t recurse_depth) const { @@ -630,13 +624,11 @@ void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data, } } -//---------------------------------------------------------------------- // DumpAttribute // // Dumps a debug information entry attribute along with it's form. Any special // display of attributes is done (disassemble location lists, show enumeration // values for attributes, etc). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::DumpAttribute( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr, @@ -731,12 +723,10 @@ void DWARFDebugInfoEntry::DumpAttribute( s.PutCString(" )\n"); } -//---------------------------------------------------------------------- // Get all attribute values for a given DIE, including following any // specification or abstract origin attributes and including those in the // results. Any duplicate attributes will have the first instance take // precedence (this can happen for declaration attributes). -//---------------------------------------------------------------------- size_t DWARFDebugInfoEntry::GetAttributes( const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes, DWARFAttributes &attributes, uint32_t curr_depth) const { @@ -809,14 +799,12 @@ size_t DWARFDebugInfoEntry::GetAttributes( return attributes.Size(); } -//---------------------------------------------------------------------- // GetAttributeValue // // Get the value of an attribute and return the .debug_info offset of the // attribute if it was properly extracted into form_value, or zero if we fail // since an offset of zero is invalid for an attribute (it would be a compile // unit header). -//---------------------------------------------------------------------- dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &form_value, @@ -897,14 +885,12 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue( check_specification_or_abstract_origin); } -//---------------------------------------------------------------------- // GetAttributeValueAsString // // Get the value of an attribute as a string return it. The resulting pointer // to the string data exists within the supplied SymbolFileDWARF and will only // be available as long as the SymbolFileDWARF is still around and it's content // doesn't change. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetAttributeValueAsString( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, @@ -916,11 +902,9 @@ const char *DWARFDebugInfoEntry::GetAttributeValueAsString( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsUnsigned // // Get the value of an attribute as unsigned and return it. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -932,12 +916,10 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeValueAsReference // // Get the value of an attribute as reference and fix up and compile unit // relative offsets as needed. -//---------------------------------------------------------------------- uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, @@ -960,14 +942,12 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeHighPC // // Get the hi_pc, adding hi_pc to lo_pc when specified as an <offset-from-low- // pc>. // // Returns the hi_pc or fail_value. -//---------------------------------------------------------------------- dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin) const { @@ -985,14 +965,12 @@ dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC( return fail_value; } -//---------------------------------------------------------------------- // GetAttributeAddressRange // // Get the lo_pc and hi_pc, adding hi_pc to lo_pc when specified as an <offset- // from-low-pc>. // // Returns true or sets lo_pc and hi_pc to fail_value. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetAttributeAddressRange( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, @@ -1034,23 +1012,19 @@ size_t DWARFDebugInfoEntry::GetAttributeAddressRanges( return ranges.GetSize(); } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute and return it if one exists, else // return NULL. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true); } -//---------------------------------------------------------------------- // GetMangledName // // Get value of the DW_AT_MIPS_linkage_name attribute and return it if one // exists, else return the value of the DW_AT_name attribute -//---------------------------------------------------------------------- const char * DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, @@ -1074,12 +1048,10 @@ DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetPubname // // Get value the name for a DIE as it should appear for a .debug_pubnames or // .debug_pubtypes section. -//---------------------------------------------------------------------- const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu) const { const char *name = nullptr; @@ -1100,14 +1072,12 @@ const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data, return name; } -//---------------------------------------------------------------------- // GetName // // Get value of the DW_AT_name attribute for a debug information entry that // exists at offset "die_offset" and place that value into the supplied stream // object. If the DIE is a NULL object "NULL" is placed into the stream, and if // no DW_AT_name attribute exists for the DIE then nothing is printed. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, Stream &s) { @@ -1134,13 +1104,11 @@ bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // AppendTypeName // // Follows the type name definition down through all needed tags to end up with // a fully qualified type name and dump the results to the supplied stream. // This is used to show the name of types given a type identifier. -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_offset_t die_offset, @@ -1266,9 +1234,7 @@ bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data, return false; } -//---------------------------------------------------------------------- // BuildAddressRangeTable -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1292,14 +1258,12 @@ void DWARFDebugInfoEntry::BuildAddressRangeTable( } } -//---------------------------------------------------------------------- // BuildFunctionAddressRangeTable // // This function is very similar to the BuildAddressRangeTable function except // that the actual DIE offset for the function is placed in the table instead // of the compile unit offset (which is the way the standard .debug_aranges // section does it). -//---------------------------------------------------------------------- void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable( SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const { @@ -1478,9 +1442,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName( return storage.c_str(); } -//---------------------------------------------------------------------- // LookupAddress -//---------------------------------------------------------------------- bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp index aae0b51c1b1..0a7a44ac282 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -27,12 +27,10 @@ using namespace lldb; using namespace lldb_private; using namespace std; -//---------------------------------------------------------------------- // Parse // // Parse all information in the debug_line_data into an internal // representation. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data) { m_lineTableMap.clear(); lldb::offset_t offset = 0; @@ -61,9 +59,7 @@ void DWARFDebugLine::ParseIfNeeded(const DWARFDataExtractor &debug_line_data) { Parse(debug_line_data); } -//---------------------------------------------------------------------- // DWARFDebugLine::GetLineTable -//---------------------------------------------------------------------- DWARFDebugLine::LineTable::shared_ptr DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { DWARFDebugLine::LineTable::shared_ptr line_table_shared_ptr; @@ -73,13 +69,11 @@ DWARFDebugLine::GetLineTable(const dw_offset_t offset) const { return line_table_shared_ptr; } -//---------------------------------------------------------------------- // Parse // // Parse the entire line table contents calling callback each time a new // prologue is parsed and every time a new row is to be added to the line // table. -//---------------------------------------------------------------------- void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data, DWARFDebugLine::State::Callback callback, void *userData) { @@ -111,9 +105,7 @@ ReadDescriptors(const DWARFDataExtractor &debug_line_data, } } // namespace -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue -//---------------------------------------------------------------------- bool DWARFDebugLine::ParsePrologue(const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, Prologue *prologue, DWARFUnit *dwarf_cu) { @@ -273,13 +265,11 @@ bool DWARFDebugLine::ParseSupportFiles( return true; } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a single line table (prologue and all rows) and call the callback // function once for the prologue (row in state will be zero) and each time a // row is to be added to the line table. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, DWARFDebugLine::State::Callback callback, void *userData, DWARFUnit *dwarf_cu) { @@ -552,9 +542,7 @@ bool DWARFDebugLine::ParseStatementTable( return end_offset; } -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseStatementTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -571,12 +559,10 @@ static void ParseStatementTableCallback(dw_offset_t offset, } } -//---------------------------------------------------------------------- // ParseStatementTable // // Parse a line table at offset and populate the LineTable class with the // prologue and all rows. -//---------------------------------------------------------------------- bool DWARFDebugLine::ParseStatementTable( const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr, LineTable *line_table, DWARFUnit *dwarf_cu) { @@ -588,9 +574,7 @@ inline bool DWARFDebugLine::Prologue::IsValid() const { return SymbolFileDWARF::SupportedVersion(version); } -//---------------------------------------------------------------------- // DWARFDebugLine::Prologue::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Prologue::Dump(Log *log) { uint32_t i; @@ -629,11 +613,9 @@ void DWARFDebugLine::Prologue::Dump(Log *log) { } } -//---------------------------------------------------------------------- // DWARFDebugLine::ParsePrologue::Append // // Append the contents of the prologue to the binary stream buffer -//---------------------------------------------------------------------- // void // DWARFDebugLine::Prologue::Append(BinaryStreamBuf& buff) const //{ @@ -695,18 +677,14 @@ void DWARFDebugLine::LineTable::AppendRow(const DWARFDebugLine::Row &state) { rows.push_back(state); } -//---------------------------------------------------------------------- // Compare function for the binary search in // DWARFDebugLine::LineTable::LookupAddress() -//---------------------------------------------------------------------- static bool FindMatchingAddress(const DWARFDebugLine::Row &row1, const DWARFDebugLine::Row &row2) { return row1.address < row2.address; } -//---------------------------------------------------------------------- // DWARFDebugLine::LineTable::LookupAddress -//---------------------------------------------------------------------- uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, dw_addr_t cu_high_pc) const { uint32_t index = UINT32_MAX; @@ -739,26 +717,20 @@ uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address, return index; // Failed to find address } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Row -//---------------------------------------------------------------------- DWARFDebugLine::Row::Row(bool default_is_stmt) : address(0), line(1), column(0), file(1), is_stmt(default_is_stmt), basic_block(false), end_sequence(false), prologue_end(false), epilogue_begin(false), isa(0) {} -//---------------------------------------------------------------------- // Called after a row is appended to the matrix -//---------------------------------------------------------------------- void DWARFDebugLine::Row::PostAppend() { basic_block = false; prologue_end = false; epilogue_begin = false; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Reset(bool default_is_stmt) { address = 0; line = 1; @@ -771,9 +743,7 @@ void DWARFDebugLine::Row::Reset(bool default_is_stmt) { epilogue_begin = false; isa = 0; } -//---------------------------------------------------------------------- // DWARFDebugLine::Row::Dump -//---------------------------------------------------------------------- void DWARFDebugLine::Row::Dump(Log *log) const { log->Printf("0x%16.16" PRIx64 " %6u %6u %6u %3u %s%s%s%s%s", address, line, column, file, isa, is_stmt ? " is_stmt" : "", @@ -783,9 +753,7 @@ void DWARFDebugLine::Row::Dump(Log *log) const { end_sequence ? " end_sequence" : ""); } -//---------------------------------------------------------------------- // Compare function LineTable structures -//---------------------------------------------------------------------- static bool AddressLessThan(const DWARFDebugLine::Row &a, const DWARFDebugLine::Row &b) { return a.address < b.address; @@ -825,9 +793,7 @@ void DWARFDebugLine::Row::Insert(Row::collection &state_coll, } } -//---------------------------------------------------------------------- // DWARFDebugLine::State::State -//---------------------------------------------------------------------- DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, DWARFDebugLine::State::Callback cb, void *userData) : Row(p->default_is_stmt), prologue(p), log(l), callback(cb), @@ -837,14 +803,10 @@ DWARFDebugLine::State::State(Prologue::shared_ptr &p, Log *l, callback(0, *this, callbackUserData); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Reset -//---------------------------------------------------------------------- void DWARFDebugLine::State::Reset() { Row::Reset(prologue->default_is_stmt); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::AppendRowToMatrix -//---------------------------------------------------------------------- void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { // Each time we are to add an entry into the line table matrix call the // callback function so that someone can do something with the current state @@ -864,9 +826,7 @@ void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) { PostAppend(); } -//---------------------------------------------------------------------- // DWARFDebugLine::State::Finalize -//---------------------------------------------------------------------- void DWARFDebugLine::State::Finalize(dw_offset_t offset) { // Call the callback with a special row state when we are done parsing a line // table diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h index 4c4e0d33c6c..9dc2d9b40df 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h @@ -24,14 +24,10 @@ class DWARFUnit; class SymbolFileDWARF; -//---------------------------------------------------------------------- // DWARFDebugLine -//---------------------------------------------------------------------- class DWARFDebugLine { public: - //------------------------------------------------------------------ // FileNameEntry - //------------------------------------------------------------------ struct FileNameEntry { FileNameEntry() : name(nullptr), dir_idx(0), mod_time(0), length(0) {} @@ -42,9 +38,7 @@ public: llvm::MD5::MD5Result checksum; }; - //------------------------------------------------------------------ // Prologue - //------------------------------------------------------------------ struct Prologue { Prologue() @@ -145,9 +139,7 @@ public: // instruction set architecture for the current instruction. }; - //------------------------------------------------------------------ // LineTable - //------------------------------------------------------------------ struct LineTable { typedef std::shared_ptr<LineTable> shared_ptr; @@ -165,9 +157,7 @@ public: Row::collection rows; }; - //------------------------------------------------------------------ // State - //------------------------------------------------------------------ struct State : public Row { typedef void (*Callback)(dw_offset_t offset, const State &state, void *userData); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h index 240829edd4f..9f5e28eb747 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h @@ -14,13 +14,11 @@ #include "lldb/Utility/ConstString.h" #include "DWARFDefines.h" -//---------------------------------------------------------------------- // DWARFDeclContext // // A class that represents a declaration context all the way down to a // DIE. This is useful when trying to find a DIE in one DWARF to a DIE // in another DWARF file. -//---------------------------------------------------------------------- class DWARFDeclContext { public: diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index 7a1611629c2..58744a7a17c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -34,9 +34,7 @@ DWARFUnit::DWARFUnit(SymbolFileDWARF *dwarf) DWARFUnit::~DWARFUnit() {} -//---------------------------------------------------------------------- // Parses first DIE of a compile unit. -//---------------------------------------------------------------------- void DWARFUnit::ExtractUnitDIEIfNeeded() { { llvm::sys::ScopedReader lock(m_first_die_mutex); @@ -67,10 +65,8 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() { } } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will leave this compile unit extracted forever. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsIfNeeded() { m_cancel_scopes = true; @@ -86,13 +82,11 @@ void DWARFUnit::ExtractDIEsIfNeeded() { ExtractDIEsRWLocked(); } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs if it hasn't already been done. // It will clear this compile unit after returned instance gets out of scope, // no other ScopedExtractDIEs instance is running for this compile unit // and no ExtractDIEsIfNeeded() has been executed during this ScopedExtractDIEs // lifetime. -//---------------------------------------------------------------------- DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped() { ScopedExtractDIEs scoped(this); @@ -145,10 +139,8 @@ DWARFUnit::ScopedExtractDIEs &DWARFUnit::ScopedExtractDIEs::operator=( return *this; } -//---------------------------------------------------------------------- // Parses a compile unit and indexes its DIEs, m_die_array_mutex must be // held R/W and m_die_array must be empty. -//---------------------------------------------------------------------- void DWARFUnit::ExtractDIEsRWLocked() { llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex); @@ -532,21 +524,17 @@ DWARFFormValue::FixedFormSizes DWARFUnit::GetFixedFormSizes() { void DWARFUnit::SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; } -//---------------------------------------------------------------------- // Compare function DWARFDebugAranges::Range structures -//---------------------------------------------------------------------- static bool CompareDIEOffset(const DWARFDebugInfoEntry &die, const dw_offset_t die_offset) { return die.GetOffset() < die_offset; } -//---------------------------------------------------------------------- // GetDIE() // // Get the DIE (Debug Information Entry) with the specified offset by first // checking if the DIE is contained within this compile unit and grabbing the // DIE from this compile unit. Otherwise we grab the DIE from the DWARF file. -//---------------------------------------------------------------------- DWARFDIE DWARFUnit::GetDIE(dw_offset_t die_offset) { if (die_offset != DW_INVALID_OFFSET) { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h index 0ced5797ec6..e3418d812a6 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h @@ -58,7 +58,6 @@ public: uint32_t depth = UINT32_MAX) const; bool Verify(lldb_private::Stream *s) const; virtual void Dump(lldb_private::Stream *s) const = 0; - //------------------------------------------------------------------ /// Get the data that contains the DIE information for this unit. /// /// This will return the correct bytes that contain the data for @@ -67,26 +66,21 @@ public: /// /// \return /// The correct data for the DIE information in this unit. - //------------------------------------------------------------------ virtual const lldb_private::DWARFDataExtractor &GetData() const = 0; - //------------------------------------------------------------------ /// Get the size in bytes of the compile unit header. /// /// \return /// Byte size of the compile unit header - //------------------------------------------------------------------ virtual uint32_t GetHeaderByteSize() const = 0; // Offset of the initial length field. dw_offset_t GetOffset() const { return m_offset; } lldb::user_id_t GetID() const; - //------------------------------------------------------------------ /// Get the size in bytes of the length field in the header. /// /// In DWARF32 this is just 4 bytes /// /// \return /// Byte size of the compile unit header length field - //------------------------------------------------------------------ size_t GetLengthByteSize() const { return 4; } bool ContainsDIEOffset(dw_offset_t die_offset) const { diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp index 21242d1fe05..b214fd9391b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp @@ -43,10 +43,8 @@ void ManualDWARFIndex::Index() { std::vector<IndexSet> sets(units_to_index.size()); - //---------------------------------------------------------------------- // Keep memory down by clearing DIEs for any compile units if indexing // caused us to load the compile unit's DIEs. - //---------------------------------------------------------------------- std::vector<llvm::Optional<DWARFUnit::ScopedExtractDIEs>> clear_cu_dies( units_to_index.size()); auto parser_fn = [&](size_t cu_idx) { @@ -59,14 +57,12 @@ void ManualDWARFIndex::Index() { // Create a task runner that extracts dies for each DWARF compile unit in a // separate thread - //---------------------------------------------------------------------- // First figure out which compile units didn't have their DIEs already // parsed and remember this. If no DIEs were parsed prior to this index // function call, we are going to want to clear the CU dies after we are // done indexing to make sure we don't pull in all DWARF dies, but we need // to wait until all compile units have been indexed in case a DIE in one // compile unit refers to another and the indexes accesses those DIEs. - //---------------------------------------------------------------------- TaskMapOverInt(0, units_to_index.size(), extract_fn); // Now create a task runner that can index each DWARF compile unit in a diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 3952a392911..5e6dd275388 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -328,10 +328,8 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope, return num_types_added; } -//---------------------------------------------------------------------- // Gets the first parent that is a lexical block, function or inlined // subroutine, or compile unit. -//---------------------------------------------------------------------- DWARFDIE SymbolFileDWARF::GetParentSymbolContextDIE(const DWARFDIE &child_die) { DWARFDIE die; @@ -959,9 +957,7 @@ struct ParseDWARFLineTableCallbackInfo { lldb::addr_t addr_mask; }; -//---------------------------------------------------------------------- // ParseStatementTableCallback -//---------------------------------------------------------------------- static void ParseDWARFLineTableCallback(dw_offset_t offset, const DWARFDebugLine::State &state, void *userData) { @@ -2787,7 +2783,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( return type_sp; } -//---------------------------------------------------------------------- // This function helps to ensure that the declaration contexts match for two // different DIEs. Often times debug information will refer to a forward // declaration of a type (the equivalent of "struct my_struct;". There will @@ -2797,7 +2792,6 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE( // type was in the same declaration context as the original DIE. This function // can efficiently compare two DIEs and will return true when the declaration // context matches, and false when they don't. -//---------------------------------------------------------------------- bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1, const DWARFDIE &die2) { if (die1 == die2) @@ -3788,9 +3782,7 @@ SymbolFileDWARF::ParseCallEdgesInFunction(UserID func_id) { return {}; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolFileDWARF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolFileDWARF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index 0328e5ff223..42ae231248b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -36,9 +36,7 @@ #include "DWARFIndex.h" #include "UniqueDWARFASTType.h" -//---------------------------------------------------------------------- // Forward Declarations for this DWARF plugin -//---------------------------------------------------------------------- class DebugMapModule; class DWARFAbbreviationDeclaration; class DWARFAbbreviationDeclarationSet; @@ -68,9 +66,7 @@ public: friend class DWARFDIE; friend class DWARFASTParserClang; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -86,9 +82,7 @@ public: static const lldb_private::FileSpecList &GetSymlinkPaths(); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARF(lldb_private::ObjectFile *ofile); @@ -98,9 +92,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; @@ -219,9 +211,7 @@ public: std::recursive_mutex &GetModuleMutex() const override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp index 582565662f7..e5bc63b3cb8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp @@ -1230,9 +1230,7 @@ void SymbolFileDWARFDebugMap::DumpClangAST(Stream &s) { }); } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileDWARFDebugMap::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h index 6f5dddcda23..b7dc2bcb2a8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h @@ -24,9 +24,7 @@ class DWARFDeclContext; class SymbolFileDWARFDebugMap : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -38,18 +36,14 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileDWARFDebugMap(lldb_private::ObjectFile *ofile); ~SymbolFileDWARFDebugMap() override; uint32_t CalculateAbilities() override; void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -130,9 +124,7 @@ public: void DumpClangAST(lldb_private::Stream &s) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; @@ -157,9 +149,7 @@ protected: lldb::addr_t> FileRangeMap; - //------------------------------------------------------------------ // Class specific types - //------------------------------------------------------------------ struct CompileUnitInfo { lldb_private::FileSpec so_file; lldb_private::ConstString oso_path; @@ -182,9 +172,7 @@ protected: const FileRangeMap &GetFileRangeMap(SymbolFileDWARFDebugMap *exe_symfile); }; - //------------------------------------------------------------------ // Protected Member Functions - //------------------------------------------------------------------ void InitOSO(); static uint32_t GetOSOIndexFromUserID(lldb::user_id_t uid) { @@ -271,9 +259,7 @@ protected: return m_unique_ast_type_map; } - //------------------------------------------------------------------ // OSOEntry - //------------------------------------------------------------------ class OSOEntry { public: OSOEntry() @@ -302,9 +288,7 @@ protected: typedef lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t, OSOEntry> DebugMap; - //------------------------------------------------------------------ // Member Variables - //------------------------------------------------------------------ std::bitset<kNumFlags> m_flags; std::vector<CompileUnitInfo> m_compile_unit_infos; std::vector<uint32_t> m_func_indexes; // Sorted by address @@ -316,24 +300,19 @@ protected: lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type; DebugMap m_debug_map; - //------------------------------------------------------------------ // When an object file from the debug map gets parsed in // SymbolFileDWARF, it needs to tell the debug map about the object // files addresses by calling this function once for each N_FUN, // N_GSYM and N_STSYM and after all entries in the debug map have // been matched up, FinalizeOSOFileRanges() should be called. - //------------------------------------------------------------------ bool AddOSOFileRange(CompileUnitInfo *cu_info, lldb::addr_t exe_file_addr, lldb::addr_t exe_byte_size, lldb::addr_t oso_file_addr, lldb::addr_t oso_byte_size); - //------------------------------------------------------------------ // Called after calling AddOSOFileRange() for each object file debug // map entry to finalize the info for the unlinked compile unit. - //------------------------------------------------------------------ void FinalizeOSOFileRanges(CompileUnitInfo *cu_info); - //------------------------------------------------------------------ /// Convert \a addr from a .o file address, to an executable address. /// /// \param[in] addr @@ -342,10 +321,8 @@ protected: /// \return /// Returns true if \a addr was converted to be an executable /// section/offset address, false otherwise. - //------------------------------------------------------------------ bool LinkOSOAddress(lldb_private::Address &addr); - //------------------------------------------------------------------ /// Convert a .o file "file address" to an executable "file address". /// /// \param[in] oso_symfile @@ -358,11 +335,9 @@ protected: /// LLDB_INVALID_ADDRESS if \a oso_file_addr is not in the /// linked executable, otherwise a valid "file address" from the /// linked executable that contains the debug map. - //------------------------------------------------------------------ lldb::addr_t LinkOSOFileAddress(SymbolFileDWARF *oso_symfile, lldb::addr_t oso_file_addr); - //------------------------------------------------------------------ /// Given a line table full of lines with "file addresses" that are /// for a .o file represented by \a oso_symfile, link a new line table /// and return it. @@ -377,7 +352,6 @@ protected: /// Returns a valid line table full of linked addresses, or NULL /// if none of the line table addresses exist in the main /// executable. - //------------------------------------------------------------------ lldb_private::LineTable * LinkOSOLineTable(SymbolFileDWARF *oso_symfile, lldb_private::LineTable *line_table); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h index 06e11941eca..1269dbac712 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h @@ -18,9 +18,7 @@ class UniqueDWARFASTType { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ UniqueDWARFASTType() : m_type_sp(), m_die(), m_declaration(), m_byte_size( diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h index 761d11bf273..60eece71661 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h @@ -50,9 +50,7 @@ struct DeclStatus { class PdbAstBuilder { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ PdbAstBuilder(ObjectFile &obj, PdbIndex &index); clang::DeclContext &GetTranslationUnitDecl(); diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h index 54cb4429c15..60dd7d48b53 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h @@ -44,9 +44,7 @@ class SymbolFileNativePDB : public SymbolFile { friend class UdtRecordCompleter; public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -59,9 +57,7 @@ public: static SymbolFile *CreateInstance(ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileNativePDB(ObjectFile *ofile); ~SymbolFileNativePDB() override; @@ -70,9 +66,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h index 48e4aedd83e..2e9d1386d53 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h +++ b/lldb/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h @@ -22,7 +22,6 @@ class PDBSymbolData; } } // namespace llvm -//------------------------------------------------------------------------------ /// Converts a location information from a PDB symbol to a DWARF expression /// /// \param[in] module @@ -40,7 +39,6 @@ class PDBSymbolData; /// /// \return /// The DWARF expression corresponding to the location data of \a symbol. -//------------------------------------------------------------------------------ lldb_private::DWARFExpression ConvertPDBLocationToDWARFExpression(lldb::ModuleSP module, const llvm::pdb::PDBSymbolData &symbol, diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h index 853624e0d5f..ba3099aaec4 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h @@ -23,9 +23,7 @@ class PDBASTParser; class SymbolFilePDB : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -39,9 +37,7 @@ public: static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFilePDB(lldb_private::ObjectFile *ofile); ~SymbolFilePDB() override; @@ -50,9 +46,7 @@ public: void InitializeObject() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp index d593e6313eb..7fa3a1c5d65 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp @@ -64,11 +64,9 @@ uint32_t SymbolFileSymtab::CalculateAbilities() { if (m_obj_file) { const Symtab *symtab = m_obj_file->GetSymtab(); if (symtab) { - //---------------------------------------------------------------------- // The snippet of code below will get the indexes the module symbol table // entries that are code, data, or function related (debug info), sort // them by value (address) and dump the sorted symbols. - //---------------------------------------------------------------------- if (symtab->AppendSymbolIndexesWithType(eSymbolTypeSourceFile, m_source_indexes)) { abilities |= CompileUnits; @@ -261,9 +259,7 @@ uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr, return resolved_flags; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SymbolFileSymtab::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h index f2e90c95451..bc9a531419a 100644 --- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h +++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h @@ -17,16 +17,12 @@ class SymbolFileSymtab : public lldb_private::SymbolFile { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolFileSymtab(lldb_private::ObjectFile *obj_file); ~SymbolFileSymtab() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -40,9 +36,7 @@ public: uint32_t CalculateAbilities() override; - //------------------------------------------------------------------ // Compile Unit function calls - //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; @@ -85,9 +79,7 @@ public: lldb::TypeClass type_mask, lldb_private::TypeList &type_list) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp index fd4925254ea..1efbeab934c 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp @@ -24,15 +24,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // SymbolVendorELF constructor -//---------------------------------------------------------------------- SymbolVendorELF::SymbolVendorELF(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendorELF::~SymbolVendorELF() {} void SymbolVendorELF::Initialize() { @@ -54,13 +50,11 @@ const char *SymbolVendorELF::GetPluginDescriptionStatic() { "executables."; } -//---------------------------------------------------------------------- // CreateInstance // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor * SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { @@ -162,9 +156,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp, return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolVendorELF::GetPluginName() { return GetPluginNameStatic(); } uint32_t SymbolVendorELF::GetPluginVersion() { return 1; } diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h index 60d30218bc5..0cd740da5ce 100644 --- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h +++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h @@ -14,16 +14,12 @@ class SymbolVendorELF : public lldb_private::SymbolVendor { public: - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolVendorELF(const lldb::ModuleSP &module_sp); ~SymbolVendorELF() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -36,9 +32,7 @@ public: CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp index f61c09cd97d..af9ea0af7ad 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp @@ -25,15 +25,11 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // SymbolVendorMacOSX constructor -//---------------------------------------------------------------------- SymbolVendorMacOSX::SymbolVendorMacOSX(const lldb::ModuleSP &module_sp) : SymbolVendor(module_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SymbolVendorMacOSX::~SymbolVendorMacOSX() {} static bool UUIDsMatch(Module *module, ObjectFile *ofile, @@ -90,13 +86,11 @@ const char *SymbolVendorMacOSX::GetPluginDescriptionStatic() { "executables."; } -//---------------------------------------------------------------------- // CreateInstance // // Platforms can register a callback to use when creating symbol vendors to // allow for complex debug information file setups, and to also allow for // finding separate debug information files. -//---------------------------------------------------------------------- SymbolVendor * SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm) { @@ -312,9 +306,7 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp, return symbol_vendor; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ ConstString SymbolVendorMacOSX::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h index 100086bf3e8..01e33ffcce6 100644 --- a/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h +++ b/lldb/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h @@ -14,9 +14,7 @@ class SymbolVendorMacOSX : public lldb_private::SymbolVendor { public: - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -29,16 +27,12 @@ public: CreateInstance(const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm); - //------------------------------------------------------------------ // Constructors and Destructors - //------------------------------------------------------------------ SymbolVendorMacOSX(const lldb::ModuleSP &module_sp); virtual ~SymbolVendorMacOSX(); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ virtual lldb_private::ConstString GetPluginName(); virtual uint32_t GetPluginVersion(); diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h index c9c4282d604..318d674d286 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h @@ -55,7 +55,6 @@ public: : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {} }; - //---------------------------------------------------------- /// Get the information about a work item by calling /// __introspection_dispatch_queue_item_get_info. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -86,7 +85,6 @@ public: /// failure of any kind while getting /// the information, the item_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetItemInfoReturnInfo GetItemInfo(Thread &thread, lldb::addr_t item, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h index 4b59371ad75..0780e3ca555 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h @@ -60,7 +60,6 @@ public: count(0) {} }; - //---------------------------------------------------------- /// Get the list of pending items for a given queue via a call to /// __introspection_dispatch_queue_get_pending_items. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -90,7 +89,6 @@ public: /// failure of any kind while getting /// the information, the items_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetPendingItemsReturnInfo GetPendingItems(Thread &thread, lldb::addr_t queue, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h index e1ff9e0e4e0..bd314f940a3 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h @@ -56,7 +56,6 @@ public: count(0) {} }; - //---------------------------------------------------------- /// Get the list of queues that exist (with any active or pending items) via /// a call to introspection_get_dispatch_queues(). If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -83,7 +82,6 @@ public: /// failure of any kind while getting /// the information, the queues_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetQueuesReturnInfo GetCurrentQueues(Thread &thread, lldb::addr_t page_to_free, uint64_t page_to_free_size, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h index 2c519db06a3..b45314df85b 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h @@ -56,7 +56,6 @@ public: : item_buffer_ptr(LLDB_INVALID_ADDRESS), item_buffer_size(0) {} }; - //---------------------------------------------------------- /// Get the information about a work item by calling /// __introspection_dispatch_thread_get_item_info. If there's a page of /// memory that needs to be freed, pass in the address and size and it will @@ -83,7 +82,6 @@ public: /// failure of any kind while getting /// the information, the item_buffer_ptr value will be /// LLDB_INVALID_ADDRESS. - //---------------------------------------------------------- GetThreadItemInfoReturnInfo GetThreadItemInfo(Thread &thread, lldb::tid_t thread_id, lldb::addr_t page_to_free, diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp index 513bdb3cc5c..6b81ec8d3a7 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -34,11 +34,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // Create an instance of this class. This function is filled into the plugin // info class that gets handed out by the plugin factory and allows the lldb to // instantiate an instance of this class. -//---------------------------------------------------------------------- SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) { bool create = false; if (!create) { @@ -75,9 +73,7 @@ SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) { return NULL; } -//---------------------------------------------------------------------- // Constructor -//---------------------------------------------------------------------- SystemRuntimeMacOSX::SystemRuntimeMacOSX(Process *process) : SystemRuntime(process), m_break_id(LLDB_INVALID_BREAK_ID), m_mutex(), m_get_queues_handler(process), m_get_pending_items_handler(process), @@ -92,9 +88,7 @@ SystemRuntimeMacOSX::SystemRuntimeMacOSX(Process *process) m_dispatch_voucher_offsets_addr(LLDB_INVALID_ADDRESS), m_libdispatch_voucher_offsets() {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SystemRuntimeMacOSX::~SystemRuntimeMacOSX() { Clear(true); } void SystemRuntimeMacOSX::Detach() { @@ -104,9 +98,7 @@ void SystemRuntimeMacOSX::Detach() { m_get_thread_item_info_handler.Detach(); } -//---------------------------------------------------------------------- // Clear out the state of this class. -//---------------------------------------------------------------------- void SystemRuntimeMacOSX::Clear(bool clear_process) { std::lock_guard<std::recursive_mutex> guard(m_mutex); @@ -1012,9 +1004,7 @@ const char *SystemRuntimeMacOSX::GetPluginDescriptionStatic() { return "System runtime plugin for Mac OS X native libraries."; } -//------------------------------------------------------------------ // PluginInterface protocol -//------------------------------------------------------------------ lldb_private::ConstString SystemRuntimeMacOSX::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h index c571bad42dd..d6a18e2f6b0 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -34,9 +34,7 @@ public: ~SystemRuntimeMacOSX() override; - //------------------------------------------------------------------ // Static Functions - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); @@ -48,9 +46,7 @@ public: static lldb_private::SystemRuntime * CreateInstance(lldb_private::Process *process); - //------------------------------------------------------------------ // instance methods - //------------------------------------------------------------------ void Clear(bool clear_process); @@ -101,9 +97,7 @@ public: bool SafeToCallFunctionsOnThisThread(lldb::ThreadSP thread_sp) override; - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp index 53e32586dfa..70c13182183 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -28,9 +28,7 @@ using namespace lldb; using namespace lldb_private; -//----------------------------------------------------------------------------------------------- // UnwindAssemblyInstEmulation method definitions -//----------------------------------------------------------------------------------------------- bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly( AddressRange &range, Thread &thread, UnwindPlan &unwind_plan) { @@ -305,9 +303,7 @@ UnwindAssemblyInstEmulation::CreateInstance(const ArchSpec &arch) { return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol in UnwindAssemblyParser_x86 -//------------------------------------------------------------------ ConstString UnwindAssemblyInstEmulation::GetPluginName() { return GetPluginNameStatic(); } diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h index 704865ce5d0..5232d083321 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -47,9 +47,7 @@ public: static lldb_private::UnwindAssembly * CreateInstance(const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp index d8a820ca6fc..2157855009d 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp @@ -30,9 +30,7 @@ using namespace lldb; using namespace lldb_private; -//----------------------------------------------------------------------------------------------- // UnwindAssemblyParser_x86 method definitions -//----------------------------------------------------------------------------------------------- UnwindAssembly_x86::UnwindAssembly_x86(const ArchSpec &arch) : lldb_private::UnwindAssembly(arch), @@ -244,9 +242,7 @@ UnwindAssembly *UnwindAssembly_x86::CreateInstance(const ArchSpec &arch) { return NULL; } -//------------------------------------------------------------------ // PluginInterface protocol in UnwindAssemblyParser_x86 -//------------------------------------------------------------------ ConstString UnwindAssembly_x86::GetPluginName() { return GetPluginNameStatic(); diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h index ffc8aa63b1b..7c198bbc33a 100644 --- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h @@ -41,9 +41,7 @@ public: static lldb_private::UnwindAssembly * CreateInstance(const lldb_private::ArchSpec &arch); - //------------------------------------------------------------------ // PluginInterface protocol - //------------------------------------------------------------------ static void Initialize(); static void Terminate(); |