Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2017 - Peter Hadlaw - Intro to pdb
Search
PyBay
August 13, 2017
Programming
0
140
2017 - Peter Hadlaw - Intro to pdb
PyBay
August 13, 2017
Tweet
Share
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
930
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
660
2017 - Bringing Python 3 to LinkedIn
pybay
1
570
2017 - Python Debugging with PUDB
pybay
0
710
2017 - Opening up to Open Source
pybay
0
250
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
190
2017 - Performant Asynchronous Programming at Quora
pybay
1
380
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
520
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
630
Other Decks in Programming
See All in Programming
レベル1の開発生産性向上に取り組む − 日々の作業の効率化・自動化を通じた改善活動
kesoji
0
100
PipeCDのプラグイン化で目指すところ
warashi
1
260
Code as Context 〜 1にコードで 2にリンタ 34がなくて 5にルール? 〜
yodakeisuke
0
120
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
15k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
810
なぜ「共通化」を考え、失敗を繰り返すのか
rinchoku
1
640
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
Composerが「依存解決」のためにどんな工夫をしているか #phpcon
o0h
PRO
1
250
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
2
150
Discover Metal 4
rei315
2
120
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
50
33k
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
120
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
950
Designing for Performance
lara
610
69k
Why Our Code Smells
bkeepers
PRO
337
57k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
Balancing Empowerment & Direction
lara
1
410
Speed Design
sergeychernyshev
32
1k
What's in a price? How to price your products and services
michaelherold
246
12k
Transcript
INTRO TO pdb Peter Hadlaw @ Tesorio August 13, 2017
https://www.tesorio.com/careers
TOO OFTEN I SEE... print foo print foo['bar'] print fizz.buzz()
...
CONS: Limited (can't interrupt execution) Messy (lot's of clean up)
Zero interactivity (need to modify code and run everything again) Much harder to dive deeper into third party code (internal or external alike)
DEBUGGER Exist in many languages and platforms Python's built-in debugger
is... "A computer program that assists in the detection and correction of errors in computer programs."
pdb
THREE EASY STEPS 1. Set a breakpoint 2. Run program
3. Execution halts at breakpoint and now, you, interact
SETTING A BREAKPOINT import pdb; pdb.set_trace() Using a one liner
is a nice habit to make clean up easier (e.g. a single dd in vi).
api.py
RUN PROGRAM
l - LIST COMMAND
EXPRESSIONS
n - NEXT COMMAND
s - STEP COMMAND
c - CONTINUE COMMAND
GENERAL FLOW Use l to orient yourself and inspect what
code is currently being executed. Use n to step forward in execution Use s to dive deeper Create expressions for the debugger to evaluate and gain insights into what's happening c to continue execution until next breakpoint / finish Profit.
NOTES More commands and features available iPython version, much more
powerful (has to be installed separately) Other languages have debuggers to, for example JavaScript in the browser, or C (gdb)
WE'RE HIRING https://www.tesorio.com/careers