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
130
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
860
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
610
2017 - Bringing Python 3 to LinkedIn
pybay
1
530
2017 - Python Debugging with PUDB
pybay
0
610
2017 - Opening up to Open Source
pybay
0
230
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
170
2017 - Performant Asynchronous Programming at Quora
pybay
1
340
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
480
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
550
Other Decks in Programming
See All in Programming
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
ドメインイベント増えすぎ問題
h0r15h0
2
560
React 19でお手軽にCSS-in-JSを自作する
yukukotani
5
560
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
130
Androidアプリの One Experience リリース
nein37
0
1.1k
どうして手を動かすよりもチーム内のコードレビューを優先するべきなのか
okashoi
3
870
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.3k
HTML/CSS超絶浅い説明
yuki0329
0
190
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
1.2k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
Flatt Security XSS Challenge 解答・解説
flatt_security
0
730
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.2k
Optimising Largest Contentful Paint
csswizardry
33
3k
The World Runs on Bad Software
bkeepers
PRO
66
11k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Rails Girls Zürich Keynote
gr2m
94
13k
Scaling GitHub
holman
459
140k
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