2024-08-05

July: Creating the Parser

In this first month, or rather, the last week of July, I have been working on setting up a testing framework for the parser. Previously Xdebug only had tests in PHPT form, PHP's standard for testing syntax and functions. However, this is rather more an integration test framework, as it compares the output of a script with an expected output.

For low-level features, such as testing the implementation of the parser that parses the path mapping files, PHPT tests are not suitable. Instead, the testing framework tests the return values and generated structures directly, without PHP having to be involved. The CppUTest framework that I use for this, is much more similar to PHPUnit. It is also a framework that I have used for testing timelib, the library that powers PHP and MongoDB's date/time functionality.

Beyond the testing framework, I have also made a start on the parser itself. It can currently parse the remote_prefix and local_prefix stanzas, as well as mapping lines, although it does not distinguish between directory maps, file maps, or line maps yet, nor does it apply the prefix stanzas yet.

I have spent 6 hours in July on Native Xdebug Path Mapping.