Kenny
Kenny

Reputation: 675

Visual Studio 2010 Attaching to Python Process

I'm using VS 2010 to attach to a Python script that is calling a DLL via ctypes.

I can attach to the process and under the "Modules" view I can see the DLL and it's associated PDB. The paths lead right to the solutions output folder which happens to be ".../Debug/bin". I'm running the script from this same folder.

When I try to set a breakpoint I get "No executable code is associated with this line."

As best as I can tell the DLL is built in a debug configuration rather than a release (under Properties/C-C++/Optimization optimization is disabled (/Od). However, in the "Modules" view the "Optimized" column displays "Yes".

Thanks,

Kenny

Upvotes: 0

Views: 2894

Answers (1)

Dennis
Dennis

Reputation: 20571

As you are using VS 2010, install the Python Tools for Visual Studio extension that was released a few months ago. It is awesome.

  • Supports CPython and IronPython
  • Python editor with advanced member and signature intellisense
  • Code navigation, goto definition, and object browser
  • Local and remote debugging

With this installed you should be able to debug your script directly.

http://pytools.codeplex.com/

Upvotes: 2

Related Questions