Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Jacob Kreindl

September 13, 2018
Tweet

Other Decks in Programming

Transcript

  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. 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
  3. 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
  4. 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
  5. 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
  6. 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; }
  7. 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); }
  8. 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
  9. IN CONCLUSION  Same Debugger Front-End for all Languages 13.09.2018

    Jacob Kreindl, ManLang’18 12 Execute & Debug Native Extensions
  10. 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
  11. 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
  12. 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
  13. 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