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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [cpu_arm_plugin/] [srcproc/] [srcproc.h] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 sergeykhbr
/*
2
 *  Copyright 2018 Sergey Khabarov, sergeykhbr@gmail.com
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15
 */
16
 
17
#ifndef __DEBUGGER_SRCPROC_H__
18
#define __DEBUGGER_SRCPROC_H__
19
 
20
#include <iclass.h>
21
#include <iservice.h>
22
#include "coreservices/isrccode.h"
23
 
24
namespace debugger {
25
 
26
class ArmSourceService : public IService,
27
                         public ISourceCode {
28
 public:
29
    explicit ArmSourceService(const char *name);
30
    virtual ~ArmSourceService();
31
 
32
    /** IService interface */
33
    virtual void postinitService();
34
 
35
    /** ISourceCode interface */
36
    virtual void addFileSymbol(const char *name, uint64_t addr, int sz);
37
 
38
    virtual void addFunctionSymbol(const char *name, uint64_t addr, int sz);
39
 
40
    virtual void addDataSymbol(const char *name, uint64_t addr, int sz);
41
 
42
    virtual void addSymbols(AttributeType *list);
43
 
44
    virtual void clearSymbols();
45
 
46
    virtual void getSymbols(AttributeType *list) {
47
        *list = symbolListSortByName_;
48
    }
49
 
50
    virtual void addressToSymbol(uint64_t addr, AttributeType *info);
51
 
52
    virtual int symbol2Address(const char *name, uint64_t *addr);
53
 
54
    virtual int disasm(uint64_t pc,
55
                       uint8_t *data,
56
                       int offset,
57
                       AttributeType *mnemonic,
58
                       AttributeType *comment);
59
    virtual void disasm(uint64_t pc,
60
                       AttributeType *idata,
61
                       AttributeType *asmlist);
62
 
63
    virtual void registerBreakpoint(uint64_t addr, uint64_t flags,
64
                                    uint64_t instr);
65
 
66
    virtual int unregisterBreakpoint(uint64_t addr, uint64_t *flags,
67
                                    uint64_t *instr);
68
 
69
    virtual void getBreakpointList(AttributeType *list);
70
 
71
    virtual bool isBreakpoint(uint64_t addr, AttributeType *outbr);
72
 
73
 private:
74
    int parseUndefinedInstruction(uint64_t pc, uint32_t instr,
75
                            AttributeType *mnemonic,
76
                            AttributeType *comment);
77
    int parseSingleDataTransfer(uint64_t pc, uint32_t instr,
78
                            AttributeType *mnemonic,
79
                            AttributeType *comment);
80
    int parseBlockDataTransfer(uint64_t pc, uint32_t instr,
81
                            AttributeType *mnemonic,
82
                            AttributeType *comment);
83
    int parseDataProcessing(uint64_t pc, uint32_t instr,
84
                            AttributeType *mnemonic,
85
                            AttributeType *comment);
86
    int parseMultiply(uint64_t pc, uint32_t instr,
87
                            AttributeType *mnemonic,
88
                            AttributeType *comment);
89
    int parseBytesExtending(uint64_t pc, uint32_t instr,
90
                            AttributeType *mnemonic,
91
                            AttributeType *comment);
92
    int parseCoprocRegTransfer(uint64_t pc, uint32_t instr,
93
                            AttributeType *mnemonic,
94
                            AttributeType *comment);
95
    int parseBranch(uint64_t pc, uint32_t instr,
96
                    AttributeType *mnemonic,
97
                    AttributeType *comment);
98
    int parseBranchExchange(uint64_t pc, uint32_t instr,
99
                    AttributeType *mnemonic,
100
                    AttributeType *comment);
101
 
102
 private:
103
    AttributeType endianess_;
104
    AttributeType brList_;
105
    AttributeType symbolListSortByName_;
106
    AttributeType symbolListSortByAddr_;
107
};
108
 
109
DECLARE_CLASS(ArmSourceService)
110
 
111
}  // namespace debugger
112
 
113
#endif  // __DEBUGGER_SRCPROC_H__

powered by: WebSVN 2.1.0

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