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)
Apr 8 2024, 10:51 AM
Unknown Object (File)
Mar 17 2024, 11:36 PM
Unknown Object (File)
Dec 20 2023, 2:41 AM
Unknown Object (File)
Nov 14 2023, 9:59 PM
Unknown Object (File)
Nov 11 2023, 8:52 AM
Unknown Object (File)
Oct 30 2023, 10:12 PM
Unknown Object (File)
Oct 13 2023, 8:59 PM
Unknown Object (File)
Oct 10 2023, 7:52 AM
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.