lua file fixes for linux (hopefully does not break windows)

develop
Warmist 2011-08-08 23:38:09 +03:00
parent 71dc85d35a
commit 056fd51e96
2 changed files with 9 additions and 4 deletions

@ -3,9 +3,9 @@ STD_STRING=0
DWORD=1 DWORD=1
WORD=2 WORD=2
BYTE=3 BYTE=3
function GetTextRegion() function GetTextRegion()
ranges__=ranges__ or Process.getMemRanges() ranges__=ranges__ or Process.getMemRanges()
--print("Ranges:"..#ranges__)
for k,v in pairs(ranges__) do for k,v in pairs(ranges__) do
--for k2,v2 in pairs(v) do --for k2,v2 in pairs(v) do
-- print(string.format("%d %s->%s",k,tostring(k2),tostring(v2))) -- print(string.format("%d %s->%s",k,tostring(k2),tostring(v2)))
@ -15,8 +15,10 @@ function GetTextRegion()
--if(v["read"])then num=num+1 end --if(v["read"])then num=num+1 end
--if(v["write"])then num=num+10 end --if(v["write"])then num=num+10 end
--if(v["execute"]) then num=num+100 end --if(v["execute"]) then num=num+100 end
--print(string.format("%d %x->%x %s %d",k,v["start"],v["end"],v.name,num)) --if num>=100 then
local pos=string.find(v.name,".text") --print(string.format("%d %x->%x %s %d",k,v["start"],v["end"],v.name or "",num))
--end
local pos=string.find(v.name,".text") or string.find(v.name,"libs/Dwarf_Fortress")
if(pos~=nil) then if(pos~=nil) then
return v; return v;
end end

@ -1,3 +1,6 @@
function print(msg)
Console.print(msg.."\n")
end
function err(msg) --make local maybe... function err(msg) --make local maybe...
print(msg) print(msg)
print(debug.traceback()) print(debug.traceback())