Skip to content

Commit b232b11

Browse files
committed
Fix debugger tests
1 parent 176a618 commit b232b11

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/etc/gdb_providers.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
def unwrap_unique_or_non_null(unique_or_nonnull):
1313
# BACKCOMPAT: rust 1.32
1414
# https://github.com/rust-lang/rust/commit/7a0911528058e87d22ea305695f4047572c5e067
15+
# BACKCOMPAT: rust 1.60
16+
# https://github.com/rust-lang/rust/commit/2a91eeac1a2d27dd3de1bf55515d765da20fd86f
1517
ptr = unique_or_nonnull["pointer"]
16-
return ptr if ptr.type.code == gdb.TYPE_CODE_PTR else ptr[ZERO_FIELD]
18+
return ptr if ptr.type.code == gdb.TYPE_CODE_PTR else ptr[ptr.type.fields()[0]]
1719

1820

1921
class EnumProvider:

src/etc/lldb_providers.py

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ def from_uint(self, name, value):
6363
def unwrap_unique_or_non_null(unique_or_nonnull):
6464
# BACKCOMPAT: rust 1.32
6565
# https://github.com/rust-lang/rust/commit/7a0911528058e87d22ea305695f4047572c5e067
66+
# BACKCOMPAT: rust 1.60
67+
# https://github.com/rust-lang/rust/commit/2a91eeac1a2d27dd3de1bf55515d765da20fd86f
6668
ptr = unique_or_nonnull.GetChildMemberWithName("pointer")
6769
return ptr if ptr.TypeIsPointerType() else ptr.GetChildAtIndex(0)
6870

@@ -268,7 +270,9 @@ class StdVecSyntheticProvider:
268270
struct RawVec<T> { ptr: Unique<T>, cap: usize, ... }
269271
rust 1.31.1: struct Unique<T: ?Sized> { pointer: NonZero<*const T>, ... }
270272
rust 1.33.0: struct Unique<T: ?Sized> { pointer: *const T, ... }
273+
rust 1.62.0: struct Unique<T: ?Sized> { pointer: NonNull<T>, ... }
271274
struct NonZero<T>(T)
275+
struct NonNull<T> { pointer: *const T }
272276
"""
273277

274278
def __init__(self, valobj, dict):

0 commit comments

Comments
 (0)