Menu

#83 Not all variables are visible in Eclipse debugger 'Variables' view

Accepted
nobody
None
Medium
Defect
2013-01-24
2013-01-22
Anonymous
No

Originally created by: redsandro

Eclipse version: 3.8.0
Chromium Javascript Remote Debugger version: 0.3.8.201210040400
Node.JS version: 0.6.19
OS + version: Ubuntu 12.10 (Linux Mint 14 Cinnamon)

What steps will reproduce the problem?

1. Set up a node.js server using:
require('http').createServer(function(request, response){ util.debug(request.connection.remoteAddress); // whatever... }).listen(8080);

2. Set breakpoint in the router function

3. The Variable Explorer will show no such attribute "remoteAddress" in "request.connection" even though it shows a whole bunch of other stuff.
Entering "request.connection.remoteAddress" in the Expression Window DOES however show "127.0.0.1"

What is the expected result?

request.connection.remoteAddress in the Variable window upon debug/break

What happens instead?

Bunch of other stuff is visible, but not remoteAddress. Makes one wonder what else is valid but hidden.

Discussion

  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: peter.ry...@gmail.com

    Could you please check the following guess for me:

    "remoteAddress" is a defined in prototype object. It's not a regular (data) property, but an accessor property, which means that only a getter function is actually stored in prototype, that is being called and gets the actual data from your instance.

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: redsandro

    Wouldn't prototyped properties be visible when traversing down (constructorand)
    __proto__ attributes? Including functions? Because remoteAddress, wether
    it's a getter function or a value is nowhere to be found within these.
    Any other way to verify this?

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: peter.ry...@gmail.com

    Yes, it should be in prototype chain. Thanks for checking this. I will try to reproduce it.

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: peter.ry...@gmail.com

    Reproduced on Node.JS v. 0.6.2:
    "remoteAddress" is listed in prototype object. However it has an incorrect value 'undefined'.

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: peter.ry...@gmail.com

    Accessor property is handled incorrectly by debugger, if property is defined in prototype object.
    Probably, getter function is incorrectly called on prototype object rather than on original object.

    Status: Accepted

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: redsandro

    Thanks for looking into this so quickly.
    In my instance, I cannot find remoteAddress in the __proto__ chain, not even with value false.

    It also doesn't show up when searching (Ctrl+F) the Variable window during break(point).

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: redsandro

    If it doesn't show up in search but you did find it manually, can you tell me the object path so I can verify?

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: peter.ry...@gmail.com

    I don't think that Ctrl+F works correctly for JavaScript variables. It knows nothing about proto chain and Eclipse API doesn't allow providing any logic there.

    The path is simple: connection.__proto__ (1 step in prototype chain)

     
  • Anonymous

    Anonymous - 2013-01-22

    Originally posted by: redsandro

    I will verify it when I am back at the office, but just fyi, if you Ctrl+F
    inside the Variable window and search for a variable for which you know it
    is inside a __proto__, it will find it.
    I think if the debug variable explorer can show it, then Ctrl+F can find it.

     
  • Anonymous

    Anonymous - 2013-01-24

    Originally posted by: redsandro

    Just double-checked, it's like I thought. On my machine is no remoteAddress. But when you request it in the expression editor, it does have a value of 127.0.0.1.

     
  • Anonymous

    Anonymous - 2013-01-24

    Originally posted by: peter.ry...@gmail.com

    Looks like you didn't open "connection" as you described initialy

     
  • Anonymous

    Anonymous - 2013-01-24

    Originally posted by: redsandro

    Oops.. long day, forgive me.
    Let me try again tomorrow. :)

     

Log in to post a comment.