main: only allow --gdb option when compiled with gdb feature

Without this cfg check, execution can reach an unreachable!() statement
in the arg handling code on non-gdb builds.

BUG=None
TEST=cargo build # without --features=gdb

Change-Id: I8bec7abbb39e658d5c8f45946fd4fc28f0ae97a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3668741
Reviewed-by: Anton Romanov <romanton@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Daniel Verkamp 2022-05-25 13:24:43 -07:00 committed by Chromeos LUCI
parent a243d3115c
commit ac65c32e6e

View file

@ -2383,6 +2383,7 @@ iommu=on|off - indicates whether to enable virtio IOMMU for this device"),
Possible key values:
type=goldfish - type of battery emulation, defaults to goldfish"),
#[cfg(all(target_arch = "x86_64", feature = "gdb"))]
Argument::value("gdb", "PORT", "(EXPERIMENTAL) gdb on the given port"),
Argument::flag("no-balloon", "Don't use virtio-balloon device in the guest"),
#[cfg(feature = "usb")]