This is an archive of the discontinued LLVM Phabricator instance.

[debugserver] Add --version/-V command line option to debugserver.
ClosedPublic

Authored by JDevlieghere on Sep 27 2019, 12:39 PM.

Details

Summary

When not running under a TTY the output is buffered and not flushed
before debugserver exits which makes it impossible to parse the version
string. This adds a -V/--version command that just prints the version
to stdout and exits with an exit code zero.

Diff Detail

Repository
rL LLVM

Event Timeline

JDevlieghere created this revision.Sep 27 2019, 12:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2019, 12:39 PM

Hm, if the goal is to get -version (an unrecognized cmd line option) to explicitly print to stderr, don't we want to change the lines in show_usage_and_exit? I think this change would result in us not getting the version string in console logs for normal debug sessions, where we want to keep it.

JDevlieghere retitled this revision from [debugserver] Don't use RNBLog for printing the version to [debugserver] Add --version/-V command line option to debugserver..
JDevlieghere edited the summary of this revision. (Show Details)
jasonmolenda accepted this revision.Sep 27 2019, 2:21 PM

Awesome.

This revision is now accepted and ready to land.Sep 27 2019, 2:21 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2019, 2:28 PM

Good catch!