Page MenuHomeFreeBSD

makesyscalls.lua: improve config processing
ClosedPublic

Authored by kevans on Dec 6 2019, 1:19 AM.
Tags
None
Referenced Files
F132899586: D22698.id.diff
Tue, Oct 21, 12:01 AM
F132899584: D22698.id65336.diff
Tue, Oct 21, 12:01 AM
F132899582: D22698.id65288.diff
Tue, Oct 21, 12:01 AM
Unknown Object (File)
Mon, Oct 20, 2:07 PM
Unknown Object (File)
Tue, Oct 14, 12:10 AM
Unknown Object (File)
Mon, Oct 13, 1:34 AM
Unknown Object (File)
Sep 11 2025, 9:13 AM
Unknown Object (File)
Sep 10 2025, 6:18 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.