Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: provide parameter escape information in DWARF #27007
Now that we have function calls in debuggers (#21678), the next step is to make them safer. When the compiler generates a function call, it knows which parameters may leak to the heap, and makes sure that those parameters are heap-allocated. When a debugger forms a function call, it needs that same information so that it can do safety checks.
Just as a motivating example, consider:
If we break in
The most obvious implementation is to have the compiler add a bit to each function parameter's DWARF indicating whether it escapes or not. I think this should be as simple as copying
Seems correct to me. The receiver is probably not on that list and needs to be handled separately.
Yeah, parsetag will get the encoding, which is described at https://go.googlesource.com/go/+/f6f27bfb97b8dcaa2350829dd043d7c5a5f341ab/src/cmd/compile/internal/gc/esc.go#357