Python debugger stop without message and no Exception in external dll execution
See original GitHub issueEnvironment data
- VS Code version: 1.26.1
- Extension version (available under the Extensions sidebar): 2018.7.1
- OS and version: Windows 8 32bit
- Python version (& distribution if applicable, e.g. Anaconda): Python 2.7 32bit
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions:
I’m writing an application that use pcshll32.dll to communicate with IBM Pcomm 3270 terminal.
I’m able to use the dll successful but there is some commands that when executed no exceptions occurs and the debugger stops. When I execute the same code but calling $ python index.py
from VSCode terminal everything works as
code used:
from ctypes import c_int, c_char_p, WinDLL, WINFUNCTYPE, byref, c_void_p
import os
hllDll = WinDLL("pcshll32.dll")
hllApiProto = WINFUNCTYPE(c_int, c_void_p, c_void_p, c_void_p, c_void_p)
hllApiParams = (1, "f", 0), (1, "d", 0), (1, "l", 0), (1, "p", 0)
hllApi = hllApiProto(("hllapi", hllDll), hllApiParams)
f = c_int(1)
d = c_char_p(b"A")
l = c_int(1)
p = c_int(0)
res = hllApi(byref(f), d, byref(l), byref(p))
if (res == 0):
f = c_int(5)
d = c_char_p("")
l = c_int(1)
p = c_int(0)
txt = c_char_p("")
r2 = hllApi(byref(f), d, byref(l), byref(p))
print(res, r2)
f = c_int(2)
d = c_char_p("")
l = c_int(0)
p = c_int(0)
res = hllApi(byref(f), d, byref(l), byref(p))
Expected behavior
To print both response. But I’m not able to pass through line 18, no Exceptions occurs and python end execution. But in with $ python index.py
i’m can make it run as expected.
Steps to reproduce:
Need to install pcomm ibm software, configure a session to
I’m using host: zos.kctr.marist.edu with port 1023 to test the program.
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
no output message
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
no output message
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@brettcannon I changed my env to use c# and worked for me. I just posted here to improve the debugger cause i love python. Thanks for your support
@ommeirelles I’m afraid we aren’t in a good position to fix this. You’re calling into C code using ctypes which automatically means “magic” 😉 . Add on top of that the fact that the IBM docs say the return value is undefined, which suggests this is “black magic” 😉 . And the debugger doesn’t work with C code. If you can figure out what object
res
is and then report that up to https://github.com/microsoft/ptvsd, but otherwise I don’t see how we can reproduce this in order to debug it.