Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Can we ourselves type an expression in debugger and see its value?

 
Ranch Foreman
Posts: 1833
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw option in chrome debugger where a window comes on the bottom where one can type some expression say response[0].value(); and upon hitting enter it would show the value of this.

Is such an option there in Eclipse debugger.If so, where exactly  to find it while debugging ?

Thanks.
 
Bartender
Posts: 2704
130
Google Web Toolkit Eclipse IDE Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are debugging Java applications ...

When the editor hits a breakpoint, switch to debug perspective and you should probably see a tab called "Debug Shell". You can type anything there and click Display Result to see the result.
 
Monica Shiralkar
Ranch Foreman
Posts: 1833
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.Once eclipse stopped on a debug breakpoint, I tried to search for "debug view". I searched in windows under show view,but did not see an option for debug view .The only option with debug it shows there is "debug". Is there anywhere else where I need to search this option ?

 
salvin francis
Bartender
Posts: 2704
130
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you searched for the wrong term ? It's "Debug shell". I could spot it easily in the menu.
Check out the screenshot attached. In the screenshot, I am able to change the value of a variable while the code is running. This can also be done in the variables tab, but debug shell makes it more convenient since we can run actual code statements there.
Debug-shell-Screenshot.gif
[Thumbnail for Debug-shell-Screenshot.gif]
 
salvin francis
Bartender
Posts: 2704
130
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it helps, I am using



In the screenshot above.
 
Monica Shiralkar
Ranch Foreman
Posts: 1833
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Yes, I had searched in the same place. The only option I saw was debug. I clicked on other and entered "debug shell".There too I saw only debug option.

I am using Oxygen Eclipse Java EE for web developers. Not sure ,why I dont see debug shell in Windows -Show view.
 
Marshal
Posts: 25969
70
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Monica Shiralkar wrote:I clicked on other and entered "debug shell".There too I saw only debug option.



In the "Debug Shell" tab, type an expression. Select what you typed, right click the selection, and click on the "Display" option to evaluate the expression and display the result.
 
Monica Shiralkar
Ranch Foreman
Posts: 1833
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:

Monica Shiralkar wrote:I clicked on other and entered "debug shell".There too I saw only debug option.



In the "Debug Shell" tab, type an expression. Select what you typed, right click the selection, and click on the "Display" option to evaluate the expression and display the result.



Sorry. By "entered debug shell" I meant "typed debug shell ".

On clicking windows and then show view we see the options there .Since there was no "debug shell", I clicked on "other" and typed "debug shell" ,it was not there. So it means in the "show view " although debug is there ,there is not "debug Shell's option.
 
Paul Clapham
Marshal
Posts: 25969
70
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what all of that means, but Salvin already demonstrated how to open the debug shell by posting a picture.

Edit: Instead of selecting "Debug Shell" from the drop-down, you can select "Expressions" and that opens an "Expressions" tab next to the "Variables" and "Breakpoints" tab which you will already be familiar with. It's more obvious how to type expressions into that panel, Debug Shell isn't obvious. And although the name doesn't suggest that, the "Expressions" tab is used to store "watch expressions". Those are updated automatically as the task being debugged runs.
 
Master Rancher
Posts: 4710
49
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:I'm not sure what all of that means, but Salvin already demonstrated how to open the debug shell by posting a picture.



Monica is saying that when she does what Salvin shows that there is no "Debug Shell" option in the drop down.
Then, when selecting the "Other" option at the bottom of that drop down and then entering "Debug Shell" in the filter box that it does not appear either, implying that the view does not exist in her Eclipse.

Indeed, looking up the history of Debug Shell it looks like it came in with Photon, so is not available in Oxygen...which is 3 years old now or so?
 
Monica Shiralkar
Ranch Foreman
Posts: 1833
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Paul Clapham wrote:.

Edit: Instead of selecting "Debug Shell" from the drop-down, you can select "Expressions" .



Thanks.

Expressions give exactly what I was looking for.
 
We can fix it! We just need some baling wire, some WD-40, a bit of duct tape and this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic