string dumps a text representation of a location. Intended mainly for debugging purposes.
()
| 626 | // string dumps a text representation of a location. Intended mainly |
| 627 | // for debugging purposes. |
| 628 | func (l *Location) string() string { |
| 629 | ss := []string{} |
| 630 | locStr := fmt.Sprintf("%6d: %#x ", l.ID, l.Address) |
| 631 | if m := l.Mapping; m != nil { |
| 632 | locStr = locStr + fmt.Sprintf("M=%d ", m.ID) |
| 633 | } |
| 634 | if l.IsFolded { |
| 635 | locStr = locStr + "[F] " |
| 636 | } |
| 637 | if len(l.Line) == 0 { |
| 638 | ss = append(ss, locStr) |
| 639 | } |
| 640 | for li := range l.Line { |
| 641 | lnStr := "??" |
| 642 | if fn := l.Line[li].Function; fn != nil { |
| 643 | lnStr = fmt.Sprintf("%s %s:%d:%d s=%d", |
| 644 | fn.Name, |
| 645 | fn.Filename, |
| 646 | l.Line[li].Line, |
| 647 | l.Line[li].Column, |
| 648 | fn.StartLine) |
| 649 | if fn.Name != fn.SystemName { |
| 650 | lnStr = lnStr + "(" + fn.SystemName + ")" |
| 651 | } |
| 652 | } |
| 653 | ss = append(ss, locStr+lnStr) |
| 654 | // Do not print location details past the first line |
| 655 | locStr = " " |
| 656 | } |
| 657 | return strings.Join(ss, "\n") |
| 658 | } |
| 659 | |
| 660 | // string dumps a text representation of a sample. Intended mainly |
| 661 | // for debugging purposes. |
nothing calls this directly
no outgoing calls
no test coverage detected