Rollup merge of #81834 - ortem:fix-LLDB-hashmap-pretty-printers, r=Mark-Simulacrum

Resolve typedef in HashMap lldb pretty-printer only if possible

Fixes https://github.com/rust-lang/rust/issues/81814

Previously, `GetTypedefedType` was invoked unconditionally.
But this did not work in case of `rust-lldb` without Rust patches since there was no typedef.
This commit is contained in:
Dylan DPC 2021-02-09 02:39:55 +01:00 committed by GitHub
commit 1652759581
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -531,7 +531,9 @@ class StdHashMapSyntheticProvider:
ctrl = table.GetChildMemberWithName("ctrl").GetChildAtIndex(0)
self.size = table.GetChildMemberWithName("items").GetValueAsUnsigned()
self.pair_type = table.type.template_args[0].GetTypedefedType()
self.pair_type = table.type.template_args[0]
if self.pair_type.IsTypedefType():
self.pair_type = self.pair_type.GetTypedefedType()
self.pair_type_size = self.pair_type.GetByteSize()
self.new_layout = not table.GetChildMemberWithName("data").IsValid()