Skip to content

Commit 8e9d040

Browse files
committed
devel/dump-offsets: add global_table, print table length
1 parent 313523a commit 8e9d040

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

devel/dump-offsets.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function save_addr(name, addr)
203203
end
204204

205205
local extended = false
206-
local start = data.intptr_t:find_one(search)
206+
local start, start_addr = data.intptr_t:find_one(search)
207207
if start then
208208
extended = true
209209
else
@@ -215,6 +215,11 @@ if not start then
215215
qerror('Could not find global table header')
216216
end
217217

218+
if extended then
219+
-- structures only has types for an extended global table
220+
save_addr('global_table', start_addr + (#search * data.intptr_t.esize))
221+
end
222+
218223
local index = 1
219224
local entry_size = (extended and 3 or 2)
220225
while true do
@@ -236,3 +241,5 @@ while true do
236241
end
237242
index = index + 1
238243
end
244+
245+
print('global table length:', index)

0 commit comments

Comments
 (0)