OpenCores
URL https://opencores.org/ocsvn/riscv_vhdl/riscv_vhdl/trunk

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [exec/] [cmd/] [cmd_exit.cpp] - Rev 3

Compare with Previous | Blame | View Log

/**
 * @file
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
 * @brief      Exit and close application.
 */
 
#include "cmd_exit.h"
 
namespace debugger {
 
CmdExit::CmdExit(ITap *tap, ISocInfo *info) 
    : ICommand ("exit", tap, info) {
 
    briefDescr_.make_string("Exit and close application");
    detailedDescr_.make_string(
        "Description:\n"
        "    Immediate close the application and exit.\n"
        "Example:\n"
        "    exit\n");
}
 
bool CmdExit::isValid(AttributeType *args) {
    if ((*args)[0u].is_equal(cmdName_.to_string())) {
        return CMD_VALID;
    }
    return CMD_INVALID;
}
 
void CmdExit::exec(AttributeType *args, AttributeType *res) {
    res->make_nil();
    if (!isValid(args)) {
        generateError(res, "Wrong argument list");
        return;
    }
    RISCV_break_simulation();
}
 
}  // namespace debugger
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.