Page MenuHomeFreeBSD

ddb: reliably fail with ambiguous commands
ClosedPublic

Authored by rlibby on Feb 14 2021, 12:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 6:06 PM
Unknown Object (File)
Fri, Oct 18, 3:33 AM
Unknown Object (File)
Oct 4 2024, 11:37 PM
Unknown Object (File)
Oct 2 2024, 3:34 AM
Unknown Object (File)
Sep 30 2024, 4:44 PM
Unknown Object (File)
Sep 24 2024, 4:07 PM
Unknown Object (File)
Sep 23 2024, 8:15 PM
Unknown Object (File)
Sep 23 2024, 8:15 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable