Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Missing DWARF tags for internal inlined functions

eoseret
Beginner
777 Views

Hi,

When compiling with icc 13.1.1 (no problem with 12) and "-debug inline-debug-info" (enabled by default with -g and -O2 or higher), the following DWARF tags are missing for internal (defined in the currently compiled source file) inlined functions:

  • low_pc (DW_AT_low_pc) and high_pc (DW_AT_high_pc) for DW_TAG_subprogram objects
  • location (DW_AT_location) for DW_TAG_formal_parameter objects

Another regression was observed for internal inlined functions: for DW_TAG_subprogram objects, inline (DW_AT_inline) is set to 0 when -debug noinline-debug-info is used, but set to 1 when -debug inline-debug-info is used (the value was set to 1 with both options with icc 12)

Remarks: no problem with -fno-inline-functions or -debug noinline-debug-info

Included file: test_inline.c (compiled with -g -O2)

Thanks,
Emmanuel

0 Kudos
9 Replies
SergeyKostrov
Valued Contributor II
777 Views
>>When compiling with icc 13.1.1 (no problem with 12) and "-debug inline-debug-info" (enabled by default with -g and -O2 or >>higher), the following DWARF tags are missing for internal (defined in the currently compiled source file) inlined functions... Could you clarify if it is for Update 2 or Update 3?
0 Kudos
bernaske
New Contributor I
777 Views

Hi,

i have compile the sample with icc 13.1.1 ( Parallel Studio XE 2013 update 3), gcc-4.7.2, gcc-4.8 all under openSUSE 12.3 linux , result

Program received signal SIGSEGV
__GI_____strtol_l_internal () in /lib64/libc-2.17.so
( output Intel IDB Debugger )

best regards

Franz

0 Kudos
eoseret
Beginner
777 Views

update 3

0 Kudos
eoseret
Beginner
777 Views

bernaske wrote:

Program received signal SIGSEGV
__GI_____strtol_l_internal () in /lib64/libc-2.17.so
( output Intel IDB Debugger )

It is not necessary to run the generated binary for this topic. If you want to try it anyway, just pass a positive integer in the command line (an array of atoi(argv[1]) elements is allocated)

0 Kudos
Brock_W_Intel
Employee
777 Views

Hello Emmanuel,

Is it possible you are looking at the abstract DIE for the inlined instance?  These will not have low/high PC's and the formal parameters will not have location information.  These high/low pc attributes will only be present for DW_TAG_inlined_subroutine and an out-of-line concrete instance of DW_TAG_subprogram if one is emitted.

The presence of a DW_AT_inline attribute implies an abstract DIE, but we don't emit abstract DIE's unless we are emitting inline information.  So the absence of a DW_AT_inline attribute when using -debug noinline-debug-info seems correct to me.

 

0 Kudos
eoseret
Beginner
777 Views

For this issue, I am talking about the "foo" function (I should have precised that). You will find enclosed corresponding DIEs ("idi" means explicit use of -debug inline-debug-info and, "no_idi", -debug noinline-debug-info) and full DWARF dumps ("full" in the file name).

For icc 12, idi has no effect (no diff between icc_12_no_idi.txt and icc_12_idi.txt => only one is enclosed, named icc_12.txt + idem for full).
icc_13_no_idi.txt is very similar to icc_12.txt: tags we are talking about are present but, in icc_12.txt, DW_AT_inline is set to 1 and, in icc_13_no_idi.txt, it is set to 0.
The problem is visible in icc_13_idi.txt: low/high_pc flags and most of formal parameter flags are lost (contrary to no_idi). When searching in icc_13_idi_full.txt, we can retrieve (via DW_AT_abstract_origin) some formal parameter flags like DW_AT_name but still not DW_AT_location (for parameters) nor DW_AT_low/high_pc.

My questions are now: "Is icc 13 behaving correctly for foo when using -debug inline-debug-info ?" and "Where/How can I retrieve lost informations: DW_AT_low_pc, DW_AT_high_pc (for foo) and DW_AT_location (for foo parameters) ?

Thanks,
Emmanuel

0 Kudos
eoseret
Beginner
777 Views

I don't find my attachments. I retry...

0 Kudos
SergeyKostrov
Valued Contributor II
777 Views
>>..."-debug inline-debug-info" (enabled by default with -g and -O2 or higher)... I have a question about -g option: Is it supported by Intel C++ compiler on Windows platforms? Thanks in advance.
0 Kudos
Brock_W_Intel
Employee
777 Views

Emmanuel,

Thank you for posting the readelf output.  We are currently planning to address the missing attributes in the next major release.  I'll see if there is something we can do before then.

0 Kudos
Reply