Skip to content

Commit

Permalink
Filter out return values for now
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
  • Loading branch information
grantseltzer committed Dec 13, 2024
1 parent 04e1d0d commit 3f61489
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/dynamicinstrumentation/diconfig/dwarf.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func loadFunctionDefinitions(dwarfData *dwarf.Data, targetFunctions map[string]b

var (
name string
isReturn bool
typeFields *ditypes.Parameter
)

Expand Down Expand Up @@ -144,6 +145,10 @@ entryLoop:
name = entry.Field[i].Val.(string)
}

if entry.Field[i].Attr == dwarf.AttrVarParam {
isReturn = entry.Field[i].Val.(bool)
}

// Collect information about the type of this ditypes.Parameter
if entry.Field[i].Attr == dwarf.AttrType {

Expand All @@ -161,7 +166,7 @@ entryLoop:
}
}

if typeFields != nil {
if typeFields != nil && !isReturn /* we ignore return values for now */ {
// We've collected information about this ditypes.Parameter, append it to the slice of ditypes.Parameters for this function
typeFields.Name = name
result.Functions[funcName] = append(result.Functions[funcName], *typeFields)
Expand Down

0 comments on commit 3f61489

Please sign in to comment.