Page MenuHomeFreeBSD

makesyscalls.lua: improve config processing
ClosedPublic

Authored by kevans on Dec 6 2019, 1:19 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 3:47 AM
Unknown Object (File)
Tue, Nov 5, 9:00 PM
Unknown Object (File)
Tue, Nov 5, 11:59 AM
Unknown Object (File)
Sep 30 2024, 5:23 PM
Unknown Object (File)
Sep 30 2024, 4:13 PM
Unknown Object (File)
Sep 11 2024, 9:28 PM
Unknown Object (File)
Sep 8 2024, 10:58 PM
Unknown Object (File)
Sep 8 2024, 1:48 PM
Subscribers

Details

Summary

The current version will strip out #include directives appearing inside strings, which is clearly wrong. Improve the processing entirely in the following ways:

  • Strip only whole-line comments on every single iteration
  • Abort if we see a malformed line that doesn't match the key=value format
  • For quoted (backtick or double quote) strings, we'll advance to the end of the key=value pair and make sure there's not extra stuff left over
  • For unquoted key=value pairs, we'll strip any trailing comments and verify there's no internal whitespace

This has revealed the caveat that key/value pairs can't even include escaped quotes (and haven't been able to). I don't know if this is actually problematic, as we're usually looking at cases like "#include <foo>" or raw identifiers.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This seems like a reasonable approach.

sys/tools/makesyscalls.lua
239 ↗(On Diff #65288)

This assignment seems to be dead as it's immediately replaced.

This revision is now accepted and ready to land.Dec 6 2019, 10:41 PM
sys/tools/makesyscalls.lua
239 ↗(On Diff #65288)

Whoops, will just merge in the next line and move the comment up pre-commit.

This revision was automatically updated to reflect the committed changes.