WinDBG/Exts/CodeAnalyzer/gdbplus/gdb-1824/src/gdb/segment.c
//////////////////////////////////////////////////////////////
// virtual address to mmaped-file address
//////////////////////////////////////////////////////////////
virtual address to mmaped-file address
virtual address to mmaped - file address
void* core_to_mmap_addr(address_t vaddr)
{
	struct ca_segment* segment = get_segment(vaddr, 1);
	if (segment && vaddr >= segment->m_vaddr && vaddr <= segment->m_vaddr + segment->m_vsize
		&& segment->m_fsize >= vaddr - segment->m_vaddr)
	{
		return segment->m_faddr + (vaddr - segment->m_vaddr);
	}
	return NULL;
}
void * core_to_mmap_addr ( address_t vaddr ) { struct ca_segment * segment = get_segment ( vaddr , 1 ) ; if ( segment && vaddr >= segment -> m_vaddr && vaddr <= segment -> m_vaddr + segment -> m_vsize && segment -> m_fsize >= vaddr - segment -> m_vaddr ) { return segment -> m_faddr + ( vaddr - segment -> m_vaddr ) ; } return NULL ; }
virtual address to mmaped-file address
virtual address to mmaped - file address