Closed kratosok closed 6 years ago
Could you please tell more about how you build and load your extension? Usually there's nothing different from debugging any other program.
Thanks.
Sorry for the open ended question, I'm just not familiar with Visual studio this is my first brush with it. I'm trying to compile 7.1.10 from source with a modified version of vld. I'd like to debug php-cgi and the modified vld extension. Most of the tutorials I've seen just show creating a new project and it will automatically setup the debugging configuration for you.
Using the php-sdk2, I've been able to run buildconf, configure --disable-zts, --enable-cgi --enable-vld=shared and then nmake. There's also an option for enabling debug symbols, I enabled that as well. Some scripts will run properly with php.exe -dvld.active=1 testscript.php. where as some will quietly fail despite verbose logging. Debugging with Visual studio seems to be the way forward.
The buildconf/configure/nmake doesn't seem to create a project/workspace that visual studio 2015 gui will read to setup debugging automatically.
I found brief instruction on attaching to a running generic process with visual studio for debugging, but It seemed to freeze.
I'm looking for either some way to create a visual studio importable workspace/project with debugging configured, or documentation on how to manually setup debugging with visual studio 2015 and any suggestions on how to debug php-cgi.exe on windows with iis.
oh yea, VLD is also set to load in the php.ini btw.
Thanks for the further info. It looks like you put your extension into the PHP source tree. In that case, the following workflow were thinkable
--enable-debug
or --enable-debug-pack
nmake run ARGS=yourscript.php DEBUGGER=1
, that will open a Visual Studio window Debug -> New Breakpoint -> Function Breakpoint
and add a function where the debugger should breakStart
The PHP build system doesn't generate any IDE projects, it only works with makefiles. To create a Visual Studio project, check a plugin named "PDB project".
That's in general it. As you're new to Visual Studio, going through the official documentation and some tutorials is strongly recommended. That also regards to some more advanced topics like debugging under IIS.
Thanks.
As there's no more activity here, i assume your issue is fixed.
Thanks.
Hi!
Im compiling and building an extension for php. It works but there are some scenarios (php scripts) where it crashes with no information logged. I've loved this repo for easily giving the ability to build. I was also able to include debugging symbols for php and the extension. I haven't been able to find any material on how to debug php and extensions on Windows under visual studio or visual studio code.
Would you have any insight or resources you could share?