github.com/undoio/delve@v1.9.0/_fixtures/issue2319/README.txt (about) 1 2 Note: 3 ----- 4 5 cfile-linux-amd64.syso was generated from the C source file that appears below. 6 7 Build with Clang version 10: 8 9 $ clang-10 -O -gdwarf-5 -c cfile.c -o cfile.syso 10 11 The DWARF of interest is for the function "qtop". Triggering the bug 12 requires that the source file in question appears as the first item 13 in the DWARF line table file section, e.g. 14 15 $ llvm-dwarfdump-10 --debug-line cfile.syso 16 .... 17 standard_opcode_lengths[DW_LNS_set_epilogue_begin] = 0 18 standard_opcode_lengths[DW_LNS_set_isa] = 1 19 include_directories[ 0] = "/ssd2/go1/src/tmp/dlvbug" 20 file_names[ 0]: 21 name: "cfile.c" 22 dir_index: 0 23 md5_checksum: ... 24 25 26 // ------------------------begin source code for cfile.c---------------- 27 28 #include <stdlib.h> 29 #include <string.h> 30 31 int glob = 99; 32 33 inline int qleaf(int lx, int ly, int *lv) 34 { 35 lv[lx&3] += 3; 36 return lv[ly&3]; 37 } 38 39 int qmid(int mx, int my, int *lv, int *mv) 40 { 41 mv[mx&3] += qleaf(mx, my, lv); 42 return mv[my&3]; 43 } 44 45 int qtop(int mx, int my) 46 { 47 int mv[64], lv[66], n = (mx < 64 ? 64 : mx); 48 49 memset(&mv[0], 9, sizeof(mv)); 50 memset(&lv[0], 11, sizeof(mv)); 51 return qmid(mx, my, lv, mv) + qleaf(mx, my, lv); 52 } 53 54 void Cfunc(int x) { 55 glob += qtop(x, 43); 56 } 57