ivellioscolin / pykd

A pykd maintenance fork
MIT License
28 stars 16 forks source link

Can't use arguments in !py script command #1

Open ssbssa opened 1 year ago

ssbssa commented 1 year ago

When calling a python script with arguments, like !py path\to\my\script.py arg1 arg2, the arguments arg1 arg2 are not properly forwarded to the script. My guess it's because the arguments are converted to a std::wstring argw, but the argw variable is immediately afterwards destroyed when the for() scope is left (https://github.com/ivellioscolin/pykd/blob/0.3.4.15_1/pykd/windbgext.cpp#L185), so the pointers inside pythonArgs are invalid in the following PySys_SetArgv call.