Page MenuHomeFreeBSD

ddb: reliably fail with ambiguous commands
ClosedPublic

Authored by rlibby on Feb 14 2021, 12:48 AM.
Tags
None
Referenced Files
F151656557: D28659.diff
Thu, Apr 9, 7:52 PM
F151622860: D28659.diff
Thu, Apr 9, 2:08 PM
F151543505: D28659.diff
Thu, Apr 9, 2:44 AM
Unknown Object (File)
Tue, Apr 7, 2:00 AM
Unknown Object (File)
Sun, Apr 5, 7:01 AM
Unknown Object (File)
Sun, Mar 29, 6:45 AM
Unknown Object (File)
Wed, Mar 25, 8:04 PM
Unknown Object (File)
Mon, Mar 23, 11:02 PM
Subscribers

Details

Summary

db_cmd_match had an even/odd bug, where if a third command was partially
matched (or any odd number greater than one) the search result would be
set back from CMD_AMBIGUOUS to CMD_FOUND, causing the last command in
the list to be executed instead of failing the match.

Test Plan
# sysctl debug.kdb.enter=1
debug.kdb.enter:KDB: enter: sysctl debug.kdb.enter
 [ thread pid 895 tid 100225 ]
Stopped at      kdb_sysctl_enter+0x95:  movq    $0,0x128d790(%rip)
db> show a 
Ambiguous
db> show b
Ambiguous
db> show c
Ambiguous
db> show d
Ambiguous
db> show f
Ambiguous
db> show i
Ambiguous

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36981
Build 33870: arc lint + arc unit