Pydevd: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
* https://github.com/fabioz/PyDev.Debugger/issues/184 | * https://github.com/fabioz/PyDev.Debugger/issues/184 | ||
* https://www.brainwy.com/tracker/PyDev/1123 | * https://www.brainwy.com/tracker/PyDev/1123 | ||
= Workaround = | |||
<source lang='python'> | |||
parser.add_argument('--debug', | |||
action='store_true', | |||
help="run in debug mode") | |||
parser.add_argument('--debugServer', | |||
help="remote debug Server") | |||
parser.add_argument('--debugPort',type=int, | |||
help="remote debug Port",default=5678) | |||
parser.add_argument('--debugPathMapping',nargs='+',help="remote debug Server path mapping - needs two arguments 1st: remotePath 2nd: local Path") | |||
args=parser.parse_args() | |||
if args.debugServer: | |||
import pydevd | |||
print (args.debugPathMapping,flush=True) | |||
if args.debugPathMapping: | |||
if len(args.debugPathMapping)==2: | |||
remotePath=args.debugPathMapping[0] # path on the remote debugger side | |||
localPath=args.debugPathMapping[1] # path on the local machine where the code runs | |||
MY_PATHS_FROM_ECLIPSE_TO_PYTHON = [ | |||
(remotePath, localPath), | |||
] | |||
setup_client_server_paths(MY_PATHS_FROM_ECLIPSE_TO_PYTHON) | |||
#os.environ["PATHS_FROM_ECLIPSE_TO_PYTHON"]='[["%s", "%s"]]' % (remotePath,localPath) | |||
#print("trying to debug with PATHS_FROM_ECLIPSE_TO_PYTHON=%s" % os.environ["PATHS_FROM_ECLIPSE_TO_PYTHON"]); | |||
pydevd.settrace(args.debugServer, port=args.debugPort,stdoutToServer=True, stderrToServer=True) | |||
</source> | |||
Revision as of 08:56, 29 December 2020
- https://stackoverflow.com/questions/7999526/is-there-any-way-to-modify-the-pydevd-file-utils-paths-from-eclipse-to-python-va/41765551 - 2 k Views
- https://stackoverflow.com/questions/9855319/how-do-i-add-a-breakpoint-in-eclipse-using-pydev - 4 k Views
- https://stackoverflow.com/questions/52760636/ptvsd-with-visual-studio-code-pydev-debugger-warning-trying-to-add-breakpoint - 1 k Views
Issues
Workaround
parser.add_argument('--debug',
action='store_true',
help="run in debug mode")
parser.add_argument('--debugServer',
help="remote debug Server")
parser.add_argument('--debugPort',type=int,
help="remote debug Port",default=5678)
parser.add_argument('--debugPathMapping',nargs='+',help="remote debug Server path mapping - needs two arguments 1st: remotePath 2nd: local Path")
args=parser.parse_args()
if args.debugServer:
import pydevd
print (args.debugPathMapping,flush=True)
if args.debugPathMapping:
if len(args.debugPathMapping)==2:
remotePath=args.debugPathMapping[0] # path on the remote debugger side
localPath=args.debugPathMapping[1] # path on the local machine where the code runs
MY_PATHS_FROM_ECLIPSE_TO_PYTHON = [
(remotePath, localPath),
]
setup_client_server_paths(MY_PATHS_FROM_ECLIPSE_TO_PYTHON)
#os.environ["PATHS_FROM_ECLIPSE_TO_PYTHON"]='[["%s", "%s"]]' % (remotePath,localPath)
#print("trying to debug with PATHS_FROM_ECLIPSE_TO_PYTHON=%s" % os.environ["PATHS_FROM_ECLIPSE_TO_PYTHON"]);
pydevd.settrace(args.debugServer, port=args.debugPort,stdoutToServer=True, stderrToServer=True)