@@ -1068,29 +1068,29 @@ func (stack *evalStack) executeOp() {
10681068 gvar := newVariable ("curg" , fakeAddressUnresolv , typ , scope .BinInfo , scope .Mem )
10691069 gvar .loaded = true
10701070 gvar .Flags = VariableFakeAddress
1071- gvar .Children = append (gvar .Children , * newConstant (constant .MakeInt64 (0 ), scope .Mem ))
1071+ gvar .Children = append (gvar .Children , * newConstant (constant .MakeInt64 (0 ), scope .BinInfo , scope . Mem ))
10721072 gvar .Children [0 ].Name = "goid"
10731073 stack .push (gvar )
10741074 }
10751075
10761076 case * evalop.PushFrameoff :
1077- stack .push (newConstant (constant .MakeInt64 (scope .frameOffset ), scope .Mem ))
1077+ stack .push (newConstant (constant .MakeInt64 (scope .frameOffset ), scope .BinInfo , scope . Mem ))
10781078
10791079 case * evalop.PushRangeParentOffset :
10801080 if scope .rangeFrames == nil {
10811081 stack .err = scope .setupRangeFrames ()
10821082 }
10831083 if len (scope .rangeFrames ) > 0 {
1084- stack .push (newConstant (constant .MakeInt64 (scope .rangeFrames [len (scope .rangeFrames )- 2 ].FrameOffset ()), scope .Mem ))
1084+ stack .push (newConstant (constant .MakeInt64 (scope .rangeFrames [len (scope .rangeFrames )- 2 ].FrameOffset ()), scope .BinInfo , scope . Mem ))
10851085 } else {
1086- stack .push (newConstant (constant .MakeInt64 (0 ), scope .Mem ))
1086+ stack .push (newConstant (constant .MakeInt64 (0 ), scope .BinInfo , scope . Mem ))
10871087 }
10881088
10891089 case * evalop.PushThreadID :
1090- stack .push (newConstant (constant .MakeInt64 (int64 (scope .threadID )), scope .Mem ))
1090+ stack .push (newConstant (constant .MakeInt64 (int64 (scope .threadID )), scope .BinInfo , scope . Mem ))
10911091
10921092 case * evalop.PushConst :
1093- stack .push (newConstant (op .Value , scope .Mem ))
1093+ stack .push (newConstant (op .Value , scope .BinInfo , scope . Mem ))
10941094
10951095 case * evalop.PushLocal :
10961096 found := stack .pushLocal (scope , op .Name , op .Frame )
@@ -1133,7 +1133,7 @@ func (stack *evalStack) executeOp() {
11331133
11341134 case * evalop.PushLen :
11351135 v := stack .peek ()
1136- stack .push (newConstant (constant .MakeInt64 (v .Len ), scope .Mem ))
1136+ stack .push (newConstant (constant .MakeInt64 (v .Len ), scope .BinInfo , scope . Mem ))
11371137
11381138 case * evalop.Select :
11391139 scope .evalStructSelector (op , stack )
@@ -1172,7 +1172,7 @@ func (stack *evalStack) executeOp() {
11721172 return
11731173 }
11741174 x .loadValue (loadFullValue )
1175- stack .push (newConstant (x .Value , scope .Mem ))
1175+ stack .push (newConstant (x .Value , scope .BinInfo , scope . Mem ))
11761176
11771177 case * evalop.Pop :
11781178 stack .pop ()
@@ -1335,7 +1335,7 @@ func (stack *evalStack) pushIdent(scope *EvalScope, name string) (found bool) {
13351335
13361336 switch name {
13371337 case "true" , "false" :
1338- stack .push (newConstant (constant .MakeBool (name == "true" ), scope .Mem ))
1338+ stack .push (newConstant (constant .MakeBool (name == "true" ), scope .BinInfo , scope . Mem ))
13391339 return true
13401340 case "nil" :
13411341 stack .push (nilVariable )
@@ -1846,18 +1846,18 @@ func capBuiltin(args []*Variable, nodeargs []ast.Expr) (*Variable, error) {
18461846 }
18471847 fallthrough
18481848 case reflect .Array :
1849- return newConstant (constant .MakeInt64 (arg .Len ), arg .mem ), nil
1849+ return newConstant (constant .MakeInt64 (arg .Len ), arg .bi , arg . mem ), nil
18501850 case reflect .Slice :
1851- return newConstant (constant .MakeInt64 (arg .Cap ), arg .mem ), nil
1851+ return newConstant (constant .MakeInt64 (arg .Cap ), arg .bi , arg . mem ), nil
18521852 case reflect .Chan :
18531853 arg .loadValue (loadFullValue )
18541854 if arg .Unreadable != nil {
18551855 return nil , arg .Unreadable
18561856 }
18571857 if arg .Base == 0 {
1858- return newConstant (constant .MakeInt64 (0 ), arg .mem ), nil
1858+ return newConstant (constant .MakeInt64 (0 ), arg .bi , arg . mem ), nil
18591859 }
1860- return newConstant (arg .Children [1 ].Value , arg .mem ), nil
1860+ return newConstant (arg .Children [1 ].Value , arg .bi , arg . mem ), nil
18611861 default :
18621862 return nil , invalidArgErr
18631863 }
@@ -1881,25 +1881,25 @@ func lenBuiltin(args []*Variable, nodeargs []ast.Expr) (*Variable, error) {
18811881 if arg .Unreadable != nil {
18821882 return nil , arg .Unreadable
18831883 }
1884- return newConstant (constant .MakeInt64 (arg .Len ), arg .mem ), nil
1884+ return newConstant (constant .MakeInt64 (arg .Len ), arg .bi , arg . mem ), nil
18851885 case reflect .Chan :
18861886 arg .loadValue (loadFullValue )
18871887 if arg .Unreadable != nil {
18881888 return nil , arg .Unreadable
18891889 }
18901890 if arg .Base == 0 {
1891- return newConstant (constant .MakeInt64 (0 ), arg .mem ), nil
1891+ return newConstant (constant .MakeInt64 (0 ), arg .bi , arg . mem ), nil
18921892 }
1893- return newConstant (arg .Children [0 ].Value , arg .mem ), nil
1893+ return newConstant (arg .Children [0 ].Value , arg .bi , arg . mem ), nil
18941894 case reflect .Map :
18951895 it := arg .mapIterator (0 )
18961896 if arg .Unreadable != nil {
18971897 return nil , arg .Unreadable
18981898 }
18991899 if it == nil {
1900- return newConstant (constant .MakeInt64 (0 ), arg .mem ), nil
1900+ return newConstant (constant .MakeInt64 (0 ), arg .bi , arg . mem ), nil
19011901 }
1902- return newConstant (constant .MakeInt64 (arg .Len ), arg .mem ), nil
1902+ return newConstant (constant .MakeInt64 (arg .Len ), arg .bi , arg . mem ), nil
19031903 default :
19041904 return nil , invalidArgErr
19051905 }
@@ -1970,7 +1970,7 @@ func imagBuiltin(args []*Variable, nodeargs []ast.Expr) (*Variable, error) {
19701970 return nil , fmt .Errorf ("invalid argument %s (type %s) to imag" , astutil .ExprToString (nodeargs [0 ]), arg .TypeString ())
19711971 }
19721972
1973- return newConstant (constant .Imag (arg .Value ), arg .mem ), nil
1973+ return newConstant (constant .Imag (arg .Value ), arg .bi , arg . mem ), nil
19741974}
19751975
19761976func realBuiltin (args []* Variable , nodeargs []ast.Expr ) (* Variable , error ) {
@@ -1989,7 +1989,7 @@ func realBuiltin(args []*Variable, nodeargs []ast.Expr) (*Variable, error) {
19891989 return nil , fmt .Errorf ("invalid argument %s (type %s) to real" , astutil .ExprToString (nodeargs [0 ]), arg .TypeString ())
19901990 }
19911991
1992- return newConstant (constant .Real (arg .Value ), arg .mem ), nil
1992+ return newConstant (constant .Real (arg .Value ), arg .bi , arg . mem ), nil
19931993}
19941994
19951995func minBuiltin (args []* Variable , nodeargs []ast.Expr ) (* Variable , error ) {
@@ -2121,7 +2121,7 @@ func (scope *EvalScope) evalIndex(op *evalop.Index, stack *evalStack) {
21212121 s := constant .StringVal (idxev .Value )
21222122 thc , err := totalHitCountByName (scope .target .Breakpoints ().Logical , s )
21232123 if err == nil {
2124- stack .push (newConstant (constant .MakeUint64 (thc ), scope .Mem ))
2124+ stack .push (newConstant (constant .MakeUint64 (thc ), scope .BinInfo , scope . Mem ))
21252125 }
21262126 stack .err = err
21272127 return
@@ -2137,7 +2137,7 @@ func (scope *EvalScope) evalIndex(op *evalop.Index, stack *evalStack) {
21372137 }
21382138 thc , err := totalHitCountByID (scope .target .Breakpoints ().Logical , int (n ))
21392139 if err == nil {
2140- stack .push (newConstant (constant .MakeUint64 (thc ), scope .Mem ))
2140+ stack .push (newConstant (constant .MakeUint64 (thc ), scope .BinInfo , scope . Mem ))
21412141 }
21422142 stack .err = err
21432143 return
@@ -2371,7 +2371,7 @@ func (scope *EvalScope) evalUnary(op *evalop.Unary, stack *evalStack) {
23712371 stack .push (r )
23722372 return
23732373 }
2374- stack .push (newConstant (rc , xv .mem ))
2374+ stack .push (newConstant (rc , xv .bi , xv . mem ))
23752375}
23762376
23772377func negotiateType (op token.Token , xv , yv * Variable ) (godwarf.Type , error ) {
@@ -2502,7 +2502,7 @@ func (scope *EvalScope) evalBinary(binop *evalop.Binary, stack *evalStack) {
25022502 stack .err = err
25032503 return
25042504 }
2505- stack .push (newConstant (constant .MakeBool (v ), xv .mem ))
2505+ stack .push (newConstant (constant .MakeBool (v ), xv .bi , xv . mem ))
25062506
25072507 default :
25082508 if xv .Kind == reflect .String {
@@ -2528,7 +2528,7 @@ func (scope *EvalScope) evalBinary(binop *evalop.Binary, stack *evalStack) {
25282528 }
25292529
25302530 if typ == nil {
2531- stack .push (newConstant (rc , xv .mem ))
2531+ stack .push (newConstant (rc , xv .bi , xv . mem ))
25322532 return
25332533 }
25342534
0 commit comments