When using debug.traceback(), the slashes in the file paths change from / to \ when the debugger is started.
This is an issue because I was string pattern matching the traceback to only get the relevant part, and the slash change actually caused that to fail all the way up into a crash.
Minimal reproduction code (using LÖVE):
In main.lua:
In test/test.lua:
print(debug.traceback())
require("lldebugger").start()
print(debug.traceback())
Output:
stack traceback:
test/test.lua:1: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[love "boot.lua"]:316: in function <[love "boot.lua"]:126>
[C]: in function 'xpcall'
[love "boot.lua"]:355: in function <[love "boot.lua"]:348>
[C]: in function 'xpcall'
[love "boot.lua"]:370: in function <[love "boot.lua"]:337>
stack traceback:
test\test.lua:3: in main chunk
[C]: in function 'require'
main.lua:1: in main chunk
[C]: in function 'require'
[love "boot.lua"]:316: in function <[love "boot.lua"]:126>
[C]: in function 'xpcall'
[love "boot.lua"]:355: in function <[love "boot.lua"]:348>
[C]: in function 'xpcall'
[love "boot.lua"]:370: in function <[love "boot.lua"]:337>
I'm using LÖVE 11.4 on WIndows 10 if that matters.
When using
debug.traceback(), the slashes in the file paths change from/to\when the debugger is started.This is an issue because I was string pattern matching the traceback to only get the relevant part, and the slash change actually caused that to fail all the way up into a crash.
Minimal reproduction code (using LÖVE):
In
main.lua:In
test/test.lua:Output:
I'm using LÖVE 11.4 on WIndows 10 if that matters.