Commit b539d234 authored by Oliver Horst's avatar Oliver Horst
Browse files

[add] toki-debug class to assist in debugging bitbake issues

parent da09ab6e
# This code is adapted from the Python Cookbook section "Getting More Information from Tracebacks" by Bryn Keller
def debug_yocto(d)
import inspect
import traceback
tb = traceback.extract_stack()
bb.warn("Locals by frame, innermost last")
stack = inspect.stack()
for frameinfo in stack:
frame = frameinfo.frame
bb.warn("Frame %s in %s at line %s" % (frame.f_code.co_name,
for key, value in frame.f_locals.items():
# We have to be VERY careful not to cause a new error in our error
# printer! Calling str() on an unknown object could cause an
# error we don't want, so we must use try/except to catch it --
# we can't stop it from happening, but we can and should
# stop it from propagating if it does happen!
bb.warn("\t%20s = %s" % (key, str(value)))
bb.warn("\t%20s = <ERROR WHILE PRINTING VALUE>" % key,)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment