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] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Exit and close application.
6
 */
7
 
8
#include "cmd_exit.h"
9
 
10
namespace debugger {
11
 
12
CmdExit::CmdExit(ITap *tap, ISocInfo *info)
13
    : ICommand ("exit", tap, info) {
14
 
15
    briefDescr_.make_string("Exit and close application");
16
    detailedDescr_.make_string(
17
        "Description:\n"
18
        "    Immediate close the application and exit.\n"
19
        "Example:\n"
20
        "    exit\n");
21
}
22
 
23
bool CmdExit::isValid(AttributeType *args) {
24
    if ((*args)[0u].is_equal(cmdName_.to_string())) {
25
        return CMD_VALID;
26
    }
27
    return CMD_INVALID;
28
}
29
 
30
void CmdExit::exec(AttributeType *args, AttributeType *res) {
31
    res->make_nil();
32
    if (!isValid(args)) {
33
        generateError(res, "Wrong argument list");
34
        return;
35
    }
36
    RISCV_break_simulation();
37
}
38
 
39
}  // namespace debugger

powered by: WebSVN 2.1.0

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