Re: The 'cold' function attribute and GDB

Eli Zaretskii
2019-05-02T15:17:54Z

> Date: Thu, 02 May 2019 10:05:41 +0300
> From: Eli Zaretskii <eliz@gnu.org>
>
> I do see in the DWARF info that print_vectorlike has 2 address ranges: its DW_AT_ranges attribute specifies a value which is shown as a list of 2 ranges in the "objdump -WR" output.

Specifically, "objdump -Wi" shows this:

<1><798e3d>: Abbrev Number: 161 (DW_TAG_subprogram)
<798e3f> DW_AT_name : print_vectorlike
<798e50> DW_AT_decl_file : 3
<798e51> DW_AT_decl_line : 1365
<798e53> DW_AT_decl_column : 1
<798e54> DW_AT_prototyped : 1
<798e54> DW_AT_type : <0x77ca19>
<798e58> DW_AT_ranges : 0x18b448 <<<<<<<<<<<<<<<<<<<<

and "objdump -WR" has this:

0018b448 011d6521 011d81d6
0018b448 012e1ce5 012e1f3b
0018b448 <End of list>

and the second range of addresses is for print_vectorlike.cold.