diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 12:52:33 +0100 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 12:52:43 +0100 |
commit | ac3452c4316dce4b8d2620214087ab110c4573f6 (patch) | |
tree | 240cb27f0a641892dff2baabdd593b37ef7beee1 /bitbake/lib | |
parent | 616e75523b0b1bbe730631dba70224b55cfaaa57 (diff) | |
download | poky-ac3452c4316dce4b8d2620214087ab110c4573f6.tar.gz |
bitbake/utils.py: Improve better_exec debug output
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/utils.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 1778a1e2ee..fd7948f1de 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -292,7 +292,6 @@ def _print_trace(body, line): | |||
292 | Print the Environment of a Text Body | 292 | Print the Environment of a Text Body |
293 | """ | 293 | """ |
294 | # print the environment of the method | 294 | # print the environment of the method |
295 | bb.msg.error(bb.msg.domain.Util, "Printing the environment of the function") | ||
296 | min_line = max(1, line-4) | 295 | min_line = max(1, line-4) |
297 | max_line = min(line + 4, len(body)-1) | 296 | max_line = min(line + 4, len(body)-1) |
298 | for i in range(min_line, max_line + 1): | 297 | for i in range(min_line, max_line + 1): |
@@ -340,13 +339,18 @@ def better_exec(code, context, text, realfile): | |||
340 | bb.msg.error(bb.msg.domain.Util, "Error in executing python function in: %s" % realfile) | 339 | bb.msg.error(bb.msg.domain.Util, "Error in executing python function in: %s" % realfile) |
341 | bb.msg.error(bb.msg.domain.Util, "Exception:%s Message:%s" % (t, value)) | 340 | bb.msg.error(bb.msg.domain.Util, "Exception:%s Message:%s" % (t, value)) |
342 | 341 | ||
343 | # let us find the line number now | 342 | # Strip 'us' from the stack (better_exec call) |
344 | while tb.tb_next: | 343 | tb = tb.tb_next |
345 | tb = tb.tb_next | ||
346 | 344 | ||
347 | import traceback | 345 | import traceback |
348 | line = traceback.tb_lineno(tb) | 346 | tbextract = traceback.extract_tb(tb) |
347 | tbextract = "\n".join(traceback.format_list(tbextract)) | ||
348 | bb.msg.error(bb.msg.domain.Util, "Traceback:") | ||
349 | for line in tbextract.split('\n'): | ||
350 | bb.msg.error(bb.msg.domain.Util, line) | ||
349 | 351 | ||
352 | line = traceback.tb_lineno(tb) | ||
353 | bb.msg.error(bb.msg.domain.Util, "The lines leading to this error were:") | ||
350 | _print_trace( text.split('\n'), line ) | 354 | _print_trace( text.split('\n'), line ) |
351 | 355 | ||
352 | raise | 356 | raise |