Re: The 'cold' function attribute and GDB

Eli Zaretskii
2019-05-02T16:43:51Z

> Date: Thu, 2 May 2019 08:56:23 -0700
> From: Kevin Buettner <kevinb@redhat.com>
> Cc: gdb-patches@sourceware.org, simark@simark.ca
>
> > (gdb) break print.c:1824
> > Breakpoint 1 at 0x12e1f36: file print.c, line 1824.
> > (gdb) info line print.c:1824
> > Line 1824 of "print.c"
> > starts at address 0x12e1f36 <print_vectorlike.cold.65+593>
> > and ends at 0x12e1f3b <print_vectorlike.cold.65+598>.
>
> I'm not especially surprised that GDB chose a nearby minimal symbol to
> print here. I am surprised at the rather large offsets from that
> symbol, however. In the example that I studied last year, I think
> that the first offset was 0.

In the full disassembly of print_vectorlike, there are many jumps to
print_vectorlike.cold.65, with different offsets. The smallest offset
is indeed zero. So it looks like print_vectorlike.cold.65 is a heap
of all the "cold paths" in print_vectorlike, all of which eventually
lead to emacs_abort. The direct call to that is just one such path.

Let me know if you need help with building the master branch of Emacs.