Пример #1
0
/** Saves a reference to the original file data for a section based on the sections current offset and size. Once we do this,
 *  changing the offset or size of the file will not affect the original data. The original data can be extended, however, by
 *  calling SgAsmGenericSection::extend(), which is typically done during parsing. */
void
SgAsmGenericSection::grab_content()
{
    SgAsmGenericFile *ef = get_file();
    ROSE_ASSERT(ef);

    if (get_offset()<=ef->get_orig_size()) {
        if (get_offset()+get_size()<=ef->get_orig_size()) {
            p_data = ef->content(get_offset(), get_size());
        } else {
            p_data = ef->content(get_offset(), ef->get_orig_size()-get_offset());
        }
    }
}