An ObjFile is a single object file: a shared library or executable.
| 159 | |
| 160 | // An ObjFile is a single object file: a shared library or executable. |
| 161 | type ObjFile interface { |
| 162 | // Name returns the underlying file name, if available. |
| 163 | Name() string |
| 164 | |
| 165 | // ObjAddr returns the objdump address corresponding to a runtime address. |
| 166 | ObjAddr(addr uint64) (uint64, error) |
| 167 | |
| 168 | // BuildID returns the GNU build ID of the file, or an empty string. |
| 169 | BuildID() string |
| 170 | |
| 171 | // SourceLine reports the source line information for a given |
| 172 | // address in the file. Due to inlining, the source line information |
| 173 | // is in general a list of positions representing a call stack, |
| 174 | // with the leaf function first. |
| 175 | SourceLine(addr uint64) ([]Frame, error) |
| 176 | |
| 177 | // Symbols returns a list of symbols in the object file. |
| 178 | // If r is not nil, Symbols restricts the list to symbols |
| 179 | // with names matching the regular expression. |
| 180 | // If addr is not zero, Symbols restricts the list to symbols |
| 181 | // containing that address. |
| 182 | Symbols(r *regexp.Regexp, addr uint64) ([]*Sym, error) |
| 183 | |
| 184 | // Close closes the file, releasing associated resources. |
| 185 | Close() error |
| 186 | } |
| 187 | |
| 188 | // A Frame describes a single line in a source file. |
| 189 | type Frame struct { |
no outgoing calls
no test coverage detected
searching dependent graphs…