aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2025-07-03 10:28:49 +0100
committerGitHub <noreply@github.com>2025-07-03 10:28:49 +0100
commit4017dc06e3b5c4b97d8b1089070f88363e0db6f0 (patch)
tree62ec164909d816700edc8e25dfcf863ceccb2a30 /lldb/source/Commands/CommandObjectTarget.cpp
parent58d84a615e9180eeff583a9d30033ba21343550d (diff)
downloadllvm-4017dc06e3b5c4b97d8b1089070f88363e0db6f0.zip
llvm-4017dc06e3b5c4b97d8b1089070f88363e0db6f0.tar.gz
llvm-4017dc06e3b5c4b97d8b1089070f88363e0db6f0.tar.bz2
[lldb][Commands][NFC] image lookup: remove unused local variable (#146554)
The `current_module` pointer here was never set, but we check it when looping over the `target_modules` list. Presumably the intention was to avoid calling `LookupInModule` if we already found the type in the current module. This patch removes this `current_module`. If we decide the output below is not what the user should see, we can revisit the implementation. Current output: ``` (lldb) im loo -vt Foo --all Best match found in /Users/jonas/Git/llvm-worktrees/llvm-project/a.out: id = {0x00000037}, name = "Foo", byte-size = 1, decl = foo.cpp:1, compiler_type = "struct Foo { }" 1 match found in /Users/jonas/Git/llvm-worktrees/llvm-project/a.out: id = {0x00000037}, name = "Foo", byte-size = 1, decl = foo.cpp:1, compiler_type = "struct Foo { }" ``` which seems fine. Note, there can be multiple matches *within* the current module, so if we did the naive thing of skipping the `current_module` when printing with `--all`, then we would miss some matches.
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index a4ced37..fe421ad 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -4086,8 +4086,6 @@ protected:
// Dump all sections for all modules images
if (command.GetArgumentCount() == 0) {
- ModuleSP current_module;
-
// Where it is possible to look in the current symbol context first,
// try that. If this search was successful and --all was not passed,
// don't print anything else.
@@ -4110,8 +4108,7 @@ protected:
}
for (ModuleSP module_sp : target_modules.ModulesNoLocking()) {
- if (module_sp != current_module &&
- LookupInModule(m_interpreter, module_sp.get(), result,
+ if (LookupInModule(m_interpreter, module_sp.get(), result,
syntax_error)) {
result.GetOutputStream().EOL();
num_successful_lookups++;