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 name of a debug action. */
40 public static native String dbgActionToString (int action);
42 /** Return the dbg object of the given node, or <TT>null</TT> if none has been set. */
43 public static Dbginfo getDbgInfo (int node)
45 int idx = doGetDbgInfoIdx (node);
51 return (_infos [idx]);
54 public static void setDbgInfo (int node, java.lang.Object file, int line)
56 int idx = doGetDbgInfoIdx (node);
58 if (_infos.length < idx) {
59 Dbginfo [] infos = new Dbginfo [idx+1];
61 for (int i = 0; i < _infos.length; i ++) {
62 infos [i] = _infos [i];
68 _infos [idx] = new Dbginfo (file, line);
71 public static void myJavaDbgInfoMergePair(int new_node, int old_node, int action) {
72 System.out.println("Optimization: "+ dbgActionToString(action));
73 System.out.println("new Node " + Irnode.getIrnNodeNr(new_node));
74 System.out.println("old Node " + Irnode.getIrnNodeNr(old_node));
77 public static void myJavaDbgInfoMergeSets(int new_nodes[], int old_nodes[], int action) {
78 System.out.println("Optimization: "+ dbgActionToString(action));
79 System.out.print("new Nodes: ");
80 for (int i = 0; i < new_nodes.length; i++)
81 System.out.print(Irnode.getIrnNodeNr(new_nodes[i]) + ", ");
82 System.out.print("\nold Nodes: ");
83 for (int i = 0; i < old_nodes.length; i++)
84 System.out.print(Irnode.getIrnNodeNr(old_nodes[i]) + ", ");
85 System.out.println("");
89 <P>Return the file this debug info object is from:</P>
91 public java.lang.Object getFile ()
97 <P>Return which line this debug info object is from:</P>
104 private java.lang.Object _file;
107 private static Dbginfo [] _infos = new Dbginfo [1000];