about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-02-09 02:39:55 +0100
committerGitHub <noreply@github.com>2021-02-09 02:39:55 +0100
commit1652759581515aedce741a41fecc9184240678a7 (patch)
treef21adaf89f920a0aca019e8669af6c38a609b886
parentd19f37541c0b3df1e2c1d629e03745198f816b47 (diff)
parent9ce070d27ddbbae3004dd7af6ac6fca59c8b2e23 (diff)
downloadrust-1652759581515aedce741a41fecc9184240678a7.tar.gz
rust-1652759581515aedce741a41fecc9184240678a7.zip
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.
-rw-r--r--src/etc/lldb_providers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py
index 9c7b07efbaa..ca2685ca31f 100644
--- a/src/etc/lldb_providers.py
+++ b/src/etc/lldb_providers.py
@@ -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()