objectFile return the object for the specified mapping, opening it if necessary. It returns nil on error.
(m *profile.Mapping)
| 788 | // objectFile return the object for the specified mapping, opening it if necessary. |
| 789 | // It returns nil on error. |
| 790 | func (sp *sourcePrinter) objectFile(m *profile.Mapping) plugin.ObjFile { |
| 791 | if m == nil { |
| 792 | return nil |
| 793 | } |
| 794 | if object, ok := sp.objects[m.File]; ok { |
| 795 | return object // May be nil if we detected an error earlier. |
| 796 | } |
| 797 | object, err := sp.objectTool.Open(m.File, m.Start, m.Limit, m.Offset, m.KernelRelocationSymbol) |
| 798 | if err != nil { |
| 799 | object = nil |
| 800 | } |
| 801 | sp.objects[m.File] = object // Cache even on error. |
| 802 | return object |
| 803 | } |
| 804 | |
| 805 | // makeWebListLine returns the contents of a single line in a web listing. This includes |
| 806 | // the source line and the corresponding assembly. |
no test coverage detected