Debug javascript, support for GDB?

921 views
Skip to first unread message

Daniele Salvatore Albano

unread,
Oct 27, 2011, 6:33:27 AM10/27/11
to nodejs
I've a BIG question.

I'm writing a lot of code but writing it without proper gui debug
tools is an hell (breakpoints, espression watch, global and local
variables, stacktrace and so on), so i'm just curious: there is a way
to use GDB (well, gdb protocol) to debug javascript on node.js?

I'm asking because would be wonderful use rad (like eclipse or, on
windows, visual studio with windbg or similar) to write and debug
javascript.

Looking around i've founded this page
http://code.google.com/p/v8/wiki/GDBJITInterface

It seems that only linux is supported, btw having the ability to use
eclipse to write and debug javascript code on node.js would be great!

Daniele Salvatore Albano

unread,
Oct 27, 2011, 7:06:38 AM10/27/11
to nodejs
I've founded this too
https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger

but it works bad, i mean it let me to connect to the debugger
correctly but doesn't found files i start (tried to add paths to
source code lookup paths) and when i stop code continues to work

2011/10/27 Daniele Salvatore Albano <d.al...@gmail.com>:

--
Daniele Salvatore Albano
---
IT Consultant
Website Design and Development
Software Engineer and Developer
Linux Servers SetUp And Administration
Embedded Network Solutions

http://www.daccii.it
http://www.itechcon.it

Joshua Cohen

unread,
Oct 27, 2011, 9:46:32 AM10/27/11
to nod...@googlegroups.com
Try out node inspector? https://github.com/dannycoates/node-inspector

It's the Webkit developer tools, for Node and it's awesome.


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Jorge

unread,
Oct 27, 2011, 9:53:12 AM10/27/11
to nod...@googlegroups.com
On 27/10/2011, at 15:46, Joshua Cohen wrote:

Try out node inspector? https://github.com/dannycoates/node-inspector

It's the Webkit developer tools, for Node and it's awesome.

So much that it should go into core :-P
-- 
Jorge.

Matt

unread,
Oct 27, 2011, 11:35:31 AM10/27/11
to nod...@googlegroups.com
That would require it working. I have never been able to get it to work.

Jorge

unread,
Oct 27, 2011, 11:59:41 AM10/27/11
to nod...@googlegroups.com

Ryan Gahl

unread,
Oct 27, 2011, 12:10:48 PM10/27/11
to nodejs
For me (and I suspect Matt as well), I can't get past this screen:
http://markup.io/v/52asm8pvhwh9

Clicking "enable debugging" does nothing



On Oct 27, 10:59 am, Jorge <jo...@jorgechamorro.com> wrote:
> On 27/10/2011, at 17:35, Matt wrote:
>
> > On Thu, Oct 27, 2011 at 9:53 AM, Jorge <jo...@jorgechamorro.com> wrote:
> > On 27/10/2011, at 15:46, Joshua Cohen wrote:
>
> >> Try out node inspector?https://github.com/dannycoates/node-inspector

Jorge

unread,
Oct 27, 2011, 12:18:32 PM10/27/11
to nod...@googlegroups.com
On 27/10/2011, at 18:10, Ryan Gahl wrote:
> On Oct 27, 10:59 am, Jorge <jo...@jorgechamorro.com> wrote:
>> On 27/10/2011, at 17:35, Matt wrote:
>>> On Thu, Oct 27, 2011 at 9:53 AM, Jorge <jo...@jorgechamorro.com> wrote:
>>> On 27/10/2011, at 15:46, Joshua Cohen wrote:
>>
>>>> Try out node inspector?https://github.com/dannycoates/node-inspector
>>
>>>> It's the Webkit developer tools, for Node and it's awesome.
>>
>>> So much that it should go into core :-P
>>
>>> That would require it working. I have never been able to get it to work.
>>
>> http://homepage.mac.com/jorgechamorro/nodeInspectorInstall.mov
>> http://jorgechamorro.com/NodeDebugSession.mov
>>
> For me (and I suspect Matt as well), I can't get past this screen:
> http://markup.io/v/52asm8pvhwh9
>
> Clicking "enable debugging" does nothing

I don't know. Ask Danny C.

