mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 10:47:27 +08:00 
			
		
		
		
	 99cad1044b
			
		
	
	99cad1044b
	
	
	
		
			
			These are emitted by C compilers but also by the current development version of the go compiler with the dwarflocationlists flag.
		
			
				
	
	
		
			19 lines
		
	
	
		
			400 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			400 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package op
 | |
| 
 | |
| import "testing"
 | |
| 
 | |
| func TestExecuteStackProgram(t *testing.T) {
 | |
| 	var (
 | |
| 		instructions = []byte{byte(DW_OP_consts), 0x1c, byte(DW_OP_consts), 0x1c, byte(DW_OP_plus)}
 | |
| 		expected     = int64(56)
 | |
| 	)
 | |
| 	actual, _, err := ExecuteStackProgram(DwarfRegisters{}, instructions)
 | |
| 	if err != nil {
 | |
| 		t.Fatal(err)
 | |
| 	}
 | |
| 
 | |
| 	if actual != expected {
 | |
| 		t.Fatalf("actual %d != expected %d", actual, expected)
 | |
| 	}
 | |
| }
 |