0a1,12
> # Copyright (c) 2016 ARM Limited
> # All rights reserved.
> #
> # The license below extends only to copyright in the software and shall
> # not be construed as granting a license to any other intellectual
> # property including but not limited to intellectual property relating
> # to a hardware implementation of the functionality of the software
> # licensed hereunder. You may use the software subject to the license
> # terms below provided that you ensure that this notice is replicated
> # unmodified and in its entirety in all distributions of the software,
> # modified or unmodified, in source code or in binary form.
> #
50a63,64
> listener_modes = ( "on", "off", "auto" )
>
69a84,87
> option("--listener-mode", metavar="{on,off,auto}",
> choices=listener_modes, default="auto",
> help="Port (e.g., gdb) listener mode (auto: Enable if running " \
> "interactively) [Default: %default]")
182c200
< from util import fatal
---
> from util import inform, fatal, panic, isInteractive
323a342,354
> # Disable listeners unless running interactively or explicitly
> # enabled
> if options.listener_mode == "off":
> m5.disableAllListeners()
> elif options.listener_mode == "auto":
> if not isInteractive():
> inform("Standard input is not a terminal, disabling listeners.")
> m5.disableAllListeners()
> elif options.listener_mode == "on":
> pass
> else:
> panic("Unhandled listener mode: %s" % options.listener_mode)
>