(CCed to "Danny C.")
--
Jorge.

Ryan Gahl

unread,
Oct 27, 2011, 12:31:28 PM10/27/11
to nodejs
Hmm, ok I think I figured it out.

I am accustomed to using 'node debug /path/to/app.js'... which is the
good old CLI debugger. It appears the --debug (or --debug-brk) switch
is required (and can't have both CLI debugging and node-inspector
attached at same time which makes sense).

User error... Sweet!

George Snelling, Seattle

unread,
Oct 27, 2011, 12:32:15 PM10/27/11
to nod...@googlegroups.com
I use node-inspector (with Chrome on a Mac) and I've never had a problem.  The thing rocks.  I put off learning it for far too long, thinking it would be a big investment of time, but it took 5 minutes to install and figure out, and has saved me hours and hours of console.log... 

Matt

unread,
Oct 27, 2011, 12:59:39 PM10/27/11
to nod...@googlegroups.com
I only wanted it for the profiling (I'm perfectly happy with console.log debugging)... But I seem to have it working now.

I do get errors though:

[CRIT] E7F232DF-1D80-4DC2-9140-3BD90A30DF5C Plugin profile failed: TypeError: Cannot set property '__proto__' of undefined
    at Object.stopProfiling (/Users/matt/Perl/Haraka/node_modules/v8-profiler/v8-profiler.js:105:21)
    at Plugin.hook_disconnect (profile:9:10)

Not sure what that's about.

On Thu, Oct 27, 2011 at 12:32 PM, George Snelling, Seattle <geor...@gmail.com> wrote:
I use node-inspector (with Chrome on a Mac) and I've never had a problem.  The thing rocks.  I put off learning it for far too long, thinking it would be a big investment of time, but it took 5 minutes to install and figure out, and has saved me hours and hours of console.log... 

--

Mark Hahn

unread,
Oct 27, 2011, 1:43:26 PM10/27/11
to nod...@googlegroups.com
I use node-inspector (with Chrome on a Mac) and I've never had a problem.  

+1 (chrome on PC)

Daniele Salvatore Albano

unread,
Oct 27, 2011, 7:34:47 PM10/27/11
to nod...@googlegroups.com
node-inspector seems great, but be able to debug directly from the IDE
is irreplaceable :)

2011/10/27 Mark Hahn <ma...@hahnca.com>:


>> I use node-inspector (with Chrome on a Mac) and I've never had a problem.
>>
> +1 (chrome on PC)
>

> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

--

Scott Taylor

unread,
Oct 27, 2011, 7:45:21 PM10/27/11
to nod...@googlegroups.com

Take a look at:


It's buggy and hasn't been worked on for several months, but with a few bug fixes it would basically be your gdb replacement.

Scott

Isaac Schlueter

unread,
Oct 28, 2011, 2:05:20 PM10/28/11
to nod...@googlegroups.com
I personally really like `node debug blah.js` from the command-line best.

It'd be nice if there was a way to dynamically edit the file, but
inspecting/modifying variables in the repl can be really powerful.

Heinrich Göbl

unread,
Oct 29, 2011, 7:11:05 AM10/29/11
to nodejs
I'm using WebStorm from Jetbrains with the NodeJS plugin.
This tool costs some bucks but it's worth every cent.
And there is also a plugin for Chrome and FireFox that makes debugging
client-side code a pleasure.
BTW I'm not a Jetbrains employee, but that piece of software is just
really imposing to me.

Mark Hahn

unread,
Oct 31, 2011, 9:26:10 PM10/31/11
to nod...@googlegroups.com
> This tool costs some bucks

It's only $35 at the moment.  Maybe I'll give it a try.  Has anyone used coffeescript with it?

张晋

unread,
Nov 1, 2011, 11:24:59 AM11/1/11
to nod...@googlegroups.com

I think you can try cloud9,its a awesome tool let you debug,run in browser.Very easy to use!

在 2011-11-1 上午9:26,"Mark Hahn" <ma...@hahnca.com>写道:

> This tool costs some bucks

It's only $35 at the moment.  Maybe I'll give it a try.  Has anyone used coffeescript with it?

--

Reply all
Reply to author
Forward
0 new messages