@@ -19,8 +19,10 @@ extern uintptr_t
1919extern uintptr_t
2020 nodedbg_offset_Environment__req_wrap_queue___Environment_ReqWrapQueue;
2121extern uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
22+ extern uintptr_t nodedbg_offset_ListNode_ReqWrap__prev___uintptr_t;
2223extern uintptr_t nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
2324extern uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
25+ extern uintptr_t nodedbg_offset_ListNode_HandleWrap__prev___uintptr_t;
2426extern uintptr_t nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
2527extern uintptr_t
2628 nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
@@ -129,6 +131,12 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
129131 const Argv argv;
130132 Env env{handle_scope, argv};
131133
134+ auto queue = reinterpret_cast <uintptr_t >((*env)->handle_wrap_queue ());
135+ auto head = queue +
136+ nodedbg_offset_Environment_HandleWrapQueue__head___ListNode_HandleWrap;
137+ auto tail = head + nodedbg_offset_ListNode_HandleWrap__prev___uintptr_t;
138+ tail = *reinterpret_cast <uintptr_t *>(tail);
139+
132140 uv_tcp_t handle;
133141
134142 auto obj_template = v8::FunctionTemplate::New (isolate_);
@@ -140,16 +148,12 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
140148 .ToLocalChecked ();
141149 TestHandleWrap obj (*env, object, &handle);
142150
143- auto queue = reinterpret_cast <uintptr_t >((*env)->handle_wrap_queue ());
144- auto head = queue +
145- nodedbg_offset_Environment_HandleWrapQueue__head___ListNode_HandleWrap;
146- auto next =
147- head + nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
148- next = *reinterpret_cast <uintptr_t *>(next);
151+ auto last = tail + nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
152+ last = *reinterpret_cast <uintptr_t *>(last);
149153
150154 auto expected = reinterpret_cast <uintptr_t >(&obj);
151- auto calculated = next -
152- nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap;
155+ auto calculated =
156+ last - nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap;
153157 EXPECT_EQ (expected, calculated);
154158
155159 obj.persistent ().Reset (); // ~HandleWrap() expects an empty handle.
@@ -160,6 +164,13 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
160164 const Argv argv;
161165 Env env{handle_scope, argv};
162166
167+ auto queue = reinterpret_cast <uintptr_t >((*env)->req_wrap_queue ());
168+ auto head =
169+ queue +
170+ nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
171+ auto tail = head + nodedbg_offset_ListNode_ReqWrap__prev___uintptr_t;
172+ tail = *reinterpret_cast <uintptr_t *>(tail);
173+
163174 auto obj_template = v8::FunctionTemplate::New (isolate_);
164175 obj_template->InstanceTemplate ()->SetInternalFieldCount (1 );
165176
@@ -174,16 +185,12 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
174185 // ARM64 CI machinies.
175186 for (auto it : *(*env)->req_wrap_queue ()) (void ) ⁢
176187
177- auto queue = reinterpret_cast <uintptr_t >((*env)->req_wrap_queue ());
178- auto head = queue +
179- nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
180- auto next =
181- head + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
182- next = *reinterpret_cast <uintptr_t *>(next);
188+ auto last = tail + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
189+ last = *reinterpret_cast <uintptr_t *>(last);
183190
184191 auto expected = reinterpret_cast <uintptr_t >(&obj);
185192 auto calculated =
186- next - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
193+ last - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
187194 EXPECT_EQ (expected, calculated);
188195
189196 obj.Dispatched ();
0 commit comments