Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a plugin for eclipse to examine 2D arrays while debugging?

I'm looking for a plug-in which displays a 2D array as a table while debugging. It will be great if it allows:

  • scrolling
  • searching
  • assigning different fg/bg colors to different values

Currently I'm using a utility class whose toString method returns a string like:

0[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
1[ 0, 1, 1, 1, 1, 0, 1, 1, 0, 1]
2[ 0, 0 ...

so while debugging in eclipse I can create an expression like :

new Array2Dformatter(array)
like image 268
Erdem Avatar asked Feb 26 '11 16:02

Erdem


People also ask

How can you see variable references while debugging in Eclipse?

While debugging you can use the "Display" window where you can write pieces of code and "execute" them with inspect (highlight the code -> right click -> inspect). In that window you have access to all variables of the breakpoint's context.


2 Answers

What exactly do you need this for? I think your solution is the best, but you should consider using the debug tools provided to you by Eclipse.

Is this for java?

like image 50
danyim Avatar answered Oct 15 '22 18:10

danyim


Cool idea..

I usually do the following. I use the Eclipse Debug tools, like the Variables view, Inspect option and Display view. To get what you want try this one out. During debug, go to the Variables view, right click the variable and select New Detail Formatter...

Do that and you can display your array in the Variable view in the way you want (you need to put your toString() code here). Hope this works.

like image 29
Henry Avatar answered Oct 15 '22 17:10

Henry