Add infallible primitive type lookups to template arg resolver#157289
Add infallible primitive type lookups to template arg resolver#157289Walnut356 wants to merge 1 commit into
Conversation
|
|
| equivalent = f"{arg_name[0]}{target.GetAddressByteSize() * 8}" | ||
| return target.GetBasicType(PRIMITIVE_TYPES[equivalent]) | ||
|
|
||
| if (basic_type := PRIMITIVE_TYPES.get(arg_name)) is not None: |
There was a problem hiding this comment.
Walnut using Walrus, fancy 😆 I assume we don't need to support Python < 3.8? Based on https://discourse.llvm.org/t/rfc-lets-document-and-enforce-a-minimum-python-version-for-lldb/82731/3 it seems like 3.8 should be safe.
There was a problem hiding this comment.
IIRC previously we need Python 3.10 (exactly; and its DLL in PATH on Windows) to even run the setup on Windows MSVC at all.
I'm also 100% fine (and supportive) if we want to set a minimum (or even exact) Python version required to run debuginfo test suite!
There was a problem hiding this comment.
I'll hunt down the link, but I think the minimum as of is 3.11 because they wanted a consistent version between x64 windows and arm windows
There was a problem hiding this comment.
Oh wait, that was just for the python version they build against for the pre-built distributions. In any case, 3.8 should definitely be safe
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