eclipse.platform icon indicating copy to clipboard operation
eclipse.platform copied to clipboard

Compare two objects in Variable View

Open laeubi opened this issue 2 years ago • 1 comments

Originally posted here:

  • https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/203

One thing I recently missed was that I have a breakpoint where it stops and I have two strings in the variable view.

It would helpful to select two String variables (of course would also be usefull for List, Map, ... ) and choose from the context menu "Compare with each other" and then get a Diff-View

laeubi avatar Mar 20 '23 05:03 laeubi

I also get this need for "comparative debugging" often, but usually, comparing the variables from 2 different executions, 2 different frames or 2 different stacks in general. As a result, both values I want to compare are not shown in the Variables view simultaneously. the trick I'm using, which is actually pretty easy and efficient, is to open another workbench window (Window > New Window) and to show the same debug perspective, and have 1 window focused on 1 stack frame and the other on another. Then I see the variables from the different frames and can easily compare them.

mickaelistria avatar Nov 23 '23 08:11 mickaelistria

@laeubi @mickaelistria can you please test/review https://github.com/eclipse-jdt/eclipse.jdt.debug/pull/581 if it resolves you demands?

jukzi avatar Jan 13 '25 08:01 jukzi

No, it does not. The Variable view is still populated from a single launch; what I'd like would be compare values from different launches (pinned inspect dialog helps a bit for that). Basically, allowing to add a column in the debug variable view for another launch so expanding the trees allow to the different values it takes on different launches.

mickaelistria avatar Jan 13 '25 08:01 mickaelistria

@mickaelistria that sounds like another usecase which could be handled separately. It should not render the given PR generally useless, does it?

jukzi avatar Jan 13 '25 10:01 jukzi

I think the PR is valid and solves an interesting use-case (comparing 2 random values from the same launch), so IMO this feature provided by the referenced PR is worth being merged.

mickaelistria avatar Jan 13 '25 11:01 mickaelistria

The Variable view is still populated from a single launch;

For me as a user the Variable view seems to show the first debugee that is selected in the Debug view. The Debug view allows multiselection. Maybe the Variable views could then show variables for all selected debugees and then also allow to compare those?

Image

jukzi avatar Jan 15 '25 14:01 jukzi