Skip to content

Commit

Permalink
Merge pull request #13 from vsoch/fix/parsing-class-type-framebase
Browse files Browse the repository at this point in the history
fixing up parsing of type/class/framebases
  • Loading branch information
vsoch committed Nov 2, 2021
2 parents 0feec41 + 15f0a50 commit 6dc44e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion parsers/x86_64/allocators.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package x86_64

import (
"fmt"
"log"
)

Expand All @@ -27,7 +28,7 @@ func (a *FramebaseAllocator) updateFramebaseFromSize(size int64) {
// Get a framebase for a variable based on stack location and type
// Framebase values must be 8 byte aligned.
func (a *FramebaseAllocator) NextFramebaseFromSize(size int64) string {
result := "framebase+" + string(a.Framebase)
result := "framebase+" + fmt.Sprintf("%d", a.Framebase)

// Update the framebase for the next parameter based on the type
a.updateFramebaseFromSize(size)
Expand Down
2 changes: 1 addition & 1 deletion parsers/x86_64/classify.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func ClassifyBasic(c *file.Component, ptrCount *int64) Classification {

// Integral types
switch c.Class {
case "Uint", "Int", "Char", "Uchar", "Basic":
case "Uint", "Int", "Char", "Uchar", "Basic", "Bool":
if size > 128 {
return Classification{Lo: SSE, Hi: SSEUP, Name: "IntegerVec"}
}
Expand Down
3 changes: 2 additions & 1 deletion parsers/x86_64/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func ParseParameter(c file.Component, d *dwarf.Data, symbol file.Symbol, indirec
func ParseTypedef(c file.Component, symbol file.Symbol, indirections *int64, seen *map[string]file.Component, isCallSite bool) descriptor.Parameter {
convert := c.RawType.(*dwarf.TypedefType)
direction := GetDirection(convert.Name, isCallSite)
return descriptor.BasicParameter{Name: convert.Name, Size: convert.CommonType.Size(), Type: convert.Type.Common().Name, Direction: direction}
return descriptor.BasicParameter{Name: convert.Name, Size: convert.CommonType.Size(), Type: convert.Type.Common().Name,
Direction: direction, Class: "TypeDef"}
}

// ParseEnumType parses an enum type
Expand Down

0 comments on commit 6dc44e3

Please sign in to comment.