willox / auxtools

Rust library for low-level interfacing with BYOND's virtual machine. Includes a remote debugger for the BYOND DreamMaker language.
MIT License
27 stars 32 forks source link

Cannot debug procs using /database/query #45

Open DamianX opened 3 years ago

DamianX commented 3 years ago
/proc/enable_debugging(mode, port)
    CRASH("auxtools not loaded")

/proc/auxtools_stack_trace(msg)
    CRASH(msg)

var/early_init/early_init = new
/early_init/New()
    init_debugger()

/proc/init_debugger()
    var/auxtools_path = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")

    if(fexists(auxtools_path))
        call(auxtools_path, "auxtools_init")()
        enable_debugging()

/client/verb/stuff()
    ..()

    var/database/db = new("mydb.db")
    var/database/query/q = new("SELECT * FROM my_table WHERE name=?", "test")

    if(q.Execute(db) && q.NextRow())
        return q.GetRowData()

Put this in a new project, enable BYOND's debugging, place a breakpoint on the line with var/database/query/q. Attempting to step through it will result in the process hanging. This is in the output console:

Debug Server: "Pausing execution (reason: Breakpoint)"
Debug Server: "Pausing execution (reason: Step)"
[main] Error responding to "variables": timed out waiting for response
Debug client disconnected
Debug server thread finished
[main] Error responding to "stepIn": timed out waiting for response
[main] Error responding to "continue": timed out waiting for response
willox commented 2 years ago

possibly fixed by byond 514.1585?