Skip to content
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

More straightforward usage #14

Open
Gama11 opened this issue Aug 23, 2016 · 2 comments
Open

More straightforward usage #14

Gama11 opened this issue Aug 23, 2016 · 2 comments

Comments

@Gama11
Copy link
Member

Gama11 commented Aug 23, 2016

Currently these 3 steps are required to use hxcpp-debugger:

  1. add -lib hxcpp-debugger
  2. add -D HXCPP_DEBUGGER
  3. add new debugger.HaxeRemote(true, "localhost"); to the entry point

It would be nice if this could be reduced to just the first step.

Eliminating step 2 should be simple, either via an extraParams file that automatically defines HXCPP_DEBUGGER if the lib is included, or just by using the define that is added for the haxelib instead. I can't really think of a situtation where you would want to include the lib, but not define HXCPP_DEBUGGER?

The code needed could be injected via a macro somehow. @RealyUniqueName pointed out that alternatively, static var initialization could be abused for this.
There would still need to be a way to manually set the host IP somehow for remote debugging of course.

(discussed in haxe-dev, cc @Simn / @nadako)

@RealyUniqueName
Copy link
Member

RealyUniqueName commented Aug 23, 2016

Host IP could be set via compiler flag like -D DEBUG_HOST=127.0.0.1
And then get it in lib's code:

var host = haxe.macro.Compiler.getDefine('DEBUG_HOST');
if (host == null) host = <default_value>;

@Gama11
Copy link
Member Author

Gama11 commented Aug 23, 2016

Sounds good! Not sure if HXCPP_DEBUG_HOST would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants