Jump to content

Debugging Lua and Step Into issue


Rick
 Share

Recommended Posts

So when I step through I have some strange behavior. If I have something like below:

 

 

function ScanDirRecursive(dir)
local files = ScanDir(dir)

local i
for i = 1, table.getn(files) do
local ext = FileSystem:ExtractExt(files[i])

if files[i] == "" then
-- this is a directory
local fs = ScanDirRecursive(files[i])

-- copy all files we just found in fs to the final files table
local j
for j = 1, table.getn(fs) do
table.insert(files, fs[j])
end
elseif files[i] == "mdl" then
-- this is a model file so we want to add it to our list
table.insert(files, files[i])
end
end

return files
end

 

I put a break point on the line that has FileSystem:ExtractExt(files). If I press F9 (step into) the cursor goes back up to the line above (the if statement). Basically it looks like it ran everything below and hit the breakpoint I have back on the if statement. Now an F9 obviously can't go into FileSystem:ExtractExt() but then it should be acting like a Step Over command instead of a Resume command. This is how Visual Studio does it and I assume all debuggers.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...