Re: The 'cold' function attribute and GDB

Kevin Buettner
2019-05-02T07:38:53Z

On Thu, 02 May 2019 10:05:41 +0300
Eli Zaretskii <eliz@gnu.org> wrote:

> On May 2, 2019 5:51:13 AM GMT+03:00, Kevin Buettner <kevinb@redhat.com> wrote:
> > On Wed, 1 May 2019 16:17:04 -0400
> > Simon Marchi <simark@simark.ca> wrote:
> >
> > > In an ideal world, if gcc generates two separate ranges
> > > of instruction for this function (the hot path and the cold path),
> > it should describe
> > > it as two ranges in the entry for print_vectorlike. If so, it
> > should be described with
> > > a DW_AT_ranges attribute.
> >
> > Yes, this is exactly right.
>
>
> 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.
>
> So where do I go from here? What to check next?

Can you show me what is printed for the following commands?

disassemble print_vectorlike
x/3i print_vectorlike
b print_vectorlike

For the disassemble command, I expect both ranges to be displayed.
The x and b commands should print insns / set a breakpoint on the entry
pc (which should NOT be the cold address) of the function. If one or more
of these things aren't happening, then something is going wrong
somewhere.

Kevin