MCPcopy Create free account
hub / github.com/google/pprof / objectFile

Method objectFile

internal/report/source.go:790–803  ·  view source on GitHub ↗

objectFile return the object for the specified mapping, opening it if necessary. It returns nil on error.

(m *profile.Mapping)

Source from the content-addressed store, hash-verified

788// objectFile return the object for the specified mapping, opening it if necessary.
789// It returns nil on error.
790func (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.

Callers 1

newSourcePrinterFunction · 0.95

Calls 1

OpenMethod · 0.65

Tested by

no test coverage detected