weikipeng / javacpp

Automatically exported from code.google.com/p/javacpp
GNU General Public License v2.0
0 stars 0 forks source link

Improve debugging #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Could you add eg. '-debug' flag which will enable generation of JavaCPP_log 
calls with JNI method name as parameter to all methods. Such debug output would 
be useful on method begin and just before return statement.

Original issue reported on code.google.com by Dariusz.Luksza on 4 Mar 2013 at 4:11

GoogleCodeExporter commented 9 years ago
Could you provide a bit more details? How would you convert the arguments to 
strings?

Original comment by samuel.a...@gmail.com on 10 Mar 2013 at 1:09

GoogleCodeExporter commented 9 years ago
When I was experimenting with SIGSEGV for empty string's I've added simple 
output statement before each jni method call eg:

System.out.println("1");
obj.native1();
System.out.println("2");
obj.native2();

this way I was able to localize failing method. But his was painful and time 
consuming. The idea here is to have such 'logging' statements generated by 
JavaCPP eg:

NativeObj.native1();
NativeObj.native2();

Original comment by Dariusz.Luksza on 10 Mar 2013 at 1:35

GoogleCodeExporter commented 9 years ago
If you have a patch for Generator.java for the kind of functionality you would 
desire, please attach it here! It's not obvious to me exactly what would be 
best. Thanks

Original comment by samuel.a...@gmail.com on 8 Apr 2013 at 9:33