Make a breakpoint on the c layer with python

If you want to debug cpython's c code, you can use gdb to debug it like this:

When you want to follow the execution steps of the c layer.

$ gdb -- /usr/bin/python
#File name where you want to set the breakpoint:Specify by the number of lines.
(gdb) break bltinmodule.c:1665
#Run script
(gdb) run /usr/bin/nosetests test.py
...

Looking at the following article, I knew that I would do it like this, so a memorandum. (The article uses lldb) http://flowerhack.dreamwidth.org/3594.html?utm_source=Python+Weekly+Newsletter&utm_campaign=b17d7f3658-Python_Weekly_Issue_167_December_4_2014&utm_medium=email&utm_term=0_9e26887fc5-b17d7f3658-312730089

Recommended Posts

Make a breakpoint on the c layer with python
Make a fortune with Python
Solve ABC163 A ~ C with Python
Let's make a GUI with python.
Solve ABC168 A ~ C with Python
[Python] Make the function a lambda function
Make a recommender system with python
Solve ABC162 A ~ C with Python
Solve ABC167 A ~ C with Python
Solve ABC158 A ~ C with Python
Let's make a graph with python! !!
Make the Python console covered with UNKO
Control the motor with a motor driver using python on Raspberry Pi 3!
Let's make a shiritori game with Python
"Cython" tutorial to make Python explosive: Pass a C ++ class object to a class object on the Python side. Part ①
A memo with Python2.7 and Python3 on CentOS
Map rent information on a map with python
[C] [python] Read with AquesTalk on Linux
Let's make a voice slowly with Python
Download files on the web with Python
Let's make a web framework with Python! (1)
Make a desktop app with Python with Electron
[Python] A progress bar on the terminal
Let's make a Twitter Bot with Python!
Let's make a web framework with Python! (2)
"Cython" tutorial to make Python explosive: When a function on the C ++ side has an overload.
[AtCoder explanation] Control the A, B, C problems of ABC182 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC186 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC185 with Python!
Install the python module with pip on a server without root privileges
[Python, ObsPy] I drew a beach ball on the map with Cartopy + ObsPy.
[AtCoder explanation] Control the A, B, C problems of ABC187 with Python!
[AtCoder explanation] Control the A, B, C problems of ABC184 with Python!
[Python] Get the files in a folder with Python
[Python] Make a game with Pyxel-Use an editor-
Build a python environment with ansible on centos6
I want to make a game with Python
Make a copy of the list in Python
Try to make a "cryptanalysis" cipher with Python
[Python] Make a simple maze game with Pyxel
Folium: Visualize data on a map with Python
Introduction to Python with Atom (on the way)
Let's replace UWSC with Python (5) Let's make a Robot
Try to make a dihedral group with Python
Decrypt a string encrypted on iOS with Python
Challenge AtCoder (ABC) 164 with Python! A ~ C problem
Make Python built with jhbuild work on OSX
Visualize grib2 on a map with python (matplotlib)
Make a thermometer with Raspberry Pi and make it visible on the browser Part 3
[AtCoder explanation] Control the A, B, (C), D problems of ABC165 with Python!
Make the library created by Eigen in C ++ available from Python with Boost.Numpy.
[AtCoder explanation] Control the A, B, C, D problems of ABC183 with Python!
Draw a line / scatter plot on the CSV file (2 columns) with python matplotlib
[AtCoder explanation] Control the A, B, C, D problems of ABC181 with Python!
Get the stock price of a Japanese company with Python and make a graph
Try to make a Python module in C language
Specify the volume on linux and make a sound
Try to make a command standby tool with python
[Practice] Make a Watson app with Python! # 2 [Translation function]
Make a simple Slackbot with interactive button in python
Try embedding Python in a C ++ program with pybind11