1 // To compile this, type: 2 // g++ -shared -fPIC -g -Wall -L. -ltest0-common -o libtest0.so test0.cc 3 // 4 // Once the libtest0-common.so as been generated as well (from the 5 // test0-common.cc file), please geneate the common debug info file 6 // using the 'dwz' tool by doing: 7 // 8 // dwz -m test0-common-dwz.debug -r libtest0-common.so libtest0.so. 9 // 10 // Then, create a build-id subdirectory my doing: 11 // 12 // mkdir -p test0-debug-dir/.build-id/<first-two-chars-of-ascii-repr-of-build-id-of-test0-common-dwz.debug> 13 // Then ln -s `pwd`/test0-common-dwz.debug `pwd`/test0-debug-dir/.build-id/<build-id-of-test0-common-dwz.debug>.debug 14 15 #include "test0.h" 16 17 S global_s; 18 19 unsigned get_m2() const20S::get_m2() const 21 {return m2;} 22 23 void foo(S & s)24foo(S& s) 25 { 26 S a = s; 27 char c = a.get_m1(); 28 int i = c + a.get_m0(); 29 i += (int) a.get_m2(); 30 } 31 32 S* bar()33bar() 34 { 35 return &global_s; 36 } 37