DEBUGGING NATIVE EXTENSIONS OF DYNAMIC LANGUAGES Jacob Kreindl, Manuel Rigger, Hanspeter Mössenböck 15th International Conference on Managed Languages & Runtimes, September 13, 2018
GRAALVM FOR DYNAMIC LANGUAGES 13.09.2018 Jacob Kreindl, ManLang’18 4 Language Front-End Language Front-End Language Front-End Language-Agnostic Program Representation op1 op2 if else then op3 op4 Source Location
GRAALVM FOR DYNAMIC LANGUAGES 13.09.2018 Jacob Kreindl, ManLang’18 4 Debugger Back-End Chrome Debugger Netbeans Debugger Other Front-Ends Language Front-End Language Front-End Language Front-End Language-Agnostic Program Representation op1 op2 if else then op3 op4 Source Location
OUR CONTRIBUTIONS 13.09.2018 Jacob Kreindl, ManLang’18 6 LLVM-IR Sulong Language-Agnostic Program Representation + Run-Time Debug Information LLVM Front-End (Clang, Dragonegg, …) Debugger Back-End with Debug Information + DI Parser op1 op2 if else then op3 op4 Scope & Location Value Tracking Abstraction to Source-Level
EXAMPLE 13.09.2018 Jacob Kreindl, ManLang’18 9 #include "ruby.h" int fact(int n) {…} VALUE callFact(VALUE self, VALUE num) { int n = NUM2INT(num); int result = fact(n); return INT2NUM(result); } void Init_FactExt() { VALUE FactExt = rb_define_module("FactExt"); rb_define_method(FactExt, "fact", &callFact, 1); }
EXAMPLE 13.09.2018 Jacob Kreindl, ManLang’18 10 require("./FactExt.su") include FactExt (0..12).each do |n| f = FactExt::fact(n) puts "fact(" + n.to_s + ") = " + f.to_s end
IN CONCLUSION Same Debugger Front-End for all Languages Single Run-Time Environment 13.09.2018 Jacob Kreindl, ManLang’18 12 Execute & Debug Native Extensions
IN CONCLUSION Same Debugger Front-End for all Languages Single Run-Time Environment Source-Level Stepping & Breakpoints 13.09.2018 Jacob Kreindl, ManLang’18 12 Execute & Debug Native Extensions
IN CONCLUSION Same Debugger Front-End for all Languages Single Run-Time Environment Source-Level Stepping & Breakpoints Cross-Language Symbol Inspection 13.09.2018 Jacob Kreindl, ManLang’18 12 Execute & Debug Native Extensions
JOHANNES KEPLER UNIVERSITY LINZ Altenberger Str. 69 4040 Linz, Austria www.jku.at Thank you for your attention! QUESTIONS? Read the Paper Watch the Demo