Eclipse 1,a) 1,b) 1,c) ( IDE) IDE Graphical User Interface( GUI) GUI GUI IDE View Eclipse Development of Eclipse Plug-in to present an Object Diagram to Debug Environment Kubota Yoshihiko 1,a) Yamazaki Sho 1,b) Shigo Osamu 1,c) Abstract: In Eclipse Debug Environment, it is difficult that a user understand relationships between objects. The debug environment has Variables View that is hierarchical structure. The user must expand it manually for confirming variable s value. By using object diagram, the user can easily understand relationships between objects. In this paper, we propose to use object diagram in the debug environment. When a program execution is stopped at a breakpoint, our plug-in presents its object diagram. Keywords: Debug Environment, Object Diagram, Eclipse Plug-in 1. IDE GUI 1 Tokyo Denki University, Inzai, Chiba 70 138, Japan a) y.kubota@mail.dendai.ac.jp b) 15jkm@ms.dendai.ac.jp c) shigo@mail.dendai.ac.jp Eclipse Eclipse c 016 Information Processing Society of Japan 1
. IDE JIVE[1][] Eclipse Java ( 1) Java Platform Debugger Architecture [5] 3. Eclipse GUI JIVE 3.1 Eclipse ( ) 1 JIVE Java [3] IDE c 016 Information Processing Society of Japan
3. UML ( 3) id : id Eclipse id ObjectReference.uniqueId() : = id id HashMap ( 5 ) id id 4. 3 Main.java( 4) Class1.java( 5) Class.java( 6) Class1 Class value Class int String value name Main( 4) 6 7 3 1 package sample; 3 public class Main { 4 public static void main(string[] args) { 5 Class1 c1 = new Class1(new Class(1, "c1")); 6 Class1 c = new Class1(new Class(, "c")); 7 } 8 } 4. 4 Main.java 4.1 Eclipse Java Java Development Tools( JDT) JDIDebugTarget ( 1 ) ( ) Java ( 3 ) JDI ReferenceType instances(0) id HashMap ( 4 ) JDI ObjectReference referringobjects(0) 1 package sample; 3 public class Class1 { 4 private Class value; 5 public Class1(Class value){ 6 this.value = value; 7 } 8 public Class getvalue(){ 9 return this.value; 10 } 11 } 5 Class1.java c 016 Information Processing Society of Japan 3
1 package sample; 3 public class Class { 4 int value; 5 String name; 6 public Class(int value, String name){ 7 this.value = value; 8 this.name = name; 9 } 10 public int getvalue(){ 11 return this.value; 1 } 13 public String getname(){ 14 return this.name; 15 } 16 } 6 Class.java Variables View c1 (id=434) value Class (id=435) value Class GUI 7 Variables View GUI 8 JIVE Variables View Eclipse Variables View id 435 value 999 ( 9) / ( 14) 7 9 8 7 Eclipse 4.3 ArrayList JIVE ArrayList Visitor [4] JIVE 10 c 016 Information Processing Society of Japan 4
10 11 JIVE Directory ArrayList ArrayList Directory File 11 JIVE JIVE c 016 Information Processing Society of Japan 5
11 Stacked with Tables Directory 5 File File Directory 5. JDI JIVE ( 1 ) ( ) GUI Mac Book Pro 15,Intel Core i7.8ghz 16G JDK 1.8.0 73 5.1 JIVE ( 1) (N ) 1 14 5 ( 1) JIVE 1.1 1.5 JIVE 10000 15000 JIVE JIVE 1 package benchmark; 3 import java.util.arraylist; 4 import java.util.list; 5 6 public class Main { 7 8 public static void main(string[] args) { 9 List<Main> list = new ArrayList<>(); 10 Long start = System.nanoTime(); 11 for(int i=0; i<n;i++) 1 list.add(new Main()); 13 System.out.println(System.nanoTime() start); 14 System.out.println("end"); 15 } 16 } 1 1 N (ms) JIVE(ms) (ms) 100 0.07 703.07 0.10 00 0.11 1498.73 0.17 + 1 500 0.5 396.14 0.30 + 3 1000 0.47 6837.75 0.5 + 10 JFrame,JPanel,JButton 1 ( 15) 17 5.7ms 3.1ms ( 14) JIVE 1 5. GUI GUI 13 13 GUI c 016 Information Processing Society of Japan 6
14 GUI 1 package button; 3 import javax.swing.jbutton; 4 import javax.swing.jframe; 5 import javax.swing.jpanel; 6 7 public class ButtonFrame extends JFrame{ 8 public ButtonFrame(){ 9 this.settitle("button1"); 10 this.setsize(00, 100); 11 this.setdefaultcloseoperation( 1 JFrame.EXIT ON CLOSE); 13 JPanel panel = new JPanel(); 14 JButton button = new JButton(" "); 15 panel.add(button); 16 this.getcontentpane().add(panel); 17 this.setvisible(true); 18 } 19 0 public static void main(string[] args){ 1 new ButtonFrame(); } 3 } 15 GUI 6. Eclipse JIVE ArrayList JIVE JIVE JIVE Java JDI c 016 Information Processing Society of Japan 7
VirtualMachine.canGetInstanceInfo() true, ReferenceType.instances(long) ObjectReference.referringObjects(long) Java [1] Czyz, Jeffrey K., and Bharat Jayaraman. Declarative and visual debugging in eclipse. Proceedings of the 007 OOPSLA workshop on eclipse technology exchange. ACM, 007. [] JIVE: Java Interactive Visualization Environment http://www.cse.buffalo.edu/jive/ [3],, and.. 015 015 (015): 19-136. [4]. Java. SB, 004. [5] Alsallakh, Bilal, et al. Visual tracing for the eclipse java debugger. Software Maintenance and Reengineering (CSMR), 01 16th European Conference on. IEEE, 01. c 016 Information Processing Society of Japan 8