Have the subclasses implement a do_run() method instead, which run() delegates to. This will make it possible to handle common functionality in the superclass before runner-specific methods are called. It is a prerequisite for tasks like loading the build time configuration to add device tree awareness. Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
25 lines
693 B
Python
25 lines
693 B
Python
# Copyright (c) 2017 Linaro Limited.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
'''Runner stub for QEMU.'''
|
|
|
|
from .core import ZephyrBinaryRunner
|
|
|
|
|
|
class QemuBinaryRunner(ZephyrBinaryRunner):
|
|
'''Place-holder for QEMU runner customizations.'''
|
|
|
|
def __init__(self, debug=False):
|
|
super(QemuBinaryRunner, self).__init__(debug=debug)
|
|
|
|
def replaces_shell_script(shell_script, command):
|
|
return shell_script == 'qemu.sh'
|
|
|
|
def create_from_env(command, debug):
|
|
'''Create runner. No environment dependencies.'''
|
|
return QemuBinaryRunner()
|
|
|
|
def do_run(self, command, **kwargs):
|
|
if command == 'debugserver':
|
|
print('Detached GDB server')
|