Description of problem: User defined labels often do not have an associated DW_TAG_label. Systemtap would like to use DW_TAG_label as a means to locating probes at a particular location. Version-Release number of selected component (if applicable): gcc version 4.3.2 20081105 gcc version 4.4.0 (seems to work okay) How reproducible: Steps to Reproduce: 1.for i in g++ ; do $i -v 2>&1|grep version ; $i label.cc -g -O1 -c ; readelf --debug-dump ./label.o | awk '/DW_AT_.*stapprobe/ {print $2 " " $8}'; done 2. 3. Actual results: gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) Expected results: gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) DW_AT_name _stapprobe1_label2_16 DW_AT_name _stapprobe1_label3_25 DW_AT_name _stapprobe1_label0_22 DW_AT_name _stapprobe1_label4_31 Additional info:
Created attachment 332119 [details] test program test program
If this works in 4.4.0, then WONTFIX for 4.3.x, we are going to rebase gcc43 in RHEL5.3 to gcc44 in RHEL5.4.
If we find cases where 4.4 doesn't work, we should reopen this, right?
Yes.
Luckily it seems the system compiler (gcc 4.1.2) does get this right: gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) <2><5b>: Abbrev Number: 4 (DW_TAG_label) DW_AT_name : (indirect string, offset: 0x77): _stapprobe1_label2_16 DW_AT_decl_file : 1 DW_AT_decl_line : 8 DW_AT_low_pc : 0xe -- <2><d0>: Abbrev Number: 4 (DW_TAG_label) DW_AT_name : (indirect string, offset: 0x97): _stapprobe1_label0_22 DW_AT_decl_file : 1 DW_AT_decl_line : 23 DW_AT_low_pc : 0x18 <2><df>: Abbrev Number: 4 (DW_TAG_label) DW_AT_name : (indirect string, offset: 0x3b): _stapprobe1_label3_25 DW_AT_decl_file : 1 DW_AT_decl_line : 36 DW_AT_low_pc : 0x30 -- <2><183>: Abbrev Number: 4 (DW_TAG_label) DW_AT_name : (indirect string, offset: 0xad): _stapprobe1_label4_31 DW_AT_decl_file : 1 DW_AT_decl_line : 53 DW_AT_low_pc : 0x4a