-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI debugger exits after spawning hl process and connecting #116
Comments
debugStart is a native call so it will call debug_start C API from std.hdll
(see the @:hlNative at the class declaration)
Le dim. 19 févr. 2023 à 21:34, David M. Lary ***@***.***> a
écrit :
… 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:
https://github.com/vshaxe/hashlink-debugger/blob/5d021ccf066e8b3e5a0b65d2b90282fefe450e1f/hld/Debugger.hx#L163-L171
In my case api is HLDebugApi, and its implementation is simply to return
debugStart():
https://github.com/vshaxe/hashlink-debugger/blob/5d021ccf066e8b3e5a0b65d2b90282fefe450e1f/hld/HLDebugApi.hx#L35-L37
Which will always return false:
https://github.com/vshaxe/hashlink-debugger/blob/5d021ccf066e8b3e5a0b65d2b90282fefe450e1f/hld/HLDebugApi.hx#L8
Questions
Is there a way to debug a process from the command-line using the hashlink
vm?
—
Reply to this email directly, view it on GitHub
<#116>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQFTY37LJVTJI2LTEPTWYJ7T7ANCNFSM6AAAAAAVBFB7YM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Ok, I’ll dig into the c code to see what’s going wrong. I’m getting no prompt from the debugger; it just drops back to the command line. |
Ahh, damnit, I figured it out. I used homebrew to install hashlink. The homebrew recipe does not run the Is there any way to add an error message somewhere along the mac codepath to remind the user to check for codesigning? Right now the debugger just exits with no output. |
This is only implemented in the VSCode extension. See here: hashlink-debugger/src/Extension.hx Lines 28 to 35 in c609db8
Note that the Mac Debugger won't work on Apple Silicon processors with Rosetta2! |
You're welcome to submit a PR 😉
Le lun. 20 févr. 2023 à 10:09, rcstuber ***@***.***> a écrit :
… This is only implemented in the VSCode extension. See here:
https://github.com/vshaxe/hashlink-debugger/blob/c609db82b438e209baea84ad1980696f17605782/src/Extension.hx#L28-L35
Note that the Mac Debugger won't work on Apple Silicon processors with
Rosetta2!
—
Reply to this email directly, view it on GitHub
<#116 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHZXQFXDWRHSDKCY6IVK4TWYMYGFANCNFSM6AAAAAAVBFB7YM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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
api
is 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?
The text was updated successfully, but these errors were encountered: