Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the Eclipse debugger gets the information about private variables inside the class?

Tags:

java

eclipse

this was an interview question posed to me..I vaguely answered it uses Java reflections..but I was not sure. how does that work?

like image 541
flash Avatar asked May 04 '10 09:05

flash


People also ask

How does Eclipse debugger work?

Eclipse allows running an application in Debug mode which helps with stepping through each line of code in a program. Eclipse also provides a Debug Perspective which is a set of views grouped together that help inspect code and make the debugging process very effective.

How do I show Variables in debugging in Eclipse?

Variables/Expression view – Shows the declared variables and their values. Press Ctrl+Shift+d or Ctrl+Shift+i on a selected variable or expression to show its value. You can also add a permanent watch on an expression/variable that will then be shown in the Expressions view when debugging is on.

What is Eclipse drop to frame debugging?

6. Drop to frame. Eclipse enables users to choose any frame (level) in the call stack during the debugging process and set the JVM to start again from the selected level. In simple words, it allows you to re-run a part of your program.


1 Answers

The key to your question is almost certainly java.lang.reflect.AccessibleObject, which allows the debugger to turn off the access control checks and poke around. Spring uses the same mechanism to get access to the variables for dependency injection.

like image 150
Donal Fellows Avatar answered Sep 18 '22 23:09

Donal Fellows