Python Debugger Cheatsheet Getting started

Movement

import pdb;pdb.set_trace() start pdb from within a script

repeat the last command

python -m pdb

n(ext)

execute the current statement (step over)

s(tep)

execute and step into function

r(eturn)

continue execution until the current function returns

c(ontinue)

continue execution until a breakpoint is encountered

u(p)

move one level up in the stack trace

d(own)

move one level down in the stack trace

start pdb from the commandline

Basics h(elp)

print available commands

h(elp) command print help about command q(quit)

quit debugger

Examine p(rint) expr

print the value of expr

pp expr

pretty-print the value of expr

w(here) l(ist)

Breakpoints b(reak)

show all breakpoints with its number

print current position (including stack trace)

b(reak) lineno

set a breakpoint at lineno

list 11 lines of code around the current line

b(reak) lineno, cond stop at breakpoint lineno if Python condition cond holds, e.g. i==42

l(ist) first, last list from first to last line number a(rgs)

print the args of the current function

Miscellaneous !stmt alias map stmt

b(reak) file:lineno

set a breakpoint in file at lineno

b(reak) func

set a breakpoint at the first line of a func

tbreak lineno

set a temporary breakpoint at lineno, i.e. is removed when first hit

treat stmt as a Python statement instead of a pdb disable number command

disable breakpoint number

enable number

enable breakpoint number

clear number

delete breakpoint number

map Python statement as a map command

alias map stmt pass arguments to Python statement. stmt includes %1, %2, . . . literals. Save pdb commands to local <./.pdbrc> file for repetitive access.

Author: Florian Preinstorfer ([email protected]) — version 1.1 — license cc-by-nc-sa 3.0 See https://github.com/nblock/pdb-cheatsheet for more information.

Python Debugger Cheatsheet

Author: Florian Preinstorfer ([email protected]) — version 1.1 — license cc-by-nc-sa 3.0. See https://github.com/nblock/pdb-cheatsheet for more information.

171KB Sizes 11 Downloads 225 Views

Recommend Documents

F# Cheatsheet - GitHub
Mutually recursive functions (those functions which call each other) are indicated by ... The same list [ 1; 3; 5; 7; 9 ] or array [| 1; 3; 5; 7; 9. |] can be generated in ...

Paredit Cheatsheet - GitHub
Go to the start of current/previous defun, go to the start of next defun. Leader

The AndBug Debugger - GitHub
Many small tools wrapped by "Android" and Eclipse. Includes a ... or emulator. Key dependency of ANY Android debugger. ... AndBug is 90% Python, 10% C.

Debugger Detection.pdf
debugger must be present. If the return is erroneous, it's probably because we don't have a. debugger to output too. bool HasHardwareBreakpoints(). {. CONTEXT ctx = {0};. ctx.ContextFlags = CONTEXT_DEBUG_REGISTERS;. HANDLE hThread = GetCurrentThread(

Value category cheatsheet - GitHub
Any function call returning a non-reference value type, including pointers, yields a prvalue. ... A non-static data member of an lvalue is also an lvalue. int &&a{ 77 }; ...

the accessibility cheatsheet - GitHub
Jun 2, 2015 - 2 - “Operable” - User interface components and navigation must be ... Lay out your HTML the way the page is inteaded to be read and, where ...

HotSpot JVM options cheatsheet - GitHub
G1 is not deterministic, so no guaranties for GC pause to satisfy this limit. -XX:G1ReservePercent=10 Percentage of heap to keep free. Reserved memory is used ...

TensorFlow Debugger: Debugging Dataflow Graphs for Machine ...
Debuggability is important in the development of machine-learning (ML) systems. Several widely-used ML libraries, such as TensorFlow and Theano, are based on ... Each node in the original graph is watched by a pair of nodes, a Copy (C).

markdown-cheatsheet-online.pdf
would otherwise have special meaning in Markdown's formaing syntax. Markdown provides backslash escapes for. the following characters: \ backslash. ` backtick. * asterisk. _ underscore. {} curly braces. [] square brackets. () parentheses. # hash mark

markdown-cheatsheet-online.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Main menu.

Masters cheatsheet - top 80.pdf
Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Masters cheatsheet - top 80.pdf. Masters cheatsheet - top 80.pdf.

Diablo-3-cheatsheet-62-63.pdf
Doom Hammer. Dread Lance. Exorcist. Guru Staff. Heaven Hand. Hellion Crossbow. High Scabbard. Razorspikes. Revenant Bow. Rune Sword. Sacred Shield.

BlueJ Visual Debugger for Learning the ... - ACM Digital Library
Science Education—computer science education, information systems education. General Terms: Experimentation, Human Factors. Additional Key Words and ...

Diablo-3-cheatsheet-62-63.pdf
Grand Chain. Grand Halberd. Heaven Strand. Impellor. Kurastian Asp. Massacre Axe. Mythical Staff. Oni Blade. Pallium. Phantom Bow. Piercer. Ring. Sagaris. Sanctified. Quiver. Slag Hammer. Sovereign. Greaves. Sovereign Helm. Sovereign Mail. Sovereign.

Covers Python 3 and Python 2 - GitHub
Setting a custom figure size. You can make your plot as big or small as you want. Before plotting your data, add the following code. The dpi argument is optional ...

Covers Python 3 and Python 2 - GitHub
You can add as much data as you want when making a ... chart.add('Squares', squares) .... Some built-in styles accept a custom color, then generate a theme.