Commit fbc32ba
committed
[lldb][Commands] image lookup: avoid double type lookup into current module
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 only affects `image lookup --all`.
This patch sets `current_module` if we successfully completed a lookup
into it.
Before:
```
(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 {
}"
```
After:
```
(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 parent 24fd343 commit fbc32ba
File tree
2 files changed
+55
-12
lines changed- lldb
- source/Commands
- test/Shell/Commands
2 files changed
+55
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3946 | 3946 | | |
3947 | 3947 | | |
3948 | 3948 | | |
3949 | | - | |
3950 | | - | |
| 3949 | + | |
| 3950 | + | |
3951 | 3951 | | |
3952 | 3952 | | |
3953 | 3953 | | |
3954 | 3954 | | |
3955 | 3955 | | |
3956 | 3956 | | |
3957 | 3957 | | |
3958 | | - | |
| 3958 | + | |
3959 | 3959 | | |
3960 | 3960 | | |
3961 | 3961 | | |
3962 | 3962 | | |
3963 | 3963 | | |
3964 | 3964 | | |
3965 | 3965 | | |
3966 | | - | |
| 3966 | + | |
3967 | 3967 | | |
3968 | 3968 | | |
3969 | 3969 | | |
3970 | 3970 | | |
3971 | | - | |
| 3971 | + | |
3972 | 3972 | | |
3973 | 3973 | | |
3974 | 3974 | | |
3975 | | - | |
| 3975 | + | |
3976 | 3976 | | |
3977 | 3977 | | |
3978 | 3978 | | |
3979 | 3979 | | |
3980 | 3980 | | |
3981 | 3981 | | |
3982 | | - | |
| 3982 | + | |
3983 | 3983 | | |
3984 | 3984 | | |
3985 | 3985 | | |
3986 | 3986 | | |
3987 | 3987 | | |
3988 | | - | |
| 3988 | + | |
3989 | 3989 | | |
3990 | 3990 | | |
3991 | 3991 | | |
| |||
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
4089 | | - | |
4090 | | - | |
4091 | 4089 | | |
4092 | 4090 | | |
4093 | 4091 | | |
4094 | | - | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
4095 | 4095 | | |
4096 | 4096 | | |
4097 | 4097 | | |
| |||
4110 | 4110 | | |
4111 | 4111 | | |
4112 | 4112 | | |
4113 | | - | |
| 4113 | + | |
4114 | 4114 | | |
4115 | 4115 | | |
4116 | 4116 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments