About eclipse debug "Display" view
Display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable in the Display view, and you'll be greeted with a familiar content assist.
http://www.ibm.com/developerworks/library/os-ecbug/
I have stopped at break point and used Display view for some code inspection and execution but I could not get the code assistance in the Display view. Although copy paste a code and executing it works ok.
Having code assist will be very helpful, I get the code assist when defining Breakpoint condition.
Regards,
Rashid
Does Ctrl+Space not get you content assist? It does for me. I don't think it's automatic unless you are trying to call a method on an object by typing the . after the object.
I faced the same issue that all the debug tabs are lost and could not restore it via Windows > Show View > Variable/Display, it always remains disappear.
Now I just got things back by resetting the Debug perspective to get the Variable and Display tab back.
Related
I am using the following code to set the selection provider outside the createpartcontrol method of the view, my project view is restricted wherein the createpartcontrol is a generic and I will not be able to use the selection provider inside it. The following code does not work with enabling menu by property testers where in I am using <enabled when> variable="selection" </enabled when> when the view loads initially but when click outside the view and click backed into the view then property testers works fine and my menu items get enabled.
Also I found this post in the eclipse documentation that Replacing the selection provider during the lifetime of the part is not properly supported by the workbench :
https://eclipse.org/articles/Article-WorkbenchSelections/article.html
Not sure where am i going wrong? Could someone provide some help with respect to this.
Also when i debug through eclipse it goes through this part of the code and everything works fine , but when run as an application outside debug mode the issue occurs.
IWorkbenchWindow iw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
iw.getActivePage().getActivePart().getSite().setSelectionProvider(objectComposite.getViewer());
I am new to Android development with Eclipse. I am asking a very basic question :
is it possible to watch / spy the content of a variable during the debugging session? (a bit like in Visual Studio)
I know It is a fairly lame question, but I couldn't figure it out myself.
thanks in advance,
Gallien
First select Debug perspective as:
Then set Breakpoints at places you want:
After that create a Debug configuration via Debug As->Debug Configurations... and then Debug as Android Application as shown below:
Then in Debug perspective you can trace/watch value of your desired variable by pressing F8:
That's it, you can also evaluate expressions through Expressions view. If it is not enabled select it from:
Window->Show View->Other->Debug->Expressions.
you can use the Expressions tab in the debug perspective. Also you can observe the variable when you hit a breakpoint - check this link: http://www.ibm.com/developerworks/library/os-ecbug/
Yes, you may view variables whilst debugging.
To set a watch point, select a variable in the 'Outline' view in the 'Debug' perspective. Right click the variable, and press 'Toggle Watchpoint'.
More information available here
When you have open debug perspective, click window->show view->expressions. After that, you can input a variable name manually. You can select a variable in code then right click, there will be a link named 'watch'. You'll get it!
The most easiest way, is to hover over the variable name while debugging and it shows you the whole object. I work on eclipse kepler latest version.
I'm brushing up my Eclipse RCP skill by trying to enhance my one-year-old side RCP application. This application has one perspective, and this perspective has 3 views, and I'm adding another view into the same perspective. To add this new view, I added it in the MANIFEST.MF file under Extensions tab and created the Java file for it.
When I run it as an Application, it works. I see all 4 views in the application. But, when I run it as a Product, that new view is missing. It almost seems like the new view is not registered in the Product. There's no error in the console log either. I think I must be missing a step here, but I can't seem figure out here... pretty frustrating!
Note: The views are added into the perspective programmatically (in Java code), not through MANIFEST.MF file. I just realized that even when I change the existing view's layout (ex: size, or location), it doesn't get reflected when running as a Product either, but it works when running as an Application... sigh!
Note: I commented out all the code in my perspective class, in another word, all the views are removed from the perspective. When I launch the Product, I'm still seeing 3 views in the application. I'm thinking there's something to do with caching, but I'm just bummed now.
Any helps are greatly appreciated here! Thanks much,
Okay, after aimlessly clicking around, I figured out the solution. The workspace data needs to be cleared to pick up changes from the perspective.
To do so...
Right click the product file
Choose "Run Configurations..."
Under "Main" tab, check "Clear" checkbox and "workspace" radio button.
Run it.
Hope this will save some of you from troubles.
I've been bitten by this a couple of times until I figured out the easiest workaround: it's sufficient to reset the perspective. There are two ways to achieve this:
Right-click on your perspective in the perspective selector bar at the top right and click on Reset.
Switch to your perspective and then go to Window | Reset perspective....
After that, the changes to your perspective should be picked up.
The discussion here describes the "display view" in eclipse which allows one to to quickly evaluate java expressions. The thing is, when I open the display view the icons remain greyed out and I can't execute anything. The only icon that isn't is "clear console". The odd thing is, alot of the screenshots on the web show the same behaviour but the people posting about the feature don't mentioned it. There aren't any options in the context sensitive menu either. I'm trying it on a java project. I've tried it in the debug view and I get the same issue.
I'll provide a screenshot once my hosting is sorted.
I'm using eclipse 3.4.
To be able to use it, you're supposed to be in debug mode (set a breakpoint to freeze execution). That gives you a context, a stack frame to work in.
Once you're there, you select expressions in the display view and only then can you execute them, evaluate etc. If no text in the view is selected, none of the actions will be available.
As I understand, the purpose of the 'Display' view is to allow to evaluate expression during debug sessions. Are you trying to evaluate some expressions statically (i.e. with no running application in debug mode)?
Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable's value. Instead, hover behaves as if I were in normal Java perspective:
alt text http://michaelzanussi.com/wp-content/uploads/2009/11/debug_hover.png
I've tried cleaning the project, re-importing it, etc., all to no avail. Anything I'm missing here?
I went to Window - Preferences - Java - Editor - Hovers, hit "Restore Defaults" and "Apply" and that fixed it for me, even though nothing actually changed in the settings...
Go to Window - Preferences - Java - Editor - Hovers.
Is "Combined Hover" selected? Uncheck it; apply; close the window; restart debugging session; go back; check it again; apply.
If the above doesn't help, you can check "Variable Values" option and specify a modifier key for it. Not as convenient as "combined", but should work.
I had this problem too once, I "just" had to restart eclipse, after that the hover mechanism worked again.
The problem was "fixed" by renaming the package.
For whatever reason, this refactoring triggered something in Eclipse, and immediately I was able to view variable values during debugging. Also, when I go back into Preferences under Hovers, I can now see the "Variable Values" option.
I had a similar issue and when I came across this question. My problem was that windows hover time was set to 20s or so (you can test if this is your problem by putting the mouse on a mistake and waiting for a min or so). The registry key "MouseHoverTime" was set to a large value of 200000 ms (normally 400). Fix it by going to start -> run -> "regedit" -> HKEY_CURRENT_USER\Control Panel\Mouse double click "MouseHoverTime" and setting it back to 400.
I think this had been done on my computer a while back to prevent hover popups in another program. Anyway, sorry that my answer doesn't directly apply to this question, but I'm hoping it'll help somebody like me that comes across this thread with a similar issue.
For C++ project, please add -ggdb -0g to the compiler option. Hope this solution can help eveyry C++ programer face with the same issue.