Vetterjack
Vetterjack

Reputation: 2505

Debugging Java get list of objects and local variables

Is there any way to get a list of all current objects and local variables when debugging a java program? Seems JDB doesn't offer such functionality. I only can inspect vars and objects if I know the name of them.

My aim is to step through any line of code from the beginning while being able to see at any time which objects live in memory and which local variables does my current method have.

Upvotes: 2

Views: 3277

Answers (1)

Jeremy
Jeremy

Reputation: 22435

The command for listing the local variables is locals.

If you launch a jdb session and type help, it says:

locals                    -- print all local variables in current stack frame

Upvotes: 3

Related Questions