Commit 6a3e5219 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Make it easier to run without frame introspection

Turning off frame introspection can make things easier to
debug, but will break features like tracebacks.

If we turn it off, instead of trying to collect a traceback and
crashing, just print out a warning and return an empty traceback.
parent 6446c7d5
......@@ -439,6 +439,15 @@ static const LineInfo* lineInfoForFrame(PythonFrameIterator& frame_it) {
std::vector<const LineInfo*> getTracebackEntries() {
std::vector<const LineInfo*> entries;
if (!ENABLE_FRAME_INTROSPECTION) {
static bool printed_warning = false;
if (!printed_warning) {
printed_warning = true;
fprintf(stderr, "Warning: can't get traceback since ENABLE_FRAME_INTROSPECTION=0\n");
}
return entries;
}
for (auto& frame_info : unwindPythonFrames()) {
const LineInfo* line_info = lineInfoForFrame(frame_info);
if (line_info)
......
Markdown is supported
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