Skip to content

CLI debugger exits after spawning hl process and connecting #116

Description

@dmlary

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions