Skip to content

Commit

Permalink
Re-introduce the Lua debugger (FAForever#3938)
Browse files Browse the repository at this point in the history
Introduces a fix to the Lua debugger that allows you to use it if you have setup your development environment. Allows for extensive debugging, including being able to see the stacktrace, locals and globals at any point of execution.
  • Loading branch information
Ejsstiil authored Jun 11, 2022
1 parent 1392ee5 commit 3146040
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 0 deletions.
Binary file added coderes/Engine/dbg_break_disabled.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_break_enabled.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_cursor.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_cursor_disabled.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_cursor_enabled.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_clearbreakpoints.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_disablebreakpoints.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_enablebreakpoints.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_find.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_findnext.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_findprev.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_resume.bmp
Binary file not shown.
Binary file added coderes/Engine/dbg_tool_step.bmp
Binary file not shown.
17 changes: 17 additions & 0 deletions lua/userInit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ if selectedlanguage ~= nil then
doscript '/lua/system/Localization.lua'
end

-- Do we have SC_LuaDebugger window positions in the config ?
if not GetPreference("Windows.Debug") then
-- no, we set them to some sane defaults if they are missing. Othervise Debugger window is messed up
SetPreference('Windows.Debug', {
x = 10,
y = 10,
height = 550,
width = 900,
Sash = { horizontal = 212, vertical = 330 },
Watch = {
Stack = { block = 154, source = 212, line = 72 },
Global = { value = 212, type = 215, name = 220 },
Local = { value = 212, type = 134, name = 217 }
}
})
end

local AvgFPS = 10
WaitFrames = coroutine.yield

Expand Down
3 changes: 3 additions & 0 deletions setup/bin/init_dev.lua
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,9 @@ MountAllowedContent(fa_path .. '/gamedata/', '*.scd', allowedAssetsScd)
-- get direct access to preferences file, letting us have much more control over its content. This also includes cache and similar
MountDirectory(SHGetFolderPath('LOCAL_APPDATA') .. 'Gas Powered Games/Supreme Commander Forged Alliance', '/preferences')

-- mount SC_LuaDebugger GUI graphics
MountDirectory(locationOfRepository .. '/coderes', '/coderes')

-- Load in all the data of the steam installation (movies, maps, sound folders)
MountDirectory(fa_path .. "/movies", '/movies')
MountDirectory(fa_path .. "/sounds", '/sounds')
Expand Down

0 comments on commit 3146040

Please sign in to comment.