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

Subversion Repositories riscv_vhdl

[/] [riscv_vhdl/] [trunk/] [debugger/] [src/] [common/] [coreservices/] [ielfreader.h] - Blame information for rev 2

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sergeykhbr
/**
2
 * @file
3
 * @copyright  Copyright 2016 GNSS Sensor Ltd. All right reserved.
4
 * @author     Sergey Khabarov - sergeykhbr@gmail.com
5
 * @brief      Interface of elf-file reader.
6
 */
7
 
8
#ifndef __DEBUGGER_ELFREADER_H__
9
#define __DEBUGGER_ELFREADER_H__
10
 
11
#include <stdint.h>
12
#include "iface.h"
13
#include "attribute.h"
14
 
15
namespace debugger {
16
 
17
static const char *const IFACE_ELFREADER = "IElfReader";
18
 
19
enum ESymbolType {
20
    SYMBOL_TYPE_FILE     = 0x01,
21
    SYMBOL_TYPE_FUNCTION = 0x02,
22
    SYMBOL_TYPE_DATA     = 0x04
23
};
24
 
25
enum ESymbolInfoListItem {
26
    Symbol_Name,
27
    Symbol_Addr,
28
    Symbol_Size,
29
    Symbol_Type,
30
    Symbol_Total
31
};
32
 
33
 
34
class IElfReader : public IFace {
35
public:
36
    IElfReader() : IFace(IFACE_ELFREADER) {}
37
 
38
    virtual int readFile(const char *filename) =0;
39
 
40
    virtual unsigned loadableSectionTotal() =0;
41
 
42
    virtual const char *sectionName(unsigned idx) =0;
43
 
44
    virtual uint64_t sectionAddress(unsigned idx) =0;
45
 
46
    virtual uint64_t sectionSize(unsigned idx) =0;
47
 
48
    virtual uint8_t *sectionData(unsigned idx) =0;
49
 
50
    virtual void getSymbols(AttributeType *list) =0;
51
 
52
    virtual void addressToSymbol(uint64_t addr, AttributeType *info) =0;
53
};
54
 
55
}  // namespace debugger
56
 
57
#endif  // __DEBUGGER_ELFREADER_H__

powered by: WebSVN 2.1.0

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