Debugging Native Extensions of Dynamic Languages

Debugging Native Extensions of Dynamic Languages

Presentation of the paper "Debugging Native Extensions of Dynamic Languages" at ManLang'18.

Check out the screen recording of the demo at https://youtu.be/6znqkxvZhsI

46bdaded3636a5f4d544af448aeee7df?s=128

Jacob Kreindl

September 13, 2018
Tweet

Transcript

  1. 1.

    DEBUGGING NATIVE EXTENSIONS OF DYNAMIC LANGUAGES Jacob Kreindl, Manuel Rigger,

    Hanspeter Mössenböck 15th International Conference on Managed Languages & Runtimes, September 13, 2018
  2. 12.
  3. 13.

    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
  4. 14.

    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
  5. 17.

    GRAALVM FOR NATIVE EXTENSIONS 13.09.2018 Jacob Kreindl, ManLang’18 5 LLVM-IR

    LLVM Front-End (Clang, Dragonegg, …) Sulong Language-Agnostic Program Representation op1 op2 if else then op3 op4 Debugger Back-End
  6. 18.

    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
  7. 20.

    EXAMPLE 13.09.2018 Jacob Kreindl, ManLang’18 8 int fact(int n) {

    int result = 1; if (n > 0) result = n * fact(n - 1); return result; }
  8. 21.

    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); }
  9. 22.

    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
  10. 25.

    IN CONCLUSION  Same Debugger Front-End for all Languages 13.09.2018

    Jacob Kreindl, ManLang’18 12 Execute & Debug Native Extensions
  11. 26.

    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
  12. 27.

    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
  13. 28.

    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
  14. 29.

    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