[Lldb-commits] [lldb] [lldb][Wasm] Handle imports when parsing Wasm name sections (PR #170960)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 5 17:13:45 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
index 198223957..b3fb38242 100644
--- a/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
+++ b/lldb/source/Plugins/ObjectFile/wasm/ObjectFileWasm.cpp
@@ -307,8 +307,7 @@ struct WasmFunction {
uint32_t size = 0;
};
-static llvm::Expected<uint32_t>
-ParseImports(DataExtractor &import_data) {
+static llvm::Expected<uint32_t> ParseImports(DataExtractor &import_data) {
// Currently this function just returns the number of imported functions.
// If we want to do anything with global names in the future, we'll also
// need to know those.
@@ -447,7 +446,8 @@ static llvm::Expected<std::vector<WasmSegment>> ParseData(DataExtractor &data) {
static llvm::Expected<std::vector<Symbol>>
ParseNames(SectionSP code_section_sp, DataExtractor &name_data,
const std::vector<WasmFunction> &functions,
- std::vector<WasmSegment> &segments, uint32_t num_imported_functions) {
+ std::vector<WasmSegment> &segments,
+ uint32_t num_imported_functions) {
llvm::DataExtractor data = name_data.GetAsLLVM();
llvm::DataExtractor::Cursor c(0);
@@ -475,26 +475,24 @@ ParseNames(SectionSP code_section_sp, DataExtractor &name_data,
continue;
if (*idx < num_imported_functions) {
- symbols.emplace_back(
- symbols.size(), *name, lldb::eSymbolTypeCode,
- /*external=*/true, /*is_debug=*/false,
- /*is_trampoline=*/false,
- /*is_artificial=*/false,
- /*section_sp=*/lldb::SectionSP(),
- /*value=*/0, /*size=*/0,
- /*size_is_valid=*/false,
- /*contains_linker_annotations=*/false,
- /*flags=*/0);
+ symbols.emplace_back(symbols.size(), *name, lldb::eSymbolTypeCode,
+ /*external=*/true, /*is_debug=*/false,
+ /*is_trampoline=*/false,
+ /*is_artificial=*/false,
+ /*section_sp=*/lldb::SectionSP(),
+ /*value=*/0, /*size=*/0,
+ /*size_is_valid=*/false,
+ /*contains_linker_annotations=*/false,
+ /*flags=*/0);
} else {
const WasmFunction &func = functions[*idx - num_imported_functions];
- symbols.emplace_back(
- symbols.size(), *name, lldb::eSymbolTypeCode,
- /*external=*/false, /*is_debug=*/false,
- /*is_trampoline=*/false, /*is_artificial=*/false,
- code_section_sp, func.section_offset, func.size,
- /*size_is_valid=*/true,
- /*contains_linker_annotations=*/false,
- /*flags=*/0);
+ symbols.emplace_back(symbols.size(), *name, lldb::eSymbolTypeCode,
+ /*external=*/false, /*is_debug=*/false,
+ /*is_trampoline=*/false, /*is_artificial=*/false,
+ code_section_sp, func.section_offset, func.size,
+ /*size_is_valid=*/true,
+ /*contains_linker_annotations=*/false,
+ /*flags=*/0);
}
}
} break;
``````````
</details>
https://github.com/llvm/llvm-project/pull/170960
More information about the lldb-commits
mailing list