Introduction of Tools for providing rich user experience in debugger

N
Introduction of Tools for providing
rich user experience in debugger
Ruby Kaigi 2022
Naoto ONO
Naoto ONO
● Developer Productivity Group at CyberAgent, Inc.


● ruby/debug (debug.gem) contributor


○ Chrome Integration


○ Test framework


● GitHub: @ono-max
debug.gem
● Ruby standard library for debugger from 3.1


● High performance compared to existing debuggers.


● You can debug Ruby program with the following tools:


○ rdbg (CLI)


○ VS Code


○ Chrome DevTools


○ Neovim


○ …
Let’s know what part of this talk you should focus
● This talk consists of two sessions


● From now, you’ll answer some yes/no questions, then you’ll know which
part to concentrate on the session 1, or session 2
???
Do you use
debug.gem?
YES
NO
??? ??? ???
Do you use
debug.gem?
Do you use VS Code when
debugging a program?
YES
NO
YES NO
Session 2
Do you use
debug.gem?
Do you use VS Code when
debugging a program?
YES
NO
YES NO
Session 1 Session 1
Session 2
Do you use
debug.gem?
Do you use VS Code when
debugging a program?
YES
NO
YES NO
Session 1 Session 1
I’ll talk debugging Ruby
program in Chrome
DevTools for these
people!
I’ll talk debugging Ruby program in
Chrome DevTools for these
people!
Session 2
Do you use
debug.gem?
Do you use VS Code when
debugging a program?
YES
NO
YES NO
Session 1 Session 1
I’ll talk tools for
supporting VS Code
debugging!
Agenda
● Session 1: About Chrome DevTools debugging


○ This session includes basic functions in a debugger, too.


● Session 2: About tools for supporting debugging in VS Code


○ This session is about tools related to debugging, not about the
debugger itself.
Agenda
● Session 1: About Chrome DevTools debugging


○ This session includes basic functions in a debugger, too.


● Session 2: About tools for supporting debugging in VS Code


○ This session is about tools related to debugging, not about the
debugger itself.


Goal: Everyone wants to use tools in this talk!
I’m very glad if I can get
your feedbacks, too 😁
About Chrome DevTools debugging
What is Chrome DevTools?
Pause the program at line 4!
Set the breakpoint at line 4
View and Change the
DOM
Debug JavaScript
View HTTP request
and response
What is Chrome DevTools?
Pause the program at line 4!
Set the breakpoint at line 4
View and Change the
DOM
Debug JavaScript
View HTTP request
and response
Do you know how to debug JavaScript in Chrome DevTools?
Pause the program at line 4!
Do you know how to debug JavaScript in Chrome DevTools?
Do you know how to debug JavaScript in Chrome DevTools?
Do you know how to debug JavaScript in Chrome DevTools?
You can debug Ruby
program here!!
Do you know how to debug JavaScript in Chrome DevTools?
The motivation of supporting Chrome DevTools
I’d like to debug Ruby program in rich UI such as VS Code, but…
I’d like to debug Ruby program in rich UI such as VS Code, but…
● I’m non-user of VS Code
I’d like to debug Ruby program in rich UI such as VS Code, but…
● I’m non-user of VS Code


● it’s hard to install VS Code for any reason
We installed Google Chrome on your laptop, don’t we?
We installed Google Chrome on your laptop, don’t we?
● By supporting Chrome DevTools debugging, we can provide rich user
experience to non-users of VS Code!
We installed Google Chrome on your laptop, don’t we?
● By supporting Chrome DevTools debugging, we can provide rich user
experience to non-users of VS Code!


● Project Goal: Implement functions in Chrome DevTools are comparable to
those in VS Code
Demonstration: Using a debugger in Chrome DevTools
class SampleClass


def initialize arg1, arg2


@arg1 = arg1


@arg2 = arg2


end


end


def sample_method


a = 1


b = 2


c = 3


a + b + c


end


s = SampleClass.new 1, 2


sample_method()


sample_method()


sample_method()


