Debugger: Improve pdb debugging

When a script used __file__ to refer to other
files by constructing relative paths it ended
up trying to use a file relative to the pdbbridge
instead the original python file.
Fix this by bringing the bridge closer to the
original pdb code.

Change-Id: I22dda440c78349bfd3dcf4ce748042cc77eb4bee
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2019-11-12 11:00:35 +01:00
parent 2f42e11ac6
commit 49930aa5f9
+4 -4
View File
@@ -743,12 +743,12 @@ class QtcInternalDumper:
# So we clear up the __main__ and set several special variables
# (this gets rid of pdb's globals and cleans old variables on restarts).
# import __main__
import __main__
# __main__.__dict__.clear()
# __main__.__dict__.update({'__name__' : '__main__',
# '__file__' : mainpyfile,
__main__.__dict__.update({'__name__' : '__main__',
'__file__' : mainpyfile,
# '__builtins__': __builtins__,
# })
})
# When bdb sets tracing, a number of call and line events happens
# BEFORE debugger even reaches user's code (and the exact sequence of