Add infallible primitive type lookups to template arg resolver#157289
Add infallible primitive type lookups to template arg resolver#157289Walnut356 wants to merge 2 commits into
Conversation
|
|
There was a problem hiding this comment.
Thanks, this indeed improves the output for me locally (msvc, lldb 22).
Test case
Used a tiny test case
//@ compile-flags: -g
//@ lldb-command: run
//@ lldb-command: v vec_0
//@ lldb-check: [...] vec_0 { }
//@ lldb-command: continue
fn main() {
let vec_0 = vec![1, 2, 3];
vec_0; // #break
}
I do indeed observe the fixed ouput 👍
v vec_0
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_0 = size=3 { [0] = 1 [1] = 2 [2] = 3 }
Other remarks
Looks like the package change meant that lldb_batchmode/runner.py need to update the path in which breakpoint_callback is referenced (as discussed),
diff --git a/src/etc/lldb_batchmode/runner.py b/src/etc/lldb_batchmode/runner.py
index e9b106390f6..bdeee3f3458 100644
--- a/src/etc/lldb_batchmode/runner.py
+++ b/src/etc/lldb_batchmode/runner.py
@@ -98,7 +98,7 @@ def execute_command(command_interpreter, command):
"registering breakpoint callback, id = " + str(breakpoint_id)
)
callback_command = f"breakpoint command add -s python {str(breakpoint_id)} -o \
- 'import lldb_batchmode; lldb_batchmode.breakpoint_callback'"
+ 'import lldb_batchmode; lldb_batchmode.runner.breakpoint_callback'"
command_interpreter.HandleCommand(callback_command, res)
if res.Succeeded():We can just roll this into this PR, you can r=me after.
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
There was a problem hiding this comment.
This comment has been minimized.
This comment has been minimized.
|
This pull request was unapproved due to being closed. |
|
@bors r+ |
…eyouxu
Add infallible primitive type lookups to template arg resolver
Fixes a regression that seem to come from LLDB 22 where looking up primitive types by name on MSVC no longer works. Container types use type name lookups to resolve generics, so it causes container types (e.g. `Vec<i32>`) to fail to create their child values.
Before:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {}
(lldb) v vec_v[0]
error: <user expression 0>:1:6: array index 0 is not valid for "(Vec<i32,alloc::alloc::Global>) vec_v"
1 | vec_v[0]
| ^
```
After:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {
[0] = 10
[1] = 20
[2] = 30
[3] = 40
[4] = 50
}
(lldb) v vec_v[0]
(long) vec_v[0] = 10
```
This patch maps the type name to its `eBasicType` equivalent (i.e. the LLDB enum for primitive types) and looks up the type based on that. AFAIK, `eBasicType` lookups are 100% infallible. Even if the primitive type somehow isn't in the debug info, `TypeSystemClang` will invent the appropriate `SBType` object for it.
This isn't a major blocker for the test suite rework, but it does prevent me from blessing tests with container types on MSVC unless I downgrade to LLDB 21.
r? @jieyouxu, @Kobzol
|
Probably this pr? |
|
This pull request was unapproved. This PR was contained in a rollup (#157528), which was unapproved. |
This comment has been minimized.
This comment has been minimized.
Add infallible primitive type lookups to template arg resolver try-job: aarch64-apple
|
💔 Test for 824b465 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
LLDB versioning strikes again =) |
bde0008 to
c6945a5
Compare
|
should be good now, just gated the import behind a feature flag. |
|
@bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
Add infallible primitive type lookups to template arg resolver try-job: aarch64-apple
|
@bors r+ |
|
@bors rollup=iffy |
…eyouxu
Add infallible primitive type lookups to template arg resolver
Fixes a regression that seem to come from LLDB 22 where looking up primitive types by name on MSVC no longer works. Container types use type name lookups to resolve generics, so it causes container types (e.g. `Vec<i32>`) to fail to create their child values.
Before:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {}
(lldb) v vec_v[0]
error: <user expression 0>:1:6: array index 0 is not valid for "(Vec<i32,alloc::alloc::Global>) vec_v"
1 | vec_v[0]
| ^
```
After:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {
[0] = 10
[1] = 20
[2] = 30
[3] = 40
[4] = 50
}
(lldb) v vec_v[0]
(long) vec_v[0] = 10
```
This patch maps the type name to its `eBasicType` equivalent (i.e. the LLDB enum for primitive types) and looks up the type based on that. AFAIK, `eBasicType` lookups are 100% infallible. Even if the primitive type somehow isn't in the debug info, `TypeSystemClang` will invent the appropriate `SBType` object for it.
This isn't a major blocker for the test suite rework, but it does prevent me from blessing tests with container types on MSVC unless I downgrade to LLDB 21.
r? @jieyouxu, @Kobzol
…eyouxu
Add infallible primitive type lookups to template arg resolver
Fixes a regression that seem to come from LLDB 22 where looking up primitive types by name on MSVC no longer works. Container types use type name lookups to resolve generics, so it causes container types (e.g. `Vec<i32>`) to fail to create their child values.
Before:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {}
(lldb) v vec_v[0]
error: <user expression 0>:1:6: array index 0 is not valid for "(Vec<i32,alloc::alloc::Global>) vec_v"
1 | vec_v[0]
| ^
```
After:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {
[0] = 10
[1] = 20
[2] = 30
[3] = 40
[4] = 50
}
(lldb) v vec_v[0]
(long) vec_v[0] = 10
```
This patch maps the type name to its `eBasicType` equivalent (i.e. the LLDB enum for primitive types) and looks up the type based on that. AFAIK, `eBasicType` lookups are 100% infallible. Even if the primitive type somehow isn't in the debug info, `TypeSystemClang` will invent the appropriate `SBType` object for it.
This isn't a major blocker for the test suite rework, but it does prevent me from blessing tests with container types on MSVC unless I downgrade to LLDB 21.
r? @jieyouxu, @Kobzol
…eyouxu
Add infallible primitive type lookups to template arg resolver
Fixes a regression that seem to come from LLDB 22 where looking up primitive types by name on MSVC no longer works. Container types use type name lookups to resolve generics, so it causes container types (e.g. `Vec<i32>`) to fail to create their child values.
Before:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {}
(lldb) v vec_v[0]
error: <user expression 0>:1:6: array index 0 is not valid for "(Vec<i32,alloc::alloc::Global>) vec_v"
1 | vec_v[0]
| ^
```
After:
```
(lldb) v vec_v
(alloc::vec::Vec<i32,alloc::alloc::Global>) vec_v = size=5 {
[0] = 10
[1] = 20
[2] = 30
[3] = 40
[4] = 50
}
(lldb) v vec_v[0]
(long) vec_v[0] = 10
```
This patch maps the type name to its `eBasicType` equivalent (i.e. the LLDB enum for primitive types) and looks up the type based on that. AFAIK, `eBasicType` lookups are 100% infallible. Even if the primitive type somehow isn't in the debug info, `TypeSystemClang` will invent the appropriate `SBType` object for it.
This isn't a major blocker for the test suite rework, but it does prevent me from blessing tests with container types on MSVC unless I downgrade to LLDB 21.
r? @jieyouxu, @Kobzol
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
View all comments
Fixes a regression that seem to come from LLDB 22 where looking up primitive types by name on MSVC no longer works. Container types use type name lookups to resolve generics, so it causes container types (e.g.
Vec<i32>) to fail to create their child values.Before:
After:
This patch maps the type name to its
eBasicTypeequivalent (i.e. the LLDB enum for primitive types) and looks up the type based on that. AFAIK,eBasicTypelookups are 100% infallible. Even if the primitive type somehow isn't in the debug info,TypeSystemClangwill invent the appropriateSBTypeobject for it.This isn't a major blocker for the test suite rework, but it does prevent me from blessing tests with container types on MSVC unless I downgrade to LLDB 21.
r? @jieyouxu, @Kobzol