Skip to content

Commit beb7101

Browse files
committed
Fixed #333
1 parent 7d64c84 commit beb7101

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

extension/script/attach.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local function getLuaVersion()
3838
end
3939
local dbg = dofile(path.."/script/debugger.lua")
4040
dbg:start {
41-
address = ("@%s/tmp/pid_%s"):format(path, pid),
41+
address = ("@$tmp/luadbg_%s"):format(pid),
4242
luaVersion = getLuaVersion(),
4343
}
4444
dbg:event "wait"

extension/script/common/socket.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ local proto = require 'common.protocol'
44
local function parseAddress(param)
55
local mode, address = param:match "^([a-z]+):(.*)"
66
if address:sub(1,1) == '@' then
7+
local fs = require "bee.filesystem"
8+
address = address:gsub("%$tmp", fs.temp_directory_path():string():gsub("([/\\])$", ""))
79
return {
810
protocol = 'unix',
911
address = address:sub(2),

extension/script/frontend/proxy.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ local initReq
1111
local m = {}
1212

1313
local function getUnixAddress(pid)
14-
local path = WORKDIR / "tmp"
15-
fs.create_directories(path)
16-
return "@"..(path / ("pid_%d"):format(pid)):string()
14+
return ("@$tmp/luadbg_%s"):format(pid)
1715
end
1816

1917
local function ipc_send_luaversion(pid, luaVersion)
@@ -81,10 +79,9 @@ local function proxy_attach(pkg)
8179
local args = pkg.arguments
8280
platform_os.init(args)
8381
if args.processId then
84-
local processId = tonumber(args.processId)
85-
local ok, errmsg = attach_process(pkg, processId)
82+
local ok, errmsg = attach_process(pkg, args.processId)
8683
if not ok then
87-
response_error(pkg, ('Cannot attach process `%d`. %s'):format(processId, errmsg))
84+
response_error(pkg, ('Cannot attach process `%d`. %s'):format(args.processId, errmsg))
8885
end
8986
return
9087
end

extension/script/launch.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dbg:set_wait("DBG", function(str)
2020
cfg = { address = address, client = (client == "c") }
2121
else
2222
local pid = params[1]
23-
cfg = { address = ("@%s/tmp/pid_%s"):format(path, pid) }
23+
cfg = { address = ("@$tmp/luadbg_%s"):format(pid) }
2424
end
2525
if params[2] == "ansi" then
2626
cfg.ansi = true

0 commit comments

Comments
 (0)