sample_method()


sample_method()
Sample Script to
debug in the
demonstration
Introduction of Tools for providing rich user experience in debugger
How do Chrome DevTools communicate


with debug.gem?
Chrome DevTools Protocol (CDP)
Client: Chrome DevTools Server: debug.gem
Chrome DevTools Protocol (CDP)
Click “Step Into”
Client: Chrome DevTools Server: debug.gem
Chrome DevTools Protocol (CDP)
Click “Step Into”
Client: Chrome DevTools Server: debug.gem
Step Into
Chrome DevTools Protocol (CDP)
Click “Step Into”
Client: Chrome DevTools Server: debug.gem
Step Into
ACK
Chrome DevTools Protocol (CDP)
Client: Chrome DevTools Server: debug.gem
Click “Step Into”
Step Into
Paused at line 5
ACK
What we can’t do in Chrome DevTools debugging
● Code completion in Chrome Console


● Supporting thread interface


● Coloring code
Summary for session 1
● You can debug Ruby program in Chrome’s rich UI easily.


○ You don’t have to install any tools except for Chrome.


● Chrome DevTools Protocol (CDP) is used between debug.gem and
Chrome DevTools.
The topic about Chrome DevTools is finished!
Session 2
Do you use
debug.gem?
Do you use VS Code when
debugging a program?
YES
NO
YES NO
Session 1 Session 1
Thank you for waiting
VS Code users!
About tools for supporting debugging in VSCode
rdbg-inspector
● Tools for supporting debugging in VS Code


● rdbg-inspector is WIP project which means it’s not released yet
Features for rdbg-inspector
● ???


● ???
Features for rdbg-inspector
● ???


● ???
I know it’s quite sudden, but…
We want to go back to some points when debugging it, don’t we?
● What was the value of variable “a” when program was paused at line
6…?
We want to go back to some points when debugging it, don’t we?
● What was the value of variable “a” when program was paused at line
6…?


● I’d like to see the procedure here again…
We want to go back to some points when debugging it, don’t we?
Demonstration: Going back to some points in debugger
class SampleClass


def initialize arg1, arg2


@arg1 = arg1


@arg2 = arg2


end


end


def sample_method


a = 1


b = 2


c = 3


a + b + c


end


s = SampleClass.new 1, 2


sample_method()


sample_method()


sample_method()


sample_method()


sample_method()
Sample Script to
debug in the
demonstration
Introduction of Tools for providing rich user experience in debugger
● You can go back and forth between the program by clicking recorded
execution logs


● History Inspector is realized by Step Into and Step Back feature in
debug.gem.
History Inspector
Features for rdbg-inspector
● History Inspector


● ???
Features for rdbg-inspector
● History Inspector


● ???
Debugging rails app in VS Code
Debugging rails app in VS Code
Debugging rails app in VS Code
Using Debug Console in VS Code
Using Debug Console in VS Code
Evaluation of Active Record object
Computer class is Active
Record.
Evaluation of Active Record object
Tree View of Active Record object
Tree View of Active Record object
This is useful, but…
It’s useful if we can see Active Record object as a table, isn’t it?
Tree View of Array object
Tree View of Array object
This is also…
It’s useful if we can see Active Record object as a chart, isn’t it?
Demonstration: Visualization of objects
class ComputersController < ApplicationController


before_action :set_computer, only: %i[ show edit update
destroy ]


# GET /computers or /computers.json


def index


binding.break


@computers = Computer.limit(100)


end


# GET /computers/1 or /computers/1.json


def show


end


...
Sample rails app to
debug in the
demonstration
Demonstration Video
Object Inspector
● Object Inspector converts objects to visualized something


● Users can define how objects are visualized
Summary for session 2
● Features of rdbg inspector are as follows:


○ History Inspector


○ Object Inspector


● I’m looking forward to getting feedback from everyone!
Conclusion…
We want to use these tools, don’t we?
● Debugging in Chrome DevTools


● Tools for supporting debugging in VS Code
Next…
● Create the issue and write a blog to give us feedback!


● If you want to learn how these tools work,


○ https://chromedevtools.github.io/devtools-protocol/


○ https://microsoft.github.io/debug-adapter-protocol/


○ https://github.com/ruby/debug
● Koichi Sasada (@ko1)


○ He gave me the idea of Chrome Integration and rdbg inspector


○ If it had not been for his help, I wouldn’t have been here!


● Thank you for helping me to implement Chrome Integration


○ Andrea Cardaci (@cyrus-and)


■ Author of chrome remote-interface


○ Geoffrey Litt (@geoffreylitt)


■ Author of ladybug


● Thanks to the following organization, I can continue developing debugging tools


○ Ruby Association


○ Google Summer of Code
Acknowledgement
● Thank you for reviewing my presentation


○ Yusuke Endo (@mame)


○ Yuta Saito (@kateinoigakukun)


○ Daichi Furiya (@wasabeef)


○ Yoshiki Fujikane (@fujiwo)


○ Yuki Shigemasa (@gegeson)
Acknowledgement2
1 of 76

Recommended

Goのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考える by
Goのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考えるGoのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考える
Goのサーバサイド実装におけるレイヤ設計とレイヤ内実装について考えるpospome
65.4K views119 slides
できる!並列・並行プログラミング by
できる!並列・並行プログラミングできる!並列・並行プログラミング
できる!並列・並行プログラミングPreferred Networks
26.6K views57 slides
例外設計における大罪 by
例外設計における大罪例外設計における大罪
例外設計における大罪Takuto Wada
68.6K views37 slides
Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料) by
Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料)Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料)
Kubernetes環境に対する性能試験(Kubernetes Novice Tokyo #2 発表資料)NTT DATA Technology & Innovation
1.5K views27 slides
ドメインロジックに集中せよ 〜ドメイン駆動設計 powered by Spring by
ドメインロジックに集中せよ 〜ドメイン駆動設計 powered by Springドメインロジックに集中せよ 〜ドメイン駆動設計 powered by Spring
ドメインロジックに集中せよ 〜ドメイン駆動設計 powered by Spring増田 亨
29.9K views83 slides
ドメイン駆動設計のための Spring の上手な使い方 by
ドメイン駆動設計のための Spring の上手な使い方ドメイン駆動設計のための Spring の上手な使い方
ドメイン駆動設計のための Spring の上手な使い方増田 亨
138.1K views55 slides

More Related Content

What's hot

実践 NestJS by
実践 NestJS実践 NestJS
実践 NestJSAyumi Goto
1.2K views189 slides
PlaySQLAlchemy: SQLAlchemy入門 by
PlaySQLAlchemy: SQLAlchemy入門PlaySQLAlchemy: SQLAlchemy入門
PlaySQLAlchemy: SQLAlchemy入門泰 増田
21.4K views91 slides
デキるプログラマだけが知っているコードレビュー7つの秘訣 by
デキるプログラマだけが知っているコードレビュー7つの秘訣デキるプログラマだけが知っているコードレビュー7つの秘訣
デキるプログラマだけが知っているコードレビュー7つの秘訣Masahiro Nishimi
160.1K views41 slides
モジュールの凝集度・結合度・インタフェース by
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェースHajime Yanagawa
16.7K views100 slides
フロー効率性とリソース効率性について #xpjug by
フロー効率性とリソース効率性について #xpjugフロー効率性とリソース効率性について #xpjug
フロー効率性とリソース効率性について #xpjugItsuki Kuroda
106.3K views62 slides
Paxos by
PaxosPaxos
PaxosPreferred Networks
36.1K views64 slides

What's hot(20)

実践 NestJS by Ayumi Goto
実践 NestJS実践 NestJS
実践 NestJS
Ayumi Goto1.2K views
PlaySQLAlchemy: SQLAlchemy入門 by 泰 増田
PlaySQLAlchemy: SQLAlchemy入門PlaySQLAlchemy: SQLAlchemy入門
PlaySQLAlchemy: SQLAlchemy入門
泰 増田21.4K views
デキるプログラマだけが知っているコードレビュー7つの秘訣 by Masahiro Nishimi
デキるプログラマだけが知っているコードレビュー7つの秘訣デキるプログラマだけが知っているコードレビュー7つの秘訣
デキるプログラマだけが知っているコードレビュー7つの秘訣
Masahiro Nishimi160.1K views
モジュールの凝集度・結合度・インタフェース by Hajime Yanagawa
モジュールの凝集度・結合度・インタフェースモジュールの凝集度・結合度・インタフェース
モジュールの凝集度・結合度・インタフェース
Hajime Yanagawa16.7K views
フロー効率性とリソース効率性について #xpjug by Itsuki Kuroda
フロー効率性とリソース効率性について #xpjugフロー効率性とリソース効率性について #xpjug
フロー効率性とリソース効率性について #xpjug
Itsuki Kuroda106.3K views
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」 by Takuto Wada
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
Takuto Wada148.8K views
ぱぱっと理解するSpring Cloudの基本 by kazuki kumagai
ぱぱっと理解するSpring Cloudの基本ぱぱっと理解するSpring Cloudの基本
ぱぱっと理解するSpring Cloudの基本
kazuki kumagai19.8K views
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版) by Takuto Wada
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
Takuto Wada70.7K views
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話 by Koichiro Matsuoka
DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話DDD x CQRS   更新系と参照系で異なるORMを併用して上手くいった話
DDD x CQRS 更新系と参照系で異なるORMを併用して上手くいった話
Koichiro Matsuoka88.3K views
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O... by NTT DATA Technology & Innovation
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
9/14にリリースされたばかりの新LTS版Java 17、ここ3年間のJavaの変化を知ろう!(Open Source Conference 2021 O...
PostgreSQLアンチパターン by Soudai Sone
PostgreSQLアンチパターンPostgreSQLアンチパターン
PostgreSQLアンチパターン
Soudai Sone48.3K views
CyberAgent における OSS の CI/CD 基盤開発 myshoes #CICD2021 by whywaita
CyberAgent における OSS の CI/CD 基盤開発 myshoes #CICD2021CyberAgent における OSS の CI/CD 基盤開発 myshoes #CICD2021
CyberAgent における OSS の CI/CD 基盤開発 myshoes #CICD2021
whywaita2.2K views
技術ブログを書こう by akira6592
技術ブログを書こう技術ブログを書こう
技術ブログを書こう
akira659210.4K views
フロー効率性とリソース効率性、再入門 #devlove #devkan by Itsuki Kuroda
フロー効率性とリソース効率性、再入門 #devlove #devkanフロー効率性とリソース効率性、再入門 #devlove #devkan
フロー効率性とリソース効率性、再入門 #devlove #devkan
Itsuki Kuroda48.2K views
Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料) by NTT DATA Technology & Innovation
Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料)Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料)
Kubernetesでの性能解析 ~なんとなく遅いからの脱却~(Kubernetes Meetup Tokyo #33 発表資料)
本当は恐ろしい分散システムの話 by Kumazaki Hiroki
本当は恐ろしい分散システムの話本当は恐ろしい分散システムの話
本当は恐ろしい分散システムの話
Kumazaki Hiroki686.3K views
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 - by onozaty
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
今からでも遅くないDBマイグレーション - Flyway と SchemaSpy の紹介 -
onozaty3.2K views

Similar to Introduction of Tools for providing rich user experience in debugger

Autotools, Design Patterns and more by
Autotools, Design Patterns and moreAutotools, Design Patterns and more
Autotools, Design Patterns and moreVicente Bolea
18 views21 slides
Debugging Modern C++ Application with Gdb by
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbSenthilKumar Selvaraj
606 views66 slides
Top Tips Every Notes Developer Needs To Know by
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowKathy Brown
680 views65 slides
Working With Legacy Code by
Working With Legacy CodeWorking With Legacy Code
Working With Legacy CodeAndrea Polci
3.7K views33 slides
Exploring the power of Gradle in android studio - Basics & Beyond by
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & BeyondKaushal Dhruw
1.4K views62 slides
Python debuggers slides by
Python debuggers slidesPython debuggers slides
Python debuggers slidesmattboehm
555 views12 slides

Similar to Introduction of Tools for providing rich user experience in debugger(20)

Autotools, Design Patterns and more by Vicente Bolea
Autotools, Design Patterns and moreAutotools, Design Patterns and more
Autotools, Design Patterns and more
Vicente Bolea18 views
Top Tips Every Notes Developer Needs To Know by Kathy Brown
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To Know
Kathy Brown680 views
Working With Legacy Code by Andrea Polci
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
Andrea Polci3.7K views
Exploring the power of Gradle in android studio - Basics & Beyond by Kaushal Dhruw
Exploring the power of Gradle in android studio - Basics & BeyondExploring the power of Gradle in android studio - Basics & Beyond
Exploring the power of Gradle in android studio - Basics & Beyond
Kaushal Dhruw1.4K views
Python debuggers slides by mattboehm
Python debuggers slidesPython debuggers slides
Python debuggers slides
mattboehm555 views
Practices of agile developers by DUONG Trong Tan
Practices of agile developersPractices of agile developers
Practices of agile developers
DUONG Trong Tan1.2K views
Creating a reasonable project boilerplate by Stanislav Petrov
Creating a reasonable project boilerplateCreating a reasonable project boilerplate
Creating a reasonable project boilerplate
Stanislav Petrov104 views
Indy meetup#7 effective unit-testing-mule by ikram_ahamed
Indy meetup#7 effective unit-testing-muleIndy meetup#7 effective unit-testing-mule
Indy meetup#7 effective unit-testing-mule
ikram_ahamed377 views
Writing Tests with the Unity Test Framework by Peter Kofler
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
Peter Kofler243 views
BDD Testing Using Godog - Bangalore Golang Meetup # 32 by OpenEBS
BDD Testing Using Godog - Bangalore Golang Meetup # 32BDD Testing Using Godog - Bangalore Golang Meetup # 32
BDD Testing Using Godog - Bangalore Golang Meetup # 32
OpenEBS472 views
Oh the compilers you'll build by Mark Stoodley
Oh the compilers you'll buildOh the compilers you'll build
Oh the compilers you'll build
Mark Stoodley594 views
Writing mruby Debugger by yamanekko
Writing mruby DebuggerWriting mruby Debugger
Writing mruby Debugger
yamanekko3.3K views
Software Testing Basic Concepts by wesovi
Software Testing Basic ConceptsSoftware Testing Basic Concepts
Software Testing Basic Concepts
wesovi870 views
Hacking the Codename One Source Code - Part I - Transcript.pdf by ShaiAlmog1
Hacking the Codename One Source Code - Part I - Transcript.pdfHacking the Codename One Source Code - Part I - Transcript.pdf
Hacking the Codename One Source Code - Part I - Transcript.pdf
ShaiAlmog1294 views
IDE and Toolset For Magento Development by Abid Malik
IDE and Toolset For Magento DevelopmentIDE and Toolset For Magento Development
IDE and Toolset For Magento Development
Abid Malik239 views

Recently uploaded

unit 1.pptx by
unit 1.pptxunit 1.pptx
unit 1.pptxrrbornarecm
5 views53 slides
Créativité dans le design mécanique à l’aide de l’optimisation topologique by
Créativité dans le design mécanique à l’aide de l’optimisation topologiqueCréativité dans le design mécanique à l’aide de l’optimisation topologique
Créativité dans le design mécanique à l’aide de l’optimisation topologiqueLIEGE CREATIVE
8 views84 slides
Plant Design Report-Oil Refinery.pdf by
Plant Design Report-Oil Refinery.pdfPlant Design Report-Oil Refinery.pdf
Plant Design Report-Oil Refinery.pdfSafeen Yaseen Ja'far
9 views10 slides
Ansari: Practical experiences with an LLM-based Islamic Assistant by
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic AssistantM Waleed Kadous
11 views29 slides
Design of machine elements-UNIT 3.pptx by
Design of machine elements-UNIT 3.pptxDesign of machine elements-UNIT 3.pptx
Design of machine elements-UNIT 3.pptxgopinathcreddy
38 views31 slides
dummy.pptx by
dummy.pptxdummy.pptx
dummy.pptxJamesLamp
7 views2 slides

Recently uploaded(20)

Créativité dans le design mécanique à l’aide de l’optimisation topologique by LIEGE CREATIVE
Créativité dans le design mécanique à l’aide de l’optimisation topologiqueCréativité dans le design mécanique à l’aide de l’optimisation topologique
Créativité dans le design mécanique à l’aide de l’optimisation topologique
LIEGE CREATIVE8 views
Ansari: Practical experiences with an LLM-based Islamic Assistant by M Waleed Kadous
Ansari: Practical experiences with an LLM-based Islamic AssistantAnsari: Practical experiences with an LLM-based Islamic Assistant
Ansari: Practical experiences with an LLM-based Islamic Assistant
M Waleed Kadous11 views
Design of machine elements-UNIT 3.pptx by gopinathcreddy
Design of machine elements-UNIT 3.pptxDesign of machine elements-UNIT 3.pptx
Design of machine elements-UNIT 3.pptx
gopinathcreddy38 views
Web Dev Session 1.pptx by VedVekhande
Web Dev Session 1.pptxWeb Dev Session 1.pptx
Web Dev Session 1.pptx
VedVekhande20 views
MongoDB.pdf by ArthyR3
MongoDB.pdfMongoDB.pdf
MongoDB.pdf
ArthyR351 views
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc... by csegroupvn
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
Design of Structures and Foundations for Vibrating Machines, Arya-ONeill-Pinc...
csegroupvn13 views
Unlocking Research Visibility.pdf by KhatirNaima
Unlocking Research Visibility.pdfUnlocking Research Visibility.pdf
Unlocking Research Visibility.pdf
KhatirNaima11 views
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx by lwang78
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
2023Dec ASU Wang NETR Group Research Focus and Facility Overview.pptx
lwang78188 views
Integrating Sustainable Development Goals (SDGs) in School Education by SheetalTank1
Integrating Sustainable Development Goals (SDGs) in School EducationIntegrating Sustainable Development Goals (SDGs) in School Education
Integrating Sustainable Development Goals (SDGs) in School Education
SheetalTank111 views
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth by Innomantra
BCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for GrowthBCIC - Manufacturing Conclave -  Technology-Driven Manufacturing for Growth
BCIC - Manufacturing Conclave - Technology-Driven Manufacturing for Growth
Innomantra 20 views

Introduction of Tools for providing rich user experience in debugger

  • 1. Introduction of Tools for providing rich user experience in debugger Ruby Kaigi 2022 Naoto ONO
  • 2. Naoto ONO ● Developer Productivity Group at CyberAgent, Inc. ● ruby/debug (debug.gem) contributor ○ Chrome Integration ○ Test framework ● GitHub: @ono-max
  • 3. debug.gem ● Ruby standard library for debugger from 3.1 ● High performance compared to existing debuggers. ● You can debug Ruby program with the following tools: ○ rdbg (CLI) ○ VS Code ○ Chrome DevTools ○ Neovim ○ …
  • 4. Let’s know what part of this talk you should focus ● This talk consists of two sessions ● From now, you’ll answer some yes/no questions, then you’ll know which part to concentrate on the session 1, or session 2
  • 6. ??? ??? ??? Do you use debug.gem? Do you use VS Code when debugging a program? YES NO YES NO
  • 7. Session 2 Do you use debug.gem? Do you use VS Code when debugging a program? YES NO YES NO Session 1 Session 1
  • 8. Session 2 Do you use debug.gem? Do you use VS Code when debugging a program? YES NO YES NO Session 1 Session 1 I’ll talk debugging Ruby program in Chrome DevTools for these people! I’ll talk debugging Ruby program in Chrome DevTools for these people!
  • 9. Session 2 Do you use debug.gem? Do you use VS Code when debugging a program? YES NO YES NO Session 1 Session 1 I’ll talk tools for supporting VS Code debugging!
  • 10. Agenda ● Session 1: About Chrome DevTools debugging ○ This session includes basic functions in a debugger, too. ● Session 2: About tools for supporting debugging in VS Code ○ This session is about tools related to debugging, not about the debugger itself.
  • 11. Agenda ● Session 1: About Chrome DevTools debugging ○ This session includes basic functions in a debugger, too. ● Session 2: About tools for supporting debugging in VS Code ○ This session is about tools related to debugging, not about the debugger itself. Goal: Everyone wants to use tools in this talk! I’m very glad if I can get your feedbacks, too 😁
  • 13. What is Chrome DevTools? Pause the program at line 4! Set the breakpoint at line 4 View and Change the DOM Debug JavaScript View HTTP request and response
  • 14. What is Chrome DevTools? Pause the program at line 4! Set the breakpoint at line 4 View and Change the DOM Debug JavaScript View HTTP request and response
  • 15. Do you know how to debug JavaScript in Chrome DevTools? Pause the program at line 4!
  • 16. Do you know how to debug JavaScript in Chrome DevTools?
  • 17. Do you know how to debug JavaScript in Chrome DevTools?
  • 18. Do you know how to debug JavaScript in Chrome DevTools?
  • 19. You can debug Ruby program here!! Do you know how to debug JavaScript in Chrome DevTools?
  • 20. The motivation of supporting Chrome DevTools
  • 21. I’d like to debug Ruby program in rich UI such as VS Code, but…
  • 22. I’d like to debug Ruby program in rich UI such as VS Code, but… ● I’m non-user of VS Code
  • 23. I’d like to debug Ruby program in rich UI such as VS Code, but… ● I’m non-user of VS Code ● it’s hard to install VS Code for any reason
  • 24. We installed Google Chrome on your laptop, don’t we?
  • 25. We installed Google Chrome on your laptop, don’t we? ● By supporting Chrome DevTools debugging, we can provide rich user experience to non-users of VS Code!
  • 26. We installed Google Chrome on your laptop, don’t we? ● By supporting Chrome DevTools debugging, we can provide rich user experience to non-users of VS Code! ● Project Goal: Implement functions in Chrome DevTools are comparable to those in VS Code
  • 27. Demonstration: Using a debugger in Chrome DevTools
  • 28. class SampleClass def initialize arg1, arg2 @arg1 = arg1 @arg2 = arg2 end end def sample_method a = 1 b = 2 c = 3 a + b + c end s = SampleClass.new 1, 2 sample_method() sample_method() sample_method() sample_method() sample_method() Sample Script to debug in the demonstration
  • 30. How do Chrome DevTools communicate with debug.gem?
  • 31. Chrome DevTools Protocol (CDP) Client: Chrome DevTools Server: debug.gem
  • 32. Chrome DevTools Protocol (CDP) Click “Step Into” Client: Chrome DevTools Server: debug.gem
  • 33. Chrome DevTools Protocol (CDP) Click “Step Into” Client: Chrome DevTools Server: debug.gem Step Into
  • 34. Chrome DevTools Protocol (CDP) Click “Step Into” Client: Chrome DevTools Server: debug.gem Step Into ACK
  • 35. Chrome DevTools Protocol (CDP) Client: Chrome DevTools Server: debug.gem Click “Step Into” Step Into Paused at line 5 ACK
  • 36. What we can’t do in Chrome DevTools debugging ● Code completion in Chrome Console ● Supporting thread interface ● Coloring code
  • 37. Summary for session 1 ● You can debug Ruby program in Chrome’s rich UI easily. ○ You don’t have to install any tools except for Chrome. ● Chrome DevTools Protocol (CDP) is used between debug.gem and Chrome DevTools.
  • 38. The topic about Chrome DevTools is finished!
  • 39. Session 2 Do you use debug.gem? Do you use VS Code when debugging a program? YES NO YES NO Session 1 Session 1 Thank you for waiting VS Code users!
  • 40. About tools for supporting debugging in VSCode
  • 41. rdbg-inspector ● Tools for supporting debugging in VS Code ● rdbg-inspector is WIP project which means it’s not released yet
  • 44. I know it’s quite sudden, but…
  • 45. We want to go back to some points when debugging it, don’t we?
  • 46. ● What was the value of variable “a” when program was paused at line 6…? We want to go back to some points when debugging it, don’t we?
  • 47. ● What was the value of variable “a” when program was paused at line 6…? ● I’d like to see the procedure here again… We want to go back to some points when debugging it, don’t we?
  • 48. Demonstration: Going back to some points in debugger
  • 49. class SampleClass def initialize arg1, arg2 @arg1 = arg1 @arg2 = arg2 end end def sample_method a = 1 b = 2 c = 3 a + b + c end s = SampleClass.new 1, 2 sample_method() sample_method() sample_method() sample_method() sample_method() Sample Script to debug in the demonstration
  • 51. ● You can go back and forth between the program by clicking recorded execution logs ● History Inspector is realized by Step Into and Step Back feature in debug.gem. History Inspector
  • 52. Features for rdbg-inspector ● History Inspector ● ???
  • 53. Features for rdbg-inspector ● History Inspector ● ???
  • 54. Debugging rails app in VS Code
  • 55. Debugging rails app in VS Code
  • 56. Debugging rails app in VS Code
  • 57. Using Debug Console in VS Code
  • 58. Using Debug Console in VS Code
  • 59. Evaluation of Active Record object Computer class is Active Record.
  • 60. Evaluation of Active Record object
  • 61. Tree View of Active Record object
  • 62. Tree View of Active Record object This is useful, but…
  • 63. It’s useful if we can see Active Record object as a table, isn’t it?
  • 64. Tree View of Array object
  • 65. Tree View of Array object This is also…
  • 66. It’s useful if we can see Active Record object as a chart, isn’t it?
  • 68. class ComputersController < ApplicationController before_action :set_computer, only: %i[ show edit update destroy ] # GET /computers or /computers.json def index binding.break @computers = Computer.limit(100) end # GET /computers/1 or /computers/1.json def show end ... Sample rails app to debug in the demonstration
  • 70. Object Inspector ● Object Inspector converts objects to visualized something ● Users can define how objects are visualized
  • 71. Summary for session 2 ● Features of rdbg inspector are as follows: ○ History Inspector ○ Object Inspector ● I’m looking forward to getting feedback from everyone!
  • 73. We want to use these tools, don’t we? ● Debugging in Chrome DevTools ● Tools for supporting debugging in VS Code
  • 74. Next… ● Create the issue and write a blog to give us feedback! ● If you want to learn how these tools work, ○ https://chromedevtools.github.io/devtools-protocol/ ○ https://microsoft.github.io/debug-adapter-protocol/ ○ https://github.com/ruby/debug
  • 75. ● Koichi Sasada (@ko1) ○ He gave me the idea of Chrome Integration and rdbg inspector ○ If it had not been for his help, I wouldn’t have been here! ● Thank you for helping me to implement Chrome Integration ○ Andrea Cardaci (@cyrus-and) ■ Author of chrome remote-interface ○ Geoffrey Litt (@geoffreylitt) ■ Author of ladybug ● Thanks to the following organization, I can continue developing debugging tools ○ Ruby Association ○ Google Summer of Code Acknowledgement
  • 76. ● Thank you for reviewing my presentation ○ Yusuke Endo (@mame) ○ Yuta Saito (@kateinoigakukun) ○ Daichi Furiya (@wasabeef) ○ Yoshiki Fujikane (@fujiwo) ○ Yuki Shigemasa (@gegeson) Acknowledgement2