def METHOD_NAME(self, command, **kwargs):
    if self.elf_file is None:
        command = (self.gdb +
                   ['-ex', "set confirm off",
                    '-ex', "target extended-remote {}".format(
                        self.gdb_serial)] +
                    self.connect_rst_disable_arg +
                   ['-ex', "monitor swdp_scan",
                    '-ex', "attach 1"])
    else:
        command = (self.gdb +
                   ['-ex', "set confirm off",
                    '-ex', "target extended-remote {}".format(
                        self.gdb_serial)] +
                    self.connect_rst_disable_arg +
                   ['-ex', "monitor swdp_scan",
                    '-ex', "attach 1",
                    '-ex', "file {}".format(self.elf_file)])
    self.check_call_ignore_sigint(command)