delve/_fixtures/dwzcompression.go
Sergio Lopez bafa512067 proc_test: implement test for DWZ compressed DWARF
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.
2018-05-23 13:59:45 -07:00

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()
}