hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Creating breakpoints when remote debugging using fastcgi does not break

Open lowjoel opened this issue 12 years ago • 8 comments

  1. Start a hhvm instance using -m server -v Server.Type=fastcgi -v Server.Port=9000 -v Eval.Debugger.EnableDebugger=true -v Eval.Debugger.EnableDebuggerServer=true -v Eval.Debugger.Port=8089
  2. Connect using hphpd on localhost:8089
  3. break on any file running in the hhvm
  4. continue
  5. skips breakpoints completely.

I'm currently trying to run Drupal 7 in this manner; its unit tests are not working. Specifically, when I use break with an absolute path in step 3, loading the file does using the server does not cause a breakpoint to trigger. I tested using includes/bootstrap.inc.

lowjoel avatar Feb 09 '14 19:02 lowjoel

(CC @mikemag)

Thanks for reporting this. Feel free to submit a PR if you (or someone else reading this) gets to this before we do.

scannell avatar Feb 10 '14 16:02 scannell

This works for me.

radford avatar Mar 20 '14 06:03 radford

me too! yay.

ptarjan avatar Mar 20 '14 06:03 ptarjan

I can still repro. Now with new hhvm updates, what is the correct way to link hphpd to hhvm? Should we still start a new hhvm instance like above?

$sudo vim /usr/share/hhvm/install_fastcgi.sh Running above command doesn't actually start the debugger and here is my /etc/hhvm/server.ini hhvm.Eval.Debugger.EnableDebugger = true hhvm.Eval.Debugger.EnableDebuggerServer = true hhvm.Eval.Debugger.Port = 8089 hhvm.Eval.Debugger.DefaultSandboxPath = "/home/prognew/www"

I found the hphpd default the sandbox to {home}/www

$ hphpd -h localhost Welcome to HipHop Debugger! Type "help" or "?" for a complete list of commands.

Connecting to localhost:8089... Attaching to prognew's default sandbox and pre-loading, please wait... localhost> m l m l 1 prognew's default sandbox at /home/prognew/www/

procurity avatar Jun 07 '14 08:06 procurity

I can also reproduce this, exactly as stated in first:

A) Start server: hhvm --no-config -m server -v Server.Type=fastcgi -v Server.Port=9000 -v Eval.Debugger.EnableDebugger=true -v Eval.Debugger.EnableDebuggerServer=true -v Eval.Debugger.Port=8089

B) Start debugger: hhvm -m debug --debug-host localhost --debug-port 8089 C) Enter debugger command: break start D) Enter debugger command: continue E) Issue http request curl http://localhost/wiki/Main_Page

I would expect the http request issued in E to pause and for the debugger to pick up, but instead it runs to completion.

ebernhardson avatar Jul 24 '14 22:07 ebernhardson

Looking through the related code, my best guess is that in source-root-info.cpp the constructor SourceRootInfo::SourceRootInfo(Transport* transport) is seeing that my web server set a DocumentRoot parameter, and as such skips the entire sandbox configuration? Debugger depends on sandboxing, so without it the debugger is essentially disabled?

ebernhardson avatar Jul 24 '14 23:07 ebernhardson

I have the same issue as this report. Im following the blog from http://miles-by-motorcycle.com/fv-b-8-657/configuring-and-using-the-hiphopvm--hhvm--remote-debugger.

The breakpoint is set, hit continue but when running the request, it just doesnt halt on my breakpoint

rajasaur avatar Jun 15 '15 03:06 rajasaur

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

This issue applies to the old debugger. This debugger is slated for removal.

OOS Update - 2023

We also plan to complete the deprecation of the old HPHPD debugger in favor of our LSP bindings from the vsdebug extension.

lexidor avatar May 29 '25 06:05 lexidor