Summary
Using hashlink-debugger as a command-line debugger does not appear to work for the hl build. When I start the debugger, it spawns the process to be debugged, then immediately exits.
This is how I'm building & running the debugger:
cd debugger
haxe compile.hxml
hl debug.hl ~/src/heaps-hello/hello.hl
Analysis
Digging into the source, it looks like it's hard-coded not to work for HLDebugApi.hx. This is the call-chain I traced:
After the connection is established Debugger.init() calls api.start() and will return false if the API fails to start:
|
public function init( api : Api ) { |
|
this.api = api; |
|
eval = new Eval(module, api, jit); |
|
eval.resumeDebug = evalResumeDebug; |
|
if( !api.start() ) |
|
return false; |
|
wait(); // wait first break |
|
return true; |
|
} |
In my case api is HLDebugApi, and its implementation is simply to return debugStart():
|
public function start() { |
|
return debugStart(pid); |
|
} |
Which will always return false:
|
static function debugStart( pid : Int ) : Bool { return false; } |
Questions
Is there a way to debug a process from the command-line using the hashlink vm?
Summary
Using hashlink-debugger as a command-line debugger does not appear to work for the hl build. When I start the debugger, it spawns the process to be debugged, then immediately exits.
This is how I'm building & running the debugger:
Analysis
Digging into the source, it looks like it's hard-coded not to work for HLDebugApi.hx. This is the call-chain I traced:
After the connection is established
Debugger.init()callsapi.start()and will return false if the API fails to start:hashlink-debugger/hld/Debugger.hx
Lines 163 to 171 in 5d021cc
In my case
apiis HLDebugApi, and its implementation is simply to returndebugStart():hashlink-debugger/hld/HLDebugApi.hx
Lines 31 to 33 in 5d021cc
Which will always return
false:hashlink-debugger/hld/HLDebugApi.hx
Line 8 in 5d021cc
Questions
Is there a way to debug a process from the command-line using the hashlink vm?