-
Notifications
You must be signed in to change notification settings - Fork 26
Description
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.hlAnalysis
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:
hashlink-debugger/hld/Debugger.hx
Lines 163 to 171 in 5d021cc
| 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():
hashlink-debugger/hld/HLDebugApi.hx
Lines 31 to 33 in 5d021cc
| public function start() { | |
| return debugStart(pid); | |
| } |
Which will always return false:
hashlink-debugger/hld/HLDebugApi.hx
Line 8 in 5d021cc
| 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?