mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 74c98bc961
			
		
	
	74c98bc961
	
	
	
		
			
			Support for position independent executables (PIE) on the native linux backend, the gdbserver backend on linux and the core backend. Also implemented in the windows native backend, but it can't be tested because go doesn't support PIE on windows yet.
		
			
				
	
	
		
			31 lines
		
	
	
		
			488 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			488 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package frame_test
 | |
| 
 | |
| import (
 | |
| 	"encoding/binary"
 | |
| 	"io/ioutil"
 | |
| 	"os"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/derekparker/delve/pkg/dwarf/frame"
 | |
| 	"github.com/pkg/profile"
 | |
| )
 | |
| 
 | |
| func BenchmarkParse(b *testing.B) {
 | |
| 	defer profile.Start(profile.CPUProfile).Stop()
 | |
| 	f, err := os.Open("testdata/frame")
 | |
| 	if err != nil {
 | |
| 		b.Fatal(err)
 | |
| 	}
 | |
| 	defer f.Close()
 | |
| 
 | |
| 	data, err := ioutil.ReadAll(f)
 | |
| 	if err != nil {
 | |
| 		b.Fatal(err)
 | |
| 	}
 | |
| 
 | |
| 	b.ResetTimer()
 | |
| 	for i := 0; i < b.N; i++ {
 | |
| 		frame.Parse(data, binary.BigEndian, 0)
 | |
| 	}
 | |
| }
 |