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

node arguments specially for --debug-brk #315

Closed
ifraixedes opened this issue Nov 27, 2013 · 18 comments
Closed

node arguments specially for --debug-brk #315

ifraixedes opened this issue Nov 27, 2013 · 18 comments

Comments

@ifraixedes
Copy link
Contributor

It would be very great that mimosa can pass arguments to node, e.g. --debug-brk to be able to debug the server code.

If it is possible to do, my apologies for my unknowledge, but I could find how to do it.

@dbashford
Copy link
Owner

This might help: https://groups.google.com/forum/#!topic/mimosajs/4FBuE1F7x2E

Let me know if that helps give you what you need. I can spend some time in the near future looking at what it would take to pass additional params in.

@ifraixedes
Copy link
Contributor Author

Awesome, it works although it is slow until the server is listening, but that must from the debugger process and all the stuff that mimosa do.
For me it is enough.

Thanks so much for replying as fast.

@kbaltrinic
Copy link

I would like to second this feature.

@dbashford
Copy link
Owner

Have either of you guys seen or found good examples of node command line tools doing this? I can't see a simple way to get this done.

I think the way --debug-brk works (I confess to never having used it) is it stops the node process in place while waiting for the debugger to connect, then it lets it go. So mimosa itself would be stopped until you connect. Might be wrong on that though.

@ifraixedes
Copy link
Contributor Author

I am not sure to understand your question, but I tried to reply you with my understanding.

--debug-brk stop the execution of the script in the first line waiting until you emit a command from the debugger, for example "one step". In my case I am using node inspector which I run before running the application and then when the application runs, I load it, add the breakpoints where I want to stop the execution (the first time that I run, because after they are saved) and after I run the debugger until it find the first breakpoint; another possibility is write debugger; in the lines of your script where you would like that the debugger stop and use the option --debug, but I don't like because I have to remove them (so remember where I added them) when I find and fix the problem.

Let me know if I replied you or I misunderstood.

@dbashford
Copy link
Owner

Yeah, that was my understanding of how it works.

I'd like to be able to support providing this as part of the mimosa command (as well as access to any other command line options), but I'm not sure how. I've poked around some of the other popular command line tools looking for ideas and I've not found any examples of them doing this.

@ifraixedes
Copy link
Contributor Author

Ah, then mocha may help you.
It accepts as a parameter --debug-brk

@dbashford
Copy link
Owner

So the mocha way of going about it is what I figured I'd have to do. Unfortunately the way mocha goes about it runs node out of memory and errors out for large projects (like my work app).

@ifraixedes
Copy link
Contributor Author

Not sure that you mean, because I haven't faced that kind of issues, so far I cannot help you in it.
Only let you know although probably you already know, coffee script allows to pass parameters to node executable as well.

My apologies not to be more helpful.

@kbaltrinic
Copy link

What about using the undocumented process._debugProcess(process.pid) call? It is pseudo-documented in the windows section of the node-inspector readme. Other documentation indicates this call is platform independent. Of course its undocumented and therefore fragile but maybe also put a request into Node to make it an official part of the API? Clearly certain node-based dev tools have need of it.

@dbashford
Copy link
Owner

Will take a look.

@dbashford
Copy link
Owner

So the out of memory problem was something of my own creation. Seems the mocha method will work just fine. Testing it out a little bit, but I will probably toss this in a 1.3.2 and release it shortly.

@dbashford
Copy link
Owner

I've wrapped up all the work for this but I'm going to wait until tomorrow to push. I have a bit of documentation to update.

@ifraixedes
Copy link
Contributor Author

Cool man, it is awesome!

@dbashford
Copy link
Owner

This is released, v1.3.2

@Anachron
Copy link
Contributor

Quick side node:
Wouldn't it be nice for the user to get a little information about that when using "mimosa" or "mimosa help"?

@dbashford
Copy link
Owner

Good idea! Could you make a separate ticket to track?

Busy with Xmas stuff. Current priority is getting 2.0 out. But I can knock out small stuff like that in between tasks.


On 2013-12-26 00:57:13 +0000 Anachron notifications@github.com wrote:

Quick side node:
Wouldn't it be nice for the user to get a little information about that when
using "mimosa" or "mimosa help"?


Reply to this email directly or view it on GitHub:
#315 (comment)

@Anachron
Copy link
Contributor

Done.
Happy Xmas!

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

4 participants