Jump to content

setting breakpoints during eval


JimBurnett

Recommended Posts

Hello,  I asked this already in the Development Assistance community but I just have a hard time believing that you are developing software without the ability to set a breakpoint within your hook in an IDE, so I thought I would run it by you guys too just to be sure.

I am using VS Code to write & debug the software using xampp 7.2 and xdebug.   I notice that when I step through the code, I can set breakpoints in any of the standard files, but when it gets to my hook, I cannot set breakpoints.   VS Code opens up the eval section in "eval.php" and I can see the code for my hook and I can step over, step into any of the code.  However, if I try to set a breakpoint in the eval.php then it doesn't actually stop at the breakpoint.

Right now, I'm just typing "xdebug_break();" wherever I want a breakpoint.   It works, but that's annoying since I have to edit the code every time. 

i.e., setting a breakpoint in vs code at line 239 of Front.php will work:

image.png.a02e02503abc5a8a8995bd29cac9baa2.png

but setting a breakpoint in either the hook file (emsso.php) or the "in-memory-file" (eval.php) doesn't work.   The program continues to execute without stopping at the breakpoint.

image.png.1a172f30394e877bd676056a9a1b38a4.png

Link to comment
Share on other sites

The hooks are executed in the method monkeyPatch in init.php and it first reads the content of those files, does a string replacement to set the order for execution, and then eval's the code. The IDE may not be able to target that specific line due to the placed halt of execution no longer being valid at runtime, but I can't say for certain.

I see there's an extension for VS Code for xdebug you could give a try: https://github.com/felixfbecker/vscode-php-debug

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...