@@ -41,6 +41,9 @@ type FuncDebug struct {
41
41
RegOutputParams []* ir.Name
42
42
// Variable declarations that were removed during optimization
43
43
OptDcl []* ir.Name
44
+ // The ssa.Func.EntryID value, used to build location lists for
45
+ // return values promoted to heap in later DWARF generation.
46
+ EntryID ID
44
47
45
48
// Filled in by the user. Translates Block and Value ID to PC.
46
49
//
@@ -1645,13 +1648,13 @@ func readPtr(ctxt *obj.Link, buf []byte) uint64 {
1645
1648
1646
1649
}
1647
1650
1648
- // setupLocList creates the initial portion of a location list for a
1651
+ // SetupLocList creates the initial portion of a location list for a
1649
1652
// user variable. It emits the encoded start/end of the range and a
1650
1653
// placeholder for the size. Return value is the new list plus the
1651
1654
// slot in the list holding the size (to be updated later).
1652
- func setupLocList (ctxt * obj.Link , f * Func , list []byte , st , en ID ) ([]byte , int ) {
1653
- start , startOK := encodeValue (ctxt , f . Entry . ID , st )
1654
- end , endOK := encodeValue (ctxt , f . Entry . ID , en )
1655
+ func SetupLocList (ctxt * obj.Link , entryID ID , list []byte , st , en ID ) ([]byte , int ) {
1656
+ start , startOK := encodeValue (ctxt , entryID , st )
1657
+ end , endOK := encodeValue (ctxt , entryID , en )
1655
1658
if ! startOK || ! endOK {
1656
1659
// This could happen if someone writes a function that uses
1657
1660
// >65K values on a 32-bit platform. Hopefully a degraded debugging
@@ -1800,7 +1803,6 @@ func isNamedRegParam(p abi.ABIParamAssignment) bool {
1800
1803
// appropriate for the ".closureptr" compiler-synthesized variable
1801
1804
// needed by the debugger for range func bodies.
1802
1805
func BuildFuncDebugNoOptimized (ctxt * obj.Link , f * Func , loggingEnabled bool , stackOffset func (LocalSlot ) int32 , rval * FuncDebug ) {
1803
-
1804
1806
needCloCtx := f .CloSlot != nil
1805
1807
pri := f .ABISelf .ABIAnalyzeFuncType (f .Type )
1806
1808
@@ -1911,7 +1913,7 @@ func BuildFuncDebugNoOptimized(ctxt *obj.Link, f *Func, loggingEnabled bool, sta
1911
1913
// Param is arriving in one or more registers. We need a 2-element
1912
1914
// location expression for it. First entry in location list
1913
1915
// will correspond to lifetime in input registers.
1914
- list , sizeIdx := setupLocList (ctxt , f , rval .LocationLists [pidx ],
1916
+ list , sizeIdx := SetupLocList (ctxt , f . Entry . ID , rval .LocationLists [pidx ],
1915
1917
BlockStart .ID , afterPrologVal )
1916
1918
if list == nil {
1917
1919
pidx ++
@@ -1961,7 +1963,7 @@ func BuildFuncDebugNoOptimized(ctxt *obj.Link, f *Func, loggingEnabled bool, sta
1961
1963
1962
1964
// Second entry in the location list will be the stack home
1963
1965
// of the param, once it has been spilled. Emit that now.
1964
- list , sizeIdx = setupLocList (ctxt , f , list ,
1966
+ list , sizeIdx = SetupLocList (ctxt , f . Entry . ID , list ,
1965
1967
afterPrologVal , FuncEnd .ID )
1966
1968
if list == nil {
1967
1969
pidx ++
0 commit comments