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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [libdbg64g/] [services/] [exec/] [cmdexec.h] - Blame information for rev 3

Go to most recent revision | 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      Command Executor declaration.
6
 */
7
 
8
#ifndef __DEBUGGER_CMDEXECUTOR_H__
9
#define __DEBUGGER_CMDEXECUTOR_H__
10
 
11
#include "iclass.h"
12
#include "iservice.h"
13
#include "coreservices/icmdexec.h"
14
#include "coreservices/itap.h"
15
#include "coreservices/iautocomplete.h"
16
#include "coreservices/isocinfo.h"
17
#include "coreservices/icommand.h"
18
#include <string>
19
#include <stdarg.h>
20
 
21
namespace debugger {
22
 
23
class CmdExecutor : public IService,
24
                    public ICmdExecutor {
25
public:
26
    explicit CmdExecutor(const char *name);
27
    virtual ~CmdExecutor();
28
 
29
    /** IService interface */
30
    virtual void postinitService();
31
 
32
    /** ICmdExecutor */
33
    virtual void registerCommand(ICommand *icmd);
34
    virtual void unregisterCommand(ICommand *icmd);
35
    virtual void exec(const char *line, AttributeType *res, bool silent);
36
    virtual void commands(const char *substr, AttributeType *res);
37
 
38
private:
39
    void processSimple(AttributeType *cmd, AttributeType *res);
40
    void processScript(AttributeType *cmd, AttributeType *res);
41
    void splitLine(char *str, AttributeType *listArgs);
42
 
43
    int outf(const char *fmt, ...);
44
    bool cmdIsError(AttributeType *res);
45
    ICommand *getICommand(AttributeType *args);
46
    ICommand *getICommand(const char *name);
47
 
48
private:
49
    AttributeType tap_;
50
    AttributeType socInfo_;
51
    AttributeType cmds_;
52
 
53
    ITap *itap_;
54
    ISocInfo *info_;
55
 
56
    mutex_def mutexExec_;
57
 
58
    char cmdbuf_[4096];
59
    char *outbuf_;
60
    int outbuf_size_;
61
    int outbuf_cnt_;
62
    uint8_t *tmpbuf_;
63
    int tmpbuf_size_;
64
};
65
 
66
DECLARE_CLASS(CmdExecutor)
67
 
68
}  // namespace debugger
69
 
70
#endif  // __DEBUGGER_CMDEXECUTOR_H__

powered by: WebSVN 2.1.0

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