auxtools icon indicating copy to clipboard operation
auxtools copied to clipboard

Cannot debug procs using /database/query

Open DamianX opened this issue 4 years ago • 1 comments

/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

DamianX avatar Aug 15 '21 12:08 DamianX

possibly fixed by byond 514.1585?

sohpeach avatar Jun 27 '22 18:06 sohpeach