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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [common/] [coreservices/] [isrccode.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      Source code interface: disassembler.
6
 */
7
 
8
#ifndef __DEBUGGER_PLUGIN_ISRCCODE_H__
9
#define __DEBUGGER_PLUGIN_ISRCCODE_H__
10
 
11
#include "iface.h"
12
#include <inttypes.h>
13
#include "attribute.h"
14
 
15
namespace debugger {
16
 
17
static const char *const IFACE_SOURCE_CODE = "ISourceCode";
18
 
19
enum EBreakList {
20
    BrkList_address,
21
    BrkList_instr,
22
    BrkList_hwflag,
23
    BrkList_Total
24
};
25
 
26
enum EListTypes {
27
    AsmList_disasm,
28
    AsmList_symbol,
29
};
30
 
31
enum EColumnNames {
32
    ASM_list_type,
33
    ASM_addrline,
34
    ASM_code,
35
    ASM_codesize,
36
    ASM_breakpoint,
37
    ASM_label,
38
    ASM_mnemonic,
39
    ASM_comment,
40
    ASM_Total
41
};
42
 
43
static const uint64_t BreakFlag_HW = (1 << 0);
44
 
45
class ISourceCode : public IFace {
46
public:
47
    ISourceCode() : IFace(IFACE_SOURCE_CODE) {}
48
 
49
    /** Disasm input data buffer.
50
     *
51
     * @return disassembled instruction length
52
     */
53
    virtual int disasm(uint64_t pc,
54
                       uint8_t *data,
55
                       int offset,
56
                       AttributeType *mnemonic,
57
                       AttributeType *comment) =0;
58
    virtual void disasm(uint64_t pc,
59
                       AttributeType *idata,
60
                       AttributeType *asmlist) =0;
61
 
62
 
63
    /** Register breakpoint at specified address.
64
     *
65
     * @param[in] addr  Breakpoint location
66
     * @param[in] instr Current instruction value at specified address.
67
     *                  For HW breakpoint may have any value so that memory
68
     *                  won't be modified.
69
     * @param[in] hw    Breakpoint flags
70
     */
71
    virtual void registerBreakpoint(uint64_t addr, uint32_t instr,
72
                                    uint64_t flags) =0;
73
 
74
    /** Unregister breakpoint at specified address.
75
     *
76
     * @param[in]  addr  Breakpoint location
77
     * @param[out] instr Original instruction value.
78
     * @param[out] flags Breakpoint flags.
79
     * @return 0 if no errors
80
     */
81
    virtual int unregisterBreakpoint(uint64_t addr, uint32_t *instr,
82
                                     uint64_t *flags) =0;
83
 
84
    /** Get list of breakpoints.
85
     *
86
     * @param[out] lst Breakpoint list.
87
     */
88
    virtual void getBreakpointList(AttributeType *list) =0;
89
};
90
 
91
}  // namespace debugger
92
 
93
#endif  // __DEBUGGER_PLUGIN_ISRCCODE_H__

powered by: WebSVN 2.1.0

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