What is the difference between Smart Data and Data tabs in JDeveloper debugger? - jdeveloper

I want to know the difference between the two tabs called Data and Smart Data tabs inside the debugger view of Jdeveloper ? When I tried to debug, I am seeing same data in both tabs .

The Debugger window's Data tab shows all variables that are currently in scope and this can be potentially overwhelming if there are a lot of variables. One solution to this is to set up "Watches" on variables you pick so you can focus on just the variables you're interested in, these appear in the Watches tab. This is okay but requires some leg work on your part as you need to configure all the watches and becomes a bit of debugging pain in the butt. Smart data works differently in that it assumes that you'll be interested in variables +/- X lines of where the current debugger line is instead, and it will automatically show and hide the variables in the Smart Data tab as you debug down the code lines based on this sliding window of +/- lines.
It is configured via Preferences -> Debugger -> Smart Data -> Number of Lines to Analyze.

Related

Is there a way to properly dump the navigation history in Visual Studio?

Very frequently, I will be looking for a specific section of code where something happens, and will reach there by starting at a function at a high level of abstraction and go lower by successively opening the code of called methods. Eventually I will find what I'm looking for, and I would like to save the path that I took to get there - which is pretty much what the call stack would be if I had put a breakpoint in that code and stopped here at runtime, except that I'm just inspecting the code.
I'm aware the little arrow next to the "Back" arrow lets me somewhat get that in the UI and I can then take a screenshot of what I'm shown, but that's not a fantastic solution. The names of the functions are trimmed (leading to cases where it could match several functions), the line number is seldom shown (only if there was no code at that line), and I would much rather have the text format to begin with so I can copy the function names into a search tool rather than type them from the screenshot later.
So I was wondering: is there a way to dump the navigation history in Visual Studio ?
Where I could for ex. ask for the last 50 cursor positions, and get the file, file path, line number & possibly the code at that line in text format or some more intelligent thing, should the IDE support that.
Thanks.
PS: I found this very similar question Is there extension for viewing navigation history in Visual studio? that's >5 years old and didn't have a satisfying answer, so I'm trying my luck again, hoping things have changed since if there was no solution back then.

Navigating within Visual Studio DataTip

When a DataTip is open while debugging in Visual Studio it appears the only way to get to a specific object property is scrolling with the mouse.
This can get very cumbersome as some objects can have hundreds of properties and scrolling to a property near the bottom takes a long time.
Yes, I know I can scroll faster if I hover the mouse over the bottom edge and pin a property once I found it but it can still take a long time to get to the property and pin it.
I've tried various combinations with Ctrl and Alt but what ever key I press the DataTip is promptly closed...
Once the DataTip has focus, you don't have to use the mouse. You can use the PgUp/PgDn (Page Up/Page Down) keys on your keyboard. But you're right: There is not a way to get to the end of the list or to get to items that start with a certain letter. When I need to do that often I take one of two approaches:
If possible, I create a [temporary] variable assignment after the code-line of interest and ensure that the variable gets assigned to the property of interest.
Create a watch variable and interact with that.
Open an Immediate Window and paste a copy of the object-instance name in question. Once in the Immediate Window, IntelliSense is available as soon as you type the "."--you can then type the letter of the property in question and drill-down as needed more quickly.
(Probaby the best tip!)
Open (and keep open for convenience) a Debug | Windows | Autos and/or Debug | Windows | Locals window. Those windows simplify navigating variables near the code break or in the current module--and they even seem to retain their tree-node-expanded state in some cases while debugging. More information is available here: https://msdn.microsoft.com/en-us/library/bhawk8xd.aspx
You could use the oz-code as an extension tool which could help you search the properties or variables easily.
Search in debug mode inside an object

Can I set a conditional breakpoint without specifying a specific location?

Similar questions: One, Two. But this is not what I am looking for.
Similar questions, but said options are diabled: Three, Four, Five.
Situation: I want to identify the line where the value of the variable ApplianceState changes to the value normal. ApplianceState is an enum type and can have one of 4 different values. The project I am working on is quite huge and looking for it line-by-line could take days.
Question: Is there a way I can set a watch so that visual studio breaks at the line where the value of ApplianceState changes to normal?
I know I can set a conditional breakpoint, but that would mean I have to set a break point on certain line, and I don't want to do that.
Also, I have enabled native code debugging and the menu item New Data Breakpoint, in menu Debug -> New Breakpoint, is disabled (greyed out). So, I can't select it.

RStudio: Move Code to Center of Editor

I am not sure if this is a reasonable expectation or whether there are other IDEs that have this feature, but when I am writing code in the RStudio editor, once I have written a sufficient amount of code, I am basically always editing at the bottom of the screen:
Is there a way to move the code to the middle of the screen without having to type "Enter" a bunch of times (trailing newlines are code too :-))?
You can keep scrolling by clicking an option in the settings:
Tools -> Global Options -> Code -> Display -> Allow scroll past end of document
This only affects scripts, and not the console.
So, uh.. you got some more of that fake internet points?

Eclipse: Improve debugging and display variable values on mouseOver

Is it possible to view variable values in Eclipse when debugging? Right now when I "mouse over" a variable all I get is the definition.
e.g. for [int mLastView] I get [com.company.samples.MyClass.mLastView] instead of 1. The value that was assigned to it.
Also, is there anyway to improve debugging in Eclipse?
For starter: making the breakpoints visible as in VS (see below)?
Eclipse Break Point
Visual Studio Break Point
I posted this over at Stack Overflow and one of the suggestions was to go into Window -> Preferences -> Java -> Editor -> Hovers and select the Variable Values option and assign a modifier.
When I was first trying to resolve this issue, this was one of the options I looked at, but oddly enough, there was no Variable Values preference available, it was missing. Once my “fix” above was applied, it magically appeared:
Click to see the pictureBroken Link
Actually, since eclipse3.4, not only do you see the value of a variable when you pass the mouse over it, you can actually inspect it:
When debugging, hovers for variables have been enhanced to display an object inspector. The inspector will display logical structures according to the toggle setting in the visible Variables or Expressions view.
If you hit the breakpoint while you are debugging, you do see the value of the variable when you mouse over. You can also select an expression, and inspect the value of it's evaluation using the "Inspect" menu option. You can also use the "Variables" view to see the current value of all in-scope variables.
About breakpoint visibility:
Right-click on the right outline of the editor, you'll see some Preferences, and there in Annotations you can select Breakpoints. I personally added Text as Highlighted and some pinky colour. Shame that the highlighting is really buggy, sticks here and there, breaks between lines, etc. But it somehow works for most cases.
(Another shame is that breakpoint bullet is often hidden behind some suggestion icon or what - why they can't make the gutter wider like Idea does, I don't know.)
I got similar but a little different problem with the thread-starter. Sometimes during debugging, I mouse over a variable, I see it current value. Sometimes it's just the definition, like in coding mode. So what caused the first case, what the second?
PS: Of course I can always choose to view Variables (Alt+Shift+Q,V) but it's faster if you have mouse over value instantly.
Thanks

Resources