blob: 3fcf17d6ac1cce2453185ca46af420ed0717b401 [file] [log] [blame]
# Copyright (c) 2017 Linaro Limited.
# SPDX-License-Identifier: Apache-2.0
'''Runner for debugging with xt-gdb.'''
from os import path
from runners.core import ZephyrBinaryRunner, RunnerCaps
class XtensaBinaryRunner(ZephyrBinaryRunner):
'''Runner front-end for xt-gdb.'''
def name(cls):
return 'xtensa'
def capabilities(cls):
return RunnerCaps(commands={'debug'})
def do_add_parser(cls, parser):
parser.add_argument('--xcc-tools', required=True,
help='path to XTensa tools')
def do_create(cls, cfg, args):
# Override any GDB with the one provided by the XTensa tools.
cfg.gdb = path.join(args.xcc_tools, 'bin', 'xt-gdb')
return XtensaBinaryRunner(cfg)
def do_run(self, command, **kwargs):
gdb_cmd = [self.cfg.gdb, self.cfg.elf_file]