Skip to content

Commit

Permalink
findtypes: fix parsing of <== line
Browse files Browse the repository at this point in the history
  • Loading branch information
aclements committed Mar 3, 2017
1 parent 446101c commit e40154a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion findtypes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ type greyobjectFailure struct {

var (
spanRe = regexp.MustCompile(`base=.* s\.elemsize=(\d+)`)
baseRe = regexp.MustCompile(`\*\(base\+(\d+)\) = (0x[0-9a-f]+)$`)
baseRe = regexp.MustCompile(`\*\(base\+(\d+)\) = (0x[0-9a-f]+)( <==)?$`)
)

func parseGreyobject(r io.Reader) *greyobjectFailure {
Expand All @@ -245,6 +245,9 @@ func parseGreyobject(r io.Reader) *greyobjectFailure {
offset, _ := strconv.ParseInt(subs[1], 0, 64)
val, _ := strconv.ParseInt(subs[2], 0, 64)

// TODO: This only recognizes heap pointers. Maybe
// look at the binary to figure out reasonable global
// pointers?
known := 2
if val>>32 == 0xc4 {
known = 1
Expand Down

0 comments on commit e40154a

Please sign in to comment.