about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2022-04-13 20:57:31 +0200
committerEduardo Sánchez Muñoz <eduardosm-dev@e64.io>2022-04-14 19:37:39 +0200
commitb232b11ba522d8fb1484fdc925f64871d55d5a5a (patch)
tree75c61e28d2ab9c316ca627764077dec12700f3b5
parent176a6182420eab2b8fc9c706b34a4574a927e1f3 (diff)
downloadrust-b232b11ba522d8fb1484fdc925f64871d55d5a5a.tar.gz
rust-b232b11ba522d8fb1484fdc925f64871d55d5a5a.zip
Fix debugger tests
-rw-r--r--src/etc/gdb_providers.py4
-rw-r--r--src/etc/lldb_providers.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/src/etc/gdb_providers.py b/src/etc/gdb_providers.py
index 33d26db547e..0a52b8c976f 100644
--- a/src/etc/gdb_providers.py
+++ b/src/etc/gdb_providers.py
@@ -12,8 +12,10 @@ FIRST_FIELD = "__1"
 def unwrap_unique_or_non_null(unique_or_nonnull):
     # BACKCOMPAT: rust 1.32
     # https://github.com/rust-lang/rust/commit/7a0911528058e87d22ea305695f4047572c5e067
+    # BACKCOMPAT: rust 1.60
+    # https://github.com/rust-lang/rust/commit/2a91eeac1a2d27dd3de1bf55515d765da20fd86f
     ptr = unique_or_nonnull["pointer"]
-    return ptr if ptr.type.code == gdb.TYPE_CODE_PTR else ptr[ZERO_FIELD]
+    return ptr if ptr.type.code == gdb.TYPE_CODE_PTR else ptr[ptr.type.fields()[0]]
 
 
 class EnumProvider:
diff --git a/src/etc/lldb_providers.py b/src/etc/lldb_providers.py
index 86dcc335e3c..35ac07f0db7 100644
--- a/src/etc/lldb_providers.py
+++ b/src/etc/lldb_providers.py
@@ -63,6 +63,8 @@ class ValueBuilder:
 def unwrap_unique_or_non_null(unique_or_nonnull):
     # BACKCOMPAT: rust 1.32
     # https://github.com/rust-lang/rust/commit/7a0911528058e87d22ea305695f4047572c5e067
+    # BACKCOMPAT: rust 1.60
+    # https://github.com/rust-lang/rust/commit/2a91eeac1a2d27dd3de1bf55515d765da20fd86f
     ptr = unique_or_nonnull.GetChildMemberWithName("pointer")
     return ptr if ptr.TypeIsPointerType() else ptr.GetChildAtIndex(0)
 
@@ -268,7 +270,9 @@ class StdVecSyntheticProvider:
     struct RawVec<T> { ptr: Unique<T>, cap: usize, ... }
     rust 1.31.1: struct Unique<T: ?Sized> { pointer: NonZero<*const T>, ... }
     rust 1.33.0: struct Unique<T: ?Sized> { pointer: *const T, ... }
+    rust 1.62.0: struct Unique<T: ?Sized> { pointer: NonNull<T>, ... }
     struct NonZero<T>(T)
+    struct NonNull<T> { pointer: *const T }
     """
 
     def __init__(self, valobj, dict):