Skip to content

Commit 1dbf4ed

Browse files
committed
#462 supports debugger attach
1 parent 2e78c01 commit 1dbf4ed

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.vscode/launch.json

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"stopOnEntry": true,
3333
"address": "127.0.0.1:11427",
3434
"outputCapture": [
35+
],
36+
"sourceMaps": [
37+
[
38+
"./*",
39+
"${workspaceFolder}/*"
40+
]
3541
]
3642
},
3743
]

platform.lua

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232
local currentPath = debug.getinfo(1, 'S').source:sub(2)
3333
local fs = require 'bee.filesystem'
3434
local rootPath = fs.path(currentPath):remove_filename():string()
35-
if dll == '.dll' then
35+
if dll == 'dll' then
3636
rootPath = rootPath:gsub('/', '\\')
3737
package.path = rootPath .. script .. '\\?.lua'
3838
.. ';' .. rootPath .. script .. '\\?\\init.lua'
@@ -50,7 +50,8 @@ package.searchers[2] = function (name)
5050
local f = io.open(filename)
5151
local buf = f:read '*a'
5252
f:close()
53-
local init, err = load(buf, '@' .. name)
53+
local relative = filename:sub(#rootPath + 1)
54+
local init, err = load(buf, '@' .. relative)
5455
if not init then
5556
return err
5657
end

0 commit comments

Comments
 (0)