Damjan Cvetko

Damjan Cvetko

Developer, System Architect, Hacker.

3 minutes read

I am passionate about debugging and debuggers since, well, forever. When I started working with PHP many many years ago this was the one thing that truly bothered me - there was no “native” way to debug the code interactively. Then I discovered Xdebug.

Fast forward to end of 2020, I got the chance to take over maintenance of PHP Debug Adapter for Visual Studio Code and since I already contributed to it and knew a lot about the topic I took it.

Let’s back up and jump back to 2007. This is when I first release my own DBGp Notepad++ plugin. At that time I just started experimenting with PHP IDEs and when I discovered Xdebug and its DBGp protocol I dove into Notepad++ plugin system, wrote a Delphi plugin template and eventually wrote my (since abandoned) debugger.

I since took detours working with different platforms and languages but found myself working with PHP more again. This time I knew I had to push the IDE approach onto other, more junior, developers around me and introducing them to interactive debugging was one of the things I did.

VSCode was becoming all the rage, and for good reason. I like it a lot and seriously considered writing my own debugger for it. Since there was already one, altho poorly maintained, I tried to contribute where I needed it. Then, right around the end of 2020 I noticed the original author, Felix Becker, transferred the code repository to xdebug organization. I reached out to Derick Rethans - whom I’ve met at a conference and talked to on many occasions regarding DBGp and Xdebug - and asked what his plans were. Since he himself didn’t have much experience with VSCode and it’s specific approach to debuggers I offered and we decided that I take over development. I presented a plan and this is how it started.

Felix “left” the repository in good shape. GitHub Actions validate PRs and do Semantic releasing. This means every merge to the main branch resulted in a release - if the commit message was right.

I started with merging small things like doc changes and then te first was one of my own old PRs. I tested things thoroughly, then pushed the “Squash and Merge” button. At last, my first release.

Within a few hours issues started poring in. “The latest version does not work”. “It doesn’t start”. “It starts a loading indicator and then nothing”.

Panic.

How can it not work?! I tested everything. Then I installed the VSIX and indeed the described problem happened to me too. But there were no errors in any console or log files I could find.

I then installed the VSIX on my Remote SSH (Linux) so I could poke around the runtime more effectively. Indeed the adapter process started and stopped right away. But still, no logs.

Eventually I ran the extension code with node by hand, and there I saw the global exception. The problem and the fix were trivial, but due to the lack of any output in VSCode debugging it was pure guesswork.

I’ll open an issue with VSCode regarding this eventually, but for now, I’ll always do a clean build locally and install it in a VM before releasing :)

If you have a problem with this extension, let me know on its GitHub page and open an issue.

Recent posts

See more

Categories

About