1 19 20 25 26 27 28 29 30 31 32 package soot.coffi; 33 import soot.*; 34 35 import java.io.*; 36 37 43 class LocalVariableTypeTable_attribute extends attribute_info { 44 45 public int local_variable_type_table_length; 46 47 public local_variable_type_table_entry local_variable_type_table[]; 48 49 55 public String getLocalVariableType(cp_info constant_pool[],int idx) { 56 return getLocalVariableType(constant_pool,idx,-1); 57 } 58 66 public String getLocalVariableType(cp_info constant_pool[],int idx,int code) { 67 local_variable_type_table_entry e; 68 CONSTANT_Utf8_info cu; 69 int i; 70 71 for (i=0;i<local_variable_type_table_length;i++) { 74 e = local_variable_type_table[i]; 75 if (e.index==idx && 76 (code==-1 || 77 (code>=e.start_pc && code<=e.start_pc+e.length))){ 78 81 83 if (constant_pool[e.signature_index] instanceof CONSTANT_Utf8_info) 84 { 85 String n = ((CONSTANT_Utf8_info)(constant_pool[e.signature_index])).convert(); 86 G.v().out.println("found type: "+n); 87 } 92 else { 93 throw new RuntimeException ( "What? A local variable type table " 94 +"signature_index isn't a UTF8 entry?"); 95 } 96 } 97 } 98 return null; 99 } 100 101 public String toString() 102 { 103 StringBuffer buffer = new StringBuffer (); 104 105 for(int i = 0; i < local_variable_type_table_length; i++) 106 { 107 buffer.append(local_variable_type_table[i].toString() + "\n"); 108 } 109 110 return buffer.toString(); 111 } 112 } 113 114 | Popular Tags |