4 * Project: libFIRM / Recoder frontend for libFIRM.
5 * File name: firmjni/Dbginfo.java
7 * Author: Goetz Lindenmaier
11 * Copyright: (c) 2003 Universitaet Karlsruhe
12 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
17 public class Dbginfo {
19 public Dbginfo (java.lang.Object file, int line)
25 // Set env var LD_LIBRARY_PATH accordingly.
27 System.loadLibrary("firmjni");
31 public static native void dbgInit ();
33 /** Return the dbg object index of the given node. A new dbg object is created, if needed. */
34 public static native int getDbgInfoIdx (int node);
36 /** Return the dbg object index of the given node, or <TT>-1</TT> if none has been set. */
37 public static native int doGetDbgInfoIdx (int node);
39 /** Return the dbg object of the given node, or <TT>null</TT> if none has been set. */
40 public static Dbginfo getDbgInfo (int node)
42 int idx = doGetDbgInfoIdx (node);
48 return (_infos [idx]);
51 public static void setDbgInfo (int node, java.lang.Object file, int line)
53 int idx = doGetDbgInfoIdx (node);
55 if (_infos.length < idx) {
56 Dbginfo [] infos = new Dbginfo [idx+1];
58 for (int i = 0; i < _infos.length; i ++) {
59 infos [i] = _infos [i];
65 _infos [idx] = new Dbginfo (file, line);
68 public static void myJavaDbgInfoMergePair(int new_node, int old_node, int info) {
69 System.out.println("Optimization: "+ info);
70 System.out.println("new Node " + Irnode.getIrnNodeNr(new_node));
71 System.out.println("old Node " + Irnode.getIrnNodeNr(old_node));
74 public static void myJavaDbgInfoMergeSets(int new_nodes[], int old_nodes[], int info) {
75 System.out.println("Optimization: "+ info);
76 System.out.print("new Nodes: ");
77 for (int i = 0; i < new_nodes.length; i++)
78 System.out.print(Irnode.getIrnNodeNr(new_nodes[i]) + ", ");
79 System.out.print("\nold Nodes: ");
80 for (int i = 0; i < old_nodes.length; i++)
81 System.out.print(Irnode.getIrnNodeNr(old_nodes[i]) + ", ");
82 System.out.println("");
86 <P>Return the file this debug info object is from:</P>
88 public java.lang.Object getFile ()
94 <P>Return which line this debug info object is from:</P>
101 private java.lang.Object _file;
104 private static Dbginfo [] _infos = new Dbginfo [1000];