[Lldb-commits] [lldb] [AIX] 1. Avoid namespace collision on other platforms (PR #104679)
https://github.com/DhruvSrivastavaX closed https://github.com/llvm/llvm-project/pull/104679 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [AIX] 1. Avoid namespace collision on other platforms (PR #104679)
https://github.com/DhruvSrivastavaX reopened https://github.com/llvm/llvm-project/pull/104679 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] show dialog when executable is not found (PR #104711)
https://github.com/Da-Viper created https://github.com/llvm/llvm-project/pull/104711 Fixes #103043 >From 0b84d36d320a58a13ca98bd1b1c186c72bbe63e2 Mon Sep 17 00:00:00 2001 From: Ezike Ebuka Date: Sun, 18 Aug 2024 15:26:11 +0100 Subject: [PATCH] [lldb-dap] vscode now shows a dialog when the dab-executable is not found --- lldb/tools/lldb-dap/src-ts/extension.ts | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/lldb/tools/lldb-dap/src-ts/extension.ts b/lldb/tools/lldb-dap/src-ts/extension.ts index 791175f7b46224..c7802eed2a513b 100644 --- a/lldb/tools/lldb-dap/src-ts/extension.ts +++ b/lldb/tools/lldb-dap/src-ts/extension.ts @@ -1,4 +1,5 @@ import * as vscode from "vscode"; +import * as fs from "node:fs/promises"; import { LLDBDapOptions } from "./types"; import { DisposableContext } from "./disposable-context"; import { LLDBDapDescriptorFactory } from "./debug-adapter-factory"; @@ -17,10 +18,32 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions { const path = vscode.workspace .getConfiguration("lldb-dap", session.workspaceFolder) .get("executable-path"); - if (path) { -return new vscode.DebugAdapterExecutable(path, []); + + if (!path) { +return packageJSONExecutable; + } + + try { +const fileStats = await fs.stat(path); +if (!fileStats.isFile()) { + throw new Error(`Error: ${path} is not a file`); +} + } catch (err) { +const error: Error = err as Error; +const openSettingsAction = "Open Settings"; +const callBackValue = await vscode.window.showErrorMessage( + error.message, + { modal: true }, + openSettingsAction, +); +if (openSettingsAction === callBackValue) { + vscode.commands.executeCommand( +"workbench.action.openSettings", +"lldb-dap.executable-path", + ); +} } - return packageJSONExecutable; + return new vscode.DebugAdapterExecutable(path, []); }, }; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] show dialog when executable is not found (PR #104711)
llvmbot wrote: @llvm/pr-subscribers-lldb Author: None (Da-Viper) Changes Fixes #103043 --- Full diff: https://github.com/llvm/llvm-project/pull/104711.diff 1 Files Affected: - (modified) lldb/tools/lldb-dap/src-ts/extension.ts (+26-3) ``diff diff --git a/lldb/tools/lldb-dap/src-ts/extension.ts b/lldb/tools/lldb-dap/src-ts/extension.ts index 791175f7b46224..c7802eed2a513b 100644 --- a/lldb/tools/lldb-dap/src-ts/extension.ts +++ b/lldb/tools/lldb-dap/src-ts/extension.ts @@ -1,4 +1,5 @@ import * as vscode from "vscode"; +import * as fs from "node:fs/promises"; import { LLDBDapOptions } from "./types"; import { DisposableContext } from "./disposable-context"; import { LLDBDapDescriptorFactory } from "./debug-adapter-factory"; @@ -17,10 +18,32 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions { const path = vscode.workspace .getConfiguration("lldb-dap", session.workspaceFolder) .get("executable-path"); - if (path) { -return new vscode.DebugAdapterExecutable(path, []); + + if (!path) { +return packageJSONExecutable; + } + + try { +const fileStats = await fs.stat(path); +if (!fileStats.isFile()) { + throw new Error(`Error: ${path} is not a file`); +} + } catch (err) { +const error: Error = err as Error; +const openSettingsAction = "Open Settings"; +const callBackValue = await vscode.window.showErrorMessage( + error.message, + { modal: true }, + openSettingsAction, +); +if (openSettingsAction === callBackValue) { + vscode.commands.executeCommand( +"workbench.action.openSettings", +"lldb-dap.executable-path", + ); +} } - return packageJSONExecutable; + return new vscode.DebugAdapterExecutable(path, []); }, }; } `` https://github.com/llvm/llvm-project/pull/104711 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..9b45334fb65a15 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a844740..171850e59baa3 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f850..66622b5c15f7c 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf959..9b45334fb65a1 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search_hint-
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..9b45334fb65a15 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a844740..171850e59baa3 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f850..66622b5c15f7c 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf959..9b45334fb65a1 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search_hint-
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a844740..171850e59baa3 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f850..66622b5c15f7c 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf959..9b45334fb65a1 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search_hint-
[Lldb-commits] [lldb] [lldb-dap] show dialog when executable is not found (PR #104711)
@@ -17,10 +18,32 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions { const path = vscode.workspace .getConfiguration("lldb-dap", session.workspaceFolder) .get("executable-path"); - if (path) { -return new vscode.DebugAdapterExecutable(path, []); + + if (!path) { +return packageJSONExecutable; + } + + try { +const fileStats = await fs.stat(path); +if (!fileStats.isFile()) { JDevlieghere wrote: I assume this will fail if the file is a symlink? Should this be ``` if (!fileStats.isFile() && !fileStats.isSymbolicLink())) ``` https://github.com/llvm/llvm-project/pull/104711 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..9b45334fb65a15 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..9b45334fb65a15 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c0b9be1b4ef436bbf79bd3877a58e6b598b19940 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH 1/2] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 + lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 68 + lldb/source/Expression/IRExecutionUnit.cpp | 55 + lldb/source/Symbol/Symbol.cpp | 8 +++ lldb/source/Symbol/SymbolContext.cpp | 71 ++ 6 files changed, 197 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..9b45334fb65a15 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,41 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + auto hinted_module = search_hint ? search
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
https://github.com/DmT021 updated https://github.com/llvm/llvm-project/pull/102835 >From c647b26ad534bb998063722f930ddd07162bfee7 Mon Sep 17 00:00:00 2001 From: Dmitrii Galimzianov Date: Sun, 18 Aug 2024 04:36:19 +0200 Subject: [PATCH] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols --- lldb/include/lldb/Core/ModuleList.h| 43 lldb/include/lldb/Symbol/SymbolContext.h | 2 +- lldb/source/Core/ModuleList.cpp| 80 ++ lldb/source/Expression/IRExecutionUnit.cpp | 55 --- lldb/source/Symbol/SymbolContext.cpp | 71 --- 5 files changed, 201 insertions(+), 50 deletions(-) diff --git a/lldb/include/lldb/Core/ModuleList.h b/lldb/include/lldb/Core/ModuleList.h index 43d931a8447406..171850e59baa35 100644 --- a/lldb/include/lldb/Core/ModuleList.h +++ b/lldb/include/lldb/Core/ModuleList.h @@ -287,6 +287,24 @@ class ModuleList { const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const; + /// \see Module::FindFunctions () + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, + const ModuleFunctionSearchOptions &options, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + /// \see Module::FindFunctionSymbols () void FindFunctionSymbols(ConstString name, lldb::FunctionNameType name_type_mask, @@ -357,6 +375,31 @@ class ModuleList { lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; + /// Find symbols by name and SymbolType. + /// + /// \param[in] name + /// A name of the symbol we are looking for. + /// + /// \param[in] symbol_type + /// A SymbolType the symbol we are looking for. + /// + /// \param[in] search_hint + /// If the value is NULL, then all modules will be searched in + /// order. If the value is a valid pointer and if a module is specified in + /// the symbol context, that module will be searched first followed by all + /// other modules in the list. + /// + /// \param[in] partial_result_handler + /// A callback that will be called for each module in which at least one + /// match was found. + void FindSymbolsWithNameAndType(ConstString name, + lldb::SymbolType symbol_type, + const SymbolContext *search_hint, + llvm::function_ref + partial_result_handler) const; + void FindSymbolsMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const; diff --git a/lldb/include/lldb/Symbol/SymbolContext.h b/lldb/include/lldb/Symbol/SymbolContext.h index 0bc707070f8504..66622b5c15f7c9 100644 --- a/lldb/include/lldb/Symbol/SymbolContext.h +++ b/lldb/include/lldb/Symbol/SymbolContext.h @@ -471,7 +471,7 @@ class SymbolContextList { typedef AdaptedIterable SymbolContextIterable; - SymbolContextIterable SymbolContexts() { + SymbolContextIterable SymbolContexts() const { return SymbolContextIterable(m_symbol_contexts); } }; diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index b03490bacf9593..f190679fcdf7c9 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -466,6 +466,48 @@ void ModuleList::FindFunctions(ConstString name, } } +void ModuleList::FindFunctions( +ConstString name, lldb::FunctionNameType name_type_mask, +const ModuleFunctionSearchOptions &options, +const SymbolContext *search_hint, +llvm::function_ref +partial_result_handler) const { + SymbolContextList sc_list_partial{}; + auto FindInModule = [&](const ModuleSP &module) { +if (!module) + return IterationAction::Continue; +module->FindFunctions(name, CompilerDeclContext(), name_type_mask, options, + sc_list_partial); +if (!sc_list_partial.IsEmpty()) { + auto iteration_action = partial_result_handler(module, sc_list_partial); + sc_list_partial.Clear(); + return iteration_action; +} +return IterationAction::Continue; + }; + + std::vector modules_copy; + { +std::loc
[Lldb-commits] [lldb] Remove redundant symbol lookups in IRExecutionUnit::FindInSymbols (PR #102835)
DmT021 wrote: On CI Linux builds some tests timed out. Probably deadlock, but I couldn't find where exactly. We now call an arbitrary function in Find* functions while the mutex is locked. I think LoadAddressResolver calls something that leads to deadlock. Although it's strange, because we use recursive_mutex in ModuleList. Had to make a defensive copy of the module vector in ModuleList. https://github.com/llvm/llvm-project/pull/102835 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] show dialog when executable is not found (PR #104711)
https://github.com/Da-Viper updated https://github.com/llvm/llvm-project/pull/104711 >From 0b84d36d320a58a13ca98bd1b1c186c72bbe63e2 Mon Sep 17 00:00:00 2001 From: Ezike Ebuka Date: Sun, 18 Aug 2024 15:26:11 +0100 Subject: [PATCH 1/2] [lldb-dap] vscode now shows a dialog when the dab-executable is not found --- lldb/tools/lldb-dap/src-ts/extension.ts | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/lldb/tools/lldb-dap/src-ts/extension.ts b/lldb/tools/lldb-dap/src-ts/extension.ts index 791175f7b46224..c7802eed2a513b 100644 --- a/lldb/tools/lldb-dap/src-ts/extension.ts +++ b/lldb/tools/lldb-dap/src-ts/extension.ts @@ -1,4 +1,5 @@ import * as vscode from "vscode"; +import * as fs from "node:fs/promises"; import { LLDBDapOptions } from "./types"; import { DisposableContext } from "./disposable-context"; import { LLDBDapDescriptorFactory } from "./debug-adapter-factory"; @@ -17,10 +18,32 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions { const path = vscode.workspace .getConfiguration("lldb-dap", session.workspaceFolder) .get("executable-path"); - if (path) { -return new vscode.DebugAdapterExecutable(path, []); + + if (!path) { +return packageJSONExecutable; + } + + try { +const fileStats = await fs.stat(path); +if (!fileStats.isFile()) { + throw new Error(`Error: ${path} is not a file`); +} + } catch (err) { +const error: Error = err as Error; +const openSettingsAction = "Open Settings"; +const callBackValue = await vscode.window.showErrorMessage( + error.message, + { modal: true }, + openSettingsAction, +); +if (openSettingsAction === callBackValue) { + vscode.commands.executeCommand( +"workbench.action.openSettings", +"lldb-dap.executable-path", + ); +} } - return packageJSONExecutable; + return new vscode.DebugAdapterExecutable(path, []); }, }; } >From 2eca3822a8ba5f1a329e459176003a30de40c683 Mon Sep 17 00:00:00 2001 From: Ezike Ebuka Date: Sun, 18 Aug 2024 23:25:00 +0100 Subject: [PATCH 2/2] [lldb-dap] handle symbolic link --- lldb/tools/lldb-dap/src-ts/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/tools/lldb-dap/src-ts/extension.ts b/lldb/tools/lldb-dap/src-ts/extension.ts index c7802eed2a513b..7bc380a73bd443 100644 --- a/lldb/tools/lldb-dap/src-ts/extension.ts +++ b/lldb/tools/lldb-dap/src-ts/extension.ts @@ -25,7 +25,7 @@ function createDefaultLLDBDapOptions(): LLDBDapOptions { try { const fileStats = await fs.stat(path); -if (!fileStats.isFile()) { +if (!fileStats.isFile() && !fileStats.isSymbolicLink()) { throw new Error(`Error: ${path} is not a file`); } } catch (err) { ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb-dap] show dialog when executable is not found (PR #104711)
https://github.com/JDevlieghere approved this pull request. I'm not a TS expert but functionally this is a great improvement. LGTM. https://github.com/llvm/llvm-project/pull/104711 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add an assert to verify sign_bit_pos is within the valid range (NFC) (PR #95678)
https://github.com/xgupta closed https://github.com/llvm/llvm-project/pull/95678 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Add an assert to verify sign_bit_pos is within the valid range (NFC) (PR #95678)
xgupta wrote: I think it would be fine not to merge this PR. Asserts are recommended in the LLDB source code. I will close the PR. https://github.com/llvm/llvm-project/pull/95678 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Adjust the for loop condition to prevent unintended increments in ExpandRLE (NFC) (PR #94844)
xgupta wrote: ping! https://github.com/llvm/llvm-project/pull/94844 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [clang] [lldb] [clang][AST] fix ast-print of extern with >=2 declarators, fixed, fixed (PR #98795)
temyurchenko wrote: > Ping @JDevlieghere for lldb test suite assistance. > > As for ORC JIT, [the compiler-rt project](https://compiler-rt.llvm.org/) does > not claim to support Windows to begin with, so it's unclear whether the bot > should not be testing on Windows or whether compiler-rt needs to update their > support claims. CC @vitalybuka for more opinions/help on this one (my > preference is for Windows to be a first-class citizen with compiler-rt, but > if nobody is willing to do the maintenance work, we should not let bots > failing when testing compiler-rt on Windows be a blocking concern). Pinging @vitalybuka. https://github.com/llvm/llvm-project/pull/98795 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] Reland "[lldb] Reland 2402b3213c2f with `/H` to debug the windows build issue (PR #101672)
medismailben wrote: > Okay, that sort of makes sense. However, unless you actually want to be able > to disable each of these plugins independently (which it sounds like you > don't), then this is a very.. baroque way to achieve the desired effect (to > have multiple (plugin) classes registered with the plugin manager). > > All of that cmake plugin logic is just a very elaborate way to invoke > `SomeClass::Initialize()`. Plugins are registered through > `PluginManager::RegisterPlugin`. While the usual case is that the > `Initialize` function performs a single `RegisterPlugin` call (and pretty > much nothing else), nothing actually depends or enforces that, and we do have > "plugins" where a single plugin library registers more than plugin class > (e.g. `lldbPluginPlatformMacOSX`). I think it would be perfectly reasonable > to register all of these classes from > `ScriptInterpreterPythonInterfaces::Initialize` (and maybe even from > `ScriptInterpreterPython::Initialize`). I was on vacation last week, I try to give a stab a this tomorrow, thanks for the suggestions :) https://github.com/llvm/llvm-project/pull/101672 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits