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
100
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
720
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
510
2017 - Bringing Python 3 to LinkedIn
pybay
1
460
2017 - Python Debugging with PUDB
pybay
0
470
2017 - Opening up to Open Source
pybay
0
170
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
130
2017 - Performant Asynchronous Programming at Quora
pybay
1
280
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
400
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
400
Other Decks in Programming
See All in Programming
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.2k
どうしてこうなった命名集 ~🔥編~ / OOC 2024 LT
pictiny
4
2.9k
受託開発でGitLab CI を活用していく
xiombatsg
1
130
Honoとhtmx
yusukebe
6
1.2k
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
140
SwiftUI, Jetpack Composeの導入で変化した「家族アルバム みてね」のアプリ開発体験
hicka04
6
400
Some Quick Ideas To Improve Your Tests ( #jassttokyo )
teyamagu
PRO
2
2.3k
品質とスピードを両立: TypeScriptの柔軟な型システムをバックエンドで活用する
kosui
5
1.1k
Open Source Swift Workshop - Foundation and first party libraries
ikesyo
0
270
CircleCIを活用して AWSへの継続的デリバリーを 実践する
coconala_engineer
1
110
オブジェクト指向コードレビューの新しいアプローチ
akkie76
3
1.5k
WasmOS: Wasmを実行する自作Microkernel
riru
0
370
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Optimising Largest Contentful Paint
csswizardry
7
2.3k
The Power of CSS Pseudo Elements
geoffreycrofte
58
4.9k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Visualization
eitanlees
135
14k
A designer walks into a library…
pauljervisheath
199
23k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
18
6.8k
We Have a Design System, Now What?
morganepeng
42
6.7k
Git: the NoSQL Database
bkeepers
PRO
421
63k
GraphQLの誤解/rethinking-graphql
sonatard
48
9.1k
Learning to Love Humans: Emotional Interface Design
aarron
266
39k
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