def process_command(self, cmd):
        try:
            args = cmd.split()
            cmd = args[0].lower()
            args = args[1:]

            # Handle help.
            if cmd in ['?', 'help']:
                self.show_help(args)
                return

            # Handle register name as command.
            if cmd in pyOCD.target.cortex_m.CORE_REGISTER:
                self.tool.handle_reg([cmd])
                return

            # Check for valid command.
            if cmd not in self.tool.command_list:
                print "Error: unrecognized command '%s'" % cmd
                return

            # Run command.
            handler = self.tool.command_list[cmd]
            handler(args)
        except __HOLE__:
            print "Error: invalid argument"
            traceback.print_exc()
        except DAPAccess.TransferError:
            print "Error: transfer failed"
        except ToolError as e:
            print "Error:", e
dataset/ETHPy150Open mbedmicro/pyOCD/pyOCD/tools/pyocd.py/PyOCDConsole.process_command