Even if Python itself is the standard distribution, you should be able to debug your outside DLL module in VS just by putting a breakpoint on your favorite line and setting "/path/to/python.exe -m yourmodule" as the command path under debugging in your project properties, or whatever commandline accomplishes whatever initialization you need to test. Multiprocessing might be something else entirely, I don't know, I've only debugged DLLs in-process. As soon as your breakpoint is hit, it'll stop as you'd expect, even though you started something else entirely.


On Wed, Dec 16, 2020 at 4:56 PM <pjfarley3@earthlink.net> wrote:
Yes, that is my specific issue.  I have a C DLL invoked by a python wrapper module using ctypes that has at least one issue (and likely more than one) so I need to be able to start a python test script and debug the lower-level DLL code.  The C test programs for the lower-level C DLL all seen to succeed, so I am suspecting something is wrong in the wrapper code.

If anyone has or knows of step-by-step instructions on how to set that debug environment up and start the outer-level script with debug breakpoints in the DLL I would greatly appreciate it.  I'm also doing my own searches for tutorials on debugging python with VS20xx, but have not read/viewed one of those yet.

I have in fact been able to re-compile cpython and the lower-level DLL using the VS2019 command line tools, but so far my only debugging capability has been to insert fprintf's to a trace file in the lower-level DLL code (or macros that result in such output) into the C code where I *think* the problem is happening, but I have not been able to nail it down yet.  Being able to start the process from the IDE and catch any C errors when they happen would be ideal.

My environment is Win10-64 and python 3.8.5.


> -----Original Message-----
> From: Paul Moore <p.f.moore@gmail.com>
> Sent: Wednesday, December 16, 2020 2:20 PM
> To: pjfarley3@earthlink.net
> Cc: Python Dev <python-dev@python.org>
> Subject: Re: [Python-Dev] Advice / RTFM needed for tool setup to participate in
> python development from a Windows host
> Personally, I just have Visual Studio and VS Code as my text editor. I
> rarely use Visual Studio directly, though, I mostly use the
> `build.bat` and similar scripts in the `PCBuild` directory.
> Having said that, I'm not doing anything like debugging problems with
> DLLs, for which I imagine a decent C development environment is
> needed. You don't have much choice other than Visual Studio there (no
> other compiler is supported on Windows), though, so you'll probably
> need to learn that.
> Paul
> On Wed, 16 Dec 2020 at 18:28, <pjfarley3@earthlink.net> wrote:
> >
> > Hello,
> >
> > I hope this is the correct place to ask this question.  I have a desire to
> > participate in python development in a particular area from my Windows host
> > machine, but I am not finding any concise listing of the tool setup needed
> > to fully participate, nor any detailed guidance on how to proceed when
> > underlying code debugging is necessary.
> >
> > I do know that some version of the MS VS20xx suite is necessary to begin.
> > My initial attempts using the VS2019 Community Edition have been less than
> > successful when it comes to debugging an underlying C library component
> when
> > the starting program is python because I have not figured out how to use the
> > VS2019 environment to do that.
> >
> > So I would appreciate any RTFM / URL that can guide me in starting to
> > participate, especially for guidance on debugging procedures for underlying
> > C components when the initial program is a python script.
> >
> > I have read most of the "Python Developers Guide" material, but there is not
> > any Window-specific tooling information that I have seen there yet.  What
> > other tooling do I need besides a VS20xx environment?
> >
> > I do have good experience in C programming, but not much in using VS20xx
> > IDE's.
> >
> > TIA for your gentle guidance in curing my ignorance.
> >
> > Peter
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/H4MZYLFFB4EF6ZMMXE4FYH7KJRKNE3ZS/
Code of Conduct: http://python.org/psf/codeofconduct/