15 #include <featureTests.h>
16 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
17 #include "sage3basic.h"
34 rose_rva_t::rose_rva_t() {
50 rose_rva_t::rose_rva_t(
const rose_rva_t &other)
53 section = other.section;
61 section = other.section;
70 assert(section!=NULL);
78 rose_rva_t::is_bound()
const
86 rose_rva_t::get_rva()
const
88 rose_addr_t rva = addr;
99 rose_rva_t::set_rva(rose_addr_t rva)
111 rose_rva_t::get_section()
const
121 assert(new_section==NULL || new_section->
is_mapped());
128 section = new_section;
139 return set_section(secbind);
145 rose_rva_t::get_va()
const
156 rose_rva_t::get_rel()
const
171 rose_rva_t::increment(rose_addr_t amount)
179 rose_rva_t::to_string()
const
182 sprintf(s,
"0x%08" PRIx64
" (%" PRIu64
")", get_rva(), get_rva());
186 sprintf(s,
" + 0x%08" PRIx64
" (%" PRIu64
")", get_rel(), get_rel());
187 ss +=
" <" + get_section()->get_name()->get_string(
true) + s +
">";
194 operator<<(std::ostream &os,
const rose_rva_t &rva)
196 os << rva.to_string();
201 rose_addr_t operator+(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() + a2.get_rva();}
202 rose_addr_t operator-(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() - a2.get_rva();}
205 bool operator< (
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() < a2.get_rva();}
206 bool operator<=(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() <= a2.get_rva();}
207 bool operator> (
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() > a2.get_rva();}
208 bool operator>=(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() >= a2.get_rva();}
209 bool operator==(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() == a2.get_rva();}
210 bool operator!=(
const rose_rva_t &a1,
const rose_rva_t &a2) {
return a1.get_rva() != a2.get_rva();}
Contiguous region of a file.
bool is_mapped() const
Whether section desires to be mapped to memory.
rose_addr_t get_base_va() const
Base virtual address for a section.
A relative virtual address optionally associated with a SgAsmSection.
rose_addr_t get_mapped_preferred_rva() const
Property: Relative virtual address where section prefers to be mapped.