-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
proc: use DW_AT_trampoline to detect auto-generated code (#3528)
Use the trampoline attribute to detect auto-generated code. This fixes a bug where stepping into a method of a generic type called through an interface will take the debugger into an auto-generated wrapper that does not have a dictionary and using next will step out of the wrapper. Fixes a bug reported on the #delve channel of the gophers slack server.
- Loading branch information
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
type Blah[T any] struct { | ||
x T | ||
} | ||
|
||
func (b *Blah[T]) F(y T) { | ||
b.x = y | ||
} | ||
|
||
type BlahInt interface { | ||
F(int) | ||
} | ||
|
||
func callf(b BlahInt) { | ||
b.F(2) | ||
fmt.Println(b) | ||
} | ||
|
||
func main() { | ||
b := &Blah[int]{10} | ||
callf(b) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters