Skip to content

Commit

Permalink
Display all found offsets on completion
Browse files Browse the repository at this point in the history
  • Loading branch information
lethosor committed Aug 4, 2014
1 parent 2928f15 commit 1420857
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/devel/find-offsets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ local function zoomed_searcher(startn, end_or_sz)
end
end

local finder_searches = {}
local function exec_finder(finder, names)
if type(names) ~= 'table' then
names = { names }
end
local search = force_scan['all']
for _,v in ipairs(names) do
table.insert(finder_searches, v)
if force_scan[v] or not is_known(v) then
search = true
end
Expand Down Expand Up @@ -1544,5 +1546,14 @@ exec_finder(find_process_jobs, 'process_jobs')
exec_finder(find_process_dig, 'process_dig')
exec_finder(find_pause_state, 'pause_state')

print('\nDone. Now add newly-found globals to symbols.xml.')
print('\nDone. Now add newly-found globals to symbols.xml.\n')

for _, global in ipairs(finder_searches) do
local addr = dfhack.internal.getAddress(global)
if addr ~= nil then
local ival = addr - dfhack.internal.getRebaseDelta()
print(string.format("<global-address name='%s' value='0x%x'/>", global, ival))
end
end

searcher:reset()

0 comments on commit 1420857

Please sign in to comment.