TipsAndTricks/DebuggingBitbakeInPudb: Difference between revisions
From Yocto Project
Jump to navigationJump to search
(Created page with "=How to debug native recipes with gdb= I recently had the need to debug a crash in a native binary that a layer I was working on invokes during the build. To debug the crash...") |
No edit summary |
||
Line 1: | Line 1: | ||
=How to debug | =How to debug bitbake itself with pudb= | ||
I recently had the need to debug | I recently had the need to debug bitbake and toaster to figure out why toaster was no longer able to save event information to it's database. | ||
It turned out that I wanted to step through a number of the lib/bb/* files to see how the server was being setup. | |||
==What I did== | |||
<code> | |||
. ./poky/oe-init-build-env | |||
. toaster start webport=0.0.0.0:8000 | |||
</code> | |||
This set up the toaster webserver to run. | |||
Then my debug test: | |||
<code> | |||
python3 -m pudb.run $(which bitbake) quilt-native | |||
</code> | |||
I was looking at changes to bitbake/lib/bb/main.py. So, in that file I could set up breakpoints in code like so: | |||
<code> | |||
from pudb import set_trace as bp | |||
... | |||
... | |||
bp() | |||
... | |||
... | |||
</code> | |||
This allows me to sprinkle programmatic breakpoints wherever I want. | |||
If you have a better/preferred way to step through bitbake, feel free to add/change this document. | |||
Revision as of 02:43, 14 January 2017
How to debug bitbake itself with pudb
I recently had the need to debug bitbake and toaster to figure out why toaster was no longer able to save event information to it's database.
It turned out that I wanted to step through a number of the lib/bb/* files to see how the server was being setup.
What I did
. ./poky/oe-init-build-env
. toaster start webport=0.0.0.0:8000
This set up the toaster webserver to run.
Then my debug test:
python3 -m pudb.run $(which bitbake) quilt-native
I was looking at changes to bitbake/lib/bb/main.py. So, in that file I could set up breakpoints in code like so:
from pudb import set_trace as bp
...
...
bp()
...
...
This allows me to sprinkle programmatic breakpoints wherever I want. If you have a better/preferred way to step through bitbake, feel free to add/change this document.