Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Hovering and Debugging

DZone's Guide to

Hovering and Debugging

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

Eclipse provides in the Editor view great tool tips (called ‘hovers’) which shows what is behind a macro: I can move my mouse over it, and it shows me the content behind it:

Macro Expansion Hover in Editor View

Macro Expansion Hover in Editor View

But if I’m debugging, I get “No value available”:

'No value available' while debugging

‘No value available’ while debugging

Obviously, the debugger queries the value of that macro, and as there is no variable with that name, there is no value. Makes sense. But: how can I see the macro value while debugging?

The solution is to configure different hover keys in the preferences (menu Window > Preferences > C/C++ > Editor > Hovers):

Hover Preferences

Hover Preferences

The above dialog shows as well that there are different Hovers available. By default, the ‘Combined Hover’ is used. And it is using the Debugger Hover, which cannot provide a value, thus the ‘No value available’ result. The Hover Preferences has as well the possibility to assign a modifier key: with this, a selected hover can be used.

And indeed: if I use the ‘Shift’ key pressed while hovering in the debugger, I get what I want :-) :

Hover while Debugging with Shift key pressed

Hover while Debugging with Shift key pressed

Happy Hovering :-)

Are you using Bitbucket to accomplish your company's mission? Share your company’s mission with #Forthecode for a chance to be featured on our homepage, our social media channels, or win a free t-shirt!

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}