aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/API/SBSection.h
blob: 5a49049502fd9ac4cfac24d78fc9e405c42f6725 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//===-- SBSection.h ---------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SBSection_h_
#define LLDB_SBSection_h_

#include "lldb/API/SBDefines.h"
#include "lldb/API/SBData.h"

namespace lldb {

class SBSection
{
public:

    SBSection ();

    SBSection (const lldb::SBSection &rhs);

    ~SBSection ();

    const lldb::SBSection &
    operator = (const lldb::SBSection &rhs);

    bool
    IsValid () const;

    const char *
    GetName ();

    lldb::SBSection
    GetParent();

    lldb::SBSection
    FindSubSection (const char *sect_name);

    size_t
    GetNumSubSections ();

    lldb::SBSection
    GetSubSectionAtIndex (size_t idx);

    lldb::addr_t
    GetFileAddress ();

    lldb::addr_t
    GetLoadAddress (lldb::SBTarget &target);
    
    lldb::addr_t
    GetByteSize ();

    uint64_t
    GetFileOffset ();

    uint64_t
    GetFileByteSize ();
    
    lldb::SBData
    GetSectionData ();

    lldb::SBData
    GetSectionData (uint64_t offset,
                    uint64_t size);
    
    SectionType
    GetSectionType ();

    //------------------------------------------------------------------
    /// Return the size of a target's byte represented by this section
    /// in numbers of host bytes. Note that certain architectures have
    /// varying minimum addressable unit (i.e. byte) size for their 
    /// CODE or DATA buses.
    ///
    /// @return
    ///     The number of host (8-bit) bytes needed to hold a target byte
    //------------------------------------------------------------------
    uint32_t
    GetTargetByteSize ();

    bool
    operator == (const lldb::SBSection &rhs);

    bool
    operator != (const lldb::SBSection &rhs);

    bool
    GetDescription (lldb::SBStream &description);
    

private:

    friend class SBAddress;
    friend class SBModule;
    friend class SBTarget;
    
    SBSection (const lldb::SectionSP &section_sp);

    lldb::SectionSP
    GetSP() const;
    
    void
    SetSP(const lldb::SectionSP &section_sp);
    
    lldb::SectionWP m_opaque_wp;
};


} // namespace lldb

#endif // LLDB_SBSection_h_