Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Multi-level Debugging for Interpreter Developers at LaMOD'16

416 views

Published on

Conventional debuggers require programmers to work on multiple levels of abstraction at once when inspecting call stacks or data. This demands considerable cognitive overhead and deep system knowledge of all implementation technologies involved. When developing an interpreter, programmers often create a dedicated debugger to have a higher-level perspective on the client-language; the resulting use of multiple debuggers at once leads to mental context switches and needs an elaborated method.

We present an integrated debugging tool in which interpreter developers define and select the levels of abstraction on which they focus. Our debugger provides them with an abstraction-specialized view. We consider both host-language and guest-language levels, since either may be levels of interest in a debugging session. We show how this separation into host-language levels can ease the debugging of applications through filtering call stacks and specializing call stack representation on levels.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Multi-level Debugging for Interpreter Developers at LaMOD'16

  1. 1. Multi-level Debugging for Interpreter Developers Bastian Kruck, Stefan Lehmann, Christoph Kessler, Jakob Reschke, Tim Felgentreff, Jens Lincke, Robert Hirschfeld Software Architecture Group, HPI Potsdam 15.03.2016, LaMOD16, Málaga
  2. 2. 1. Debugging across Languages 2. Debugging within Languages across Abstraction Barriers 3. Unification of such levels Three Phases Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck Chart 2
  3. 3. How does debugging across languages look like? Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck Chart 3
  4. 4. How does debugging across languages look like? Chart 4 Bastian Kruck HPI Potsdam Multi-level Debugging for Interpreter Developers
  5. 5. Scheme embedded in Qoppa Chart 5 Scheme Qoppa Embedded in (define if (vau (b t f) env (eval env (bool (eval env b) t f)))) (define quote (vau (x) _ x)) ■ Qoppa is a Scheme without special forms: all arguments are evaluated before entering the method ■ Vau is the only explicitly evaluating primitive (no automatic evaluation) ■ Vau is used to implement all other special forms Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  6. 6. Scheme embedded in Qoppa Chart 6 Scheme Qoppa (define if (vau (b t f) env (eval env (bool (eval env b) t f)))) (define quote (vau (x) _ x)) Smalltalk Embedded in Interpreted by Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  7. 7. How to teach language barriers to a debugger?
  8. 8. The common symbolic debugger Chart 8Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  9. 9. The Minimal Feature Set of a Debugger Chart 9 Step buttons Call Stack Helps to zoom from behavioral overview into detailOverview Detail Source View Helps to look at the past and future Future Past Object Inspector Helps to interact with state of the current Level of details • Detail State • Detail State • Detail State Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  10. 10. eval:in: Call stack of QoppaS Chart 10Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  11. 11. Call stack of QoppaS Chart 11 operate:on:in: Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  12. 12. Call stack of QoppaS Chart 12 Operative>>in:operateOn: Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  13. 13. Call stack of QoppaS Chart 13 wrapPrim:countingArgs: Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  14. 14. Call stack of QoppaS Chart 14 buildGlobalEnv Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  15. 15. Call stack of QoppaS Chart 15 • Recurrence Patterns in call stacks signal an unnoticed abstraction level • The varying barrier- width makes it hard to read • Debugger users should be able to: • Filter stack frames • Fold open levels on demand Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  16. 16. Higher-level information are encoded in all those Chart 16 Step buttons Call Stack Various barrier- widths are present in the call chainOverview Detail Source View Source code implements abstract concepts such as events or state machines Future Past Object Inspector Data contain implementation specifica such as storage strategies • Detail State • Detail State • Detail State Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  17. 17. How to teach language abstraction barriers to a debugger?
  18. 18. ■ Data abstraction enables modularity □ Isolate math domain implementation □ Isolate abstract type □ Isolate representation details ■ Behavioral black-box abstractions to enable modularity ■ Not present in current debugging tools ■ Interpreters form a new layer of abstractions that is loosely coupled to the lower one □ because of that very explicit interface □ A program is the interpreters data Abstraction barriers should be respected in debuggers Chart 18 Structure and Interpretation of Computer Programs Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  19. 19. Current debuggers that respect abstraction barriers: ■ Rails BacktraceCleaner ■ Visual studio with Show only my code ■ Eclipse with Step filters □ AOP & COP □ Code metrics ■ Squeak UnhandledException ■ Squeak Step through There is no general abstraction-aware debugger so far (Current state of abstraction barriers in debuggers) Chart 19Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  20. 20. (define (fact-r n acc) (if (<= n 1) (begin (halt) acc) (fact-r (- n 1) (* acc n)))) (fact (- 5 2)) Example of a Multi-level Debugger Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck Chart 20
  21. 21. Chart 21Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  22. 22. Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck Chart 22
  23. 23. Chart 23 Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  24. 24. Chart 24 Grouping frames by interpreter frames Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  25. 25. Chart 25 Specialized Representation Grouping frames by interpreter frames Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  26. 26. Call stack of QoppaS Chart 26Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  27. 27. Chart 27 Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  28. 28. Chart 28 Level icons show level affiliation
  29. 29. Chart 29 Filter levels to focus e.g. Smalltalk Packages, or Authoring sessions Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  30. 30. ■ By package ■ By class ■ By author ■ By creation time ■ By JIT-Optimization-State (Identifying levels) Chart 30Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  31. 31. Implementation of both Language barriers Abstraction barriers
  32. 32. „A mediator is a software module that exploits encoded knowledge about certain sets or subsets of data to create information for a higher layer of applications“ [Wie92] Mediator-Wrapper-Architecture Chart 32 Mediator Higher level information Encoded Knowledge Data Data Gio Wiederhold: “Mediators in the Architecture of Future Information Systems” Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  33. 33. Mediators enrich call frames Chart 33 Title Icon Group Source Data State Multi-level Debugger INOUT Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  34. 34. Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck Mediator-Wrapper-Architecture Chart 34 Squeak VM Reflection: Squeak contexts Vivide QoppaS Interpreter Squeak Primitives Qoppa Language … Multi- level Debugger … WIP
  35. 35. Future Work: Debugger Primitives Chart 35 Multi-level Debugger Scheme Language Squeak as implementation language Qoppa as implementation language Qoppa Language Debugger Primitive ■ Reuse low-level debugger for higher levels ■ Cross level functionality comes for free Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  36. 36. Multi-level Debugging for Interpreter Developers Thanks for your frameworks and support: Marcel Taeumel (VIVIDE), Patrick Rein (OhmS) Thanks to Mod16 and SWA Group for funding Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  37. 37. [1] Charles, P. et al. 2009. Accelerating the creation of customized, language-Specific IDEs in Eclipse. ACM Sigplan Notices. 44, 10 (2009), 191. [2] Chiş, A. et al. 2015. Practical domain-specific debuggers using the Moldable Debugger framework. Computer Languages, Systems and Structures. 44, (Dec. 2015), 89–113. [3] Chiş, A. et al. 2015. The moldable inspector. 2015 ACM - Onward! 2015 (New York, New York, USA, Oct. 2015), 44–60. [4] Erdweg, S. et al. 2012. Language Composition Untangled. LDTA ’12. (2012). [5] Freudenberg, B. et al. 2014. SqueakJS A Modern and Practical Smalltalk that Runs in Any Browser. DLS ’14. (2014), 57–66. [6] Pavletic, D. et al. 2014. Extensible Debuggers for Extensible Languages. Softwaretechnik-Trends. 33, 2 (2014), 51–52. [7] Pavletic, D. and Raza, S.A. 2015. Multi-Level Debugging for Extensible Languages. Workshop Software-Reengineering und -Evolution. 17 (2015), 21–23. [8] Renggli, L. et al. 2010. Embedding Languages Without Breaking Tools. ECOOP. (2010), 380–404. [9] Wu, H. et al. 2004. Debugging Domain-Specific Languages In Eclipse. Eclipse Technology Exchange Poster. (2004), 1– 5. Related Work Chart 37Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck
  38. 38. Debugger Primitives ■ How to bake them into the known reflective capabilities of languages? Challenges Chart 38Multi-level Debugging for Intrepreter Developers, LaMOD’16, 15.03.2016, Bastian Kruck

×