@@ -19,8 +19,10 @@ extern uintptr_t
19
19
extern uintptr_t
20
20
nodedbg_offset_Environment__req_wrap_queue___Environment_ReqWrapQueue;
21
21
extern uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
22
+ extern uintptr_t nodedbg_offset_ListNode_ReqWrap__prev___uintptr_t;
22
23
extern uintptr_t nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
23
24
extern uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
25
+ extern uintptr_t nodedbg_offset_ListNode_HandleWrap__prev___uintptr_t;
24
26
extern uintptr_t nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
25
27
extern uintptr_t
26
28
nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
@@ -129,6 +131,12 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
129
131
const Argv argv;
130
132
Env env{handle_scope, argv};
131
133
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
+
132
140
uv_tcp_t handle;
133
141
134
142
auto obj_template = v8::FunctionTemplate::New (isolate_);
@@ -140,16 +148,12 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
140
148
.ToLocalChecked ();
141
149
TestHandleWrap obj (*env, object, &handle);
142
150
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);
149
153
150
154
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;
153
157
EXPECT_EQ (expected, calculated);
154
158
155
159
obj.persistent ().Reset (); // ~HandleWrap() expects an empty handle.
@@ -160,6 +164,13 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
160
164
const Argv argv;
161
165
Env env{handle_scope, argv};
162
166
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
+
163
174
auto obj_template = v8::FunctionTemplate::New (isolate_);
164
175
obj_template->InstanceTemplate ()->SetInternalFieldCount (1 );
165
176
@@ -174,16 +185,12 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
174
185
// ARM64 CI machinies.
175
186
for (auto it : *(*env)->req_wrap_queue ()) (void ) ⁢
176
187
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);
183
190
184
191
auto expected = reinterpret_cast <uintptr_t >(&obj);
185
192
auto calculated =
186
- next - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
193
+ last - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
187
194
EXPECT_EQ (expected, calculated);
188
195
189
196
obj.Dispatched ();
0 commit comments