| 59 | } |
| 60 | |
| 61 | func (this *MapsHelper) GetRegionInfo(pid_maps *ProcMaps, addr uint64) string { |
| 62 | var info string = fmt.Sprintf("0x%x <unknown>", addr) |
| 63 | for _, lib_infos := range *pid_maps { |
| 64 | for _, lib_info := range lib_infos { |
| 65 | if addr >= lib_info.BaseAddr && addr < lib_info.EndAddr { |
| 66 | offset := lib_info.Off + (addr - lib_info.BaseAddr) |
| 67 | info = fmt.Sprintf("0x%x <%s + 0x%x>", addr, lib_info.LibName, offset) |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | return info |
| 72 | } |
| 73 | |
| 74 | func (this *ProcMaps) Clone() ProcMaps { |
| 75 | maps := ProcMaps{} |