mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	 bafa512067
			
		
	
	bafa512067
	
	
	
		
			
			If dwz binary is available in the system, test delve's ability to find deduplicated symbols in the DWARF information. dwzcompression.go contains a small C function (void fortytwo()) which calls glibc's fprintf with stdin as first argument. Normally, stdin will be present as a DW_TAG_variable as part of a DW_TAG_compile_unit named dwzcompression.cgo2.c. After running dwz on the binary, stdin is moved to a DW_TAG_partial_unit, which is imported from dwzcompression.cgo2.c with a DW_TAG_imported_unit. This test verifies that delve is able to find stdin symbol's type, as a way to confirm it understands dwz's compressed/deduplicated DWARF information.
		
			
				
	
	
		
			15 lines
		
	
	
		
			176 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			176 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package main
 | |
| 
 | |
| // #include <stdio.h>
 | |
| // void fortytwo()
 | |
| // {
 | |
| //      fprintf(stdin, "42");
 | |
| // }
 | |
| import "C"
 | |
| import "runtime"
 | |
| 
 | |
| func main() {
 | |
| 	C.fortytwo()
 | |
| 	runtime.Breakpoint()
 | |
| }
 |