Re: The 'cold' function attribute and GDB

Eli Zaretskii
2019-05-02T19:28:55Z

> Date: Thu, 2 May 2019 12:13:05 -0700
> From: Kevin Buettner <kevinb@redhat.com>
> Cc: gdb-patches@sourceware.org, simark@simark.ca
>
> I hadn't checked before, but I do see .cold symbols...
>
> emacs:000000000058cab0 t print_vectorlike
> emacs:000000000041fed1 t print_vectorlike.cold
>
> The address for print_vectorlike.cold is exactly the address for the
> second address range for print_vectorlike:
>
> Address range 0x41fed1 to 0x41fed6:
> 0x000000000041fed1 <+-1493983>: callq 0x41cca5 <emacs_abort>
>
> It's interesting that this _doesn't_ show up when doing the following:
>
> (gdb) x/i 0x000000000041fed1
> 0x41fed1 <print_vectorlike+4293473313>: callq 0x41cca5
> <emacs_abort>
>
> What do you see when you issue a similar command for your build
> of emacs on Windows? (Apologies if you've already shown this to
> me.)

"nm -A" shows this:

011d6521 t _print_vectorlike
012e1ce5 t _print_vectorlike.cold.65

And GDB shows this:

(gdb) x/i 0x012e1ce5
0x12e1ce5 <print_vectorlike.cold.65>: movl $0xf5,0x8(%esp)