The 'cold' function attribute and GDB

Eli Zaretskii eliz@gnu.org
Thu May 2 19:56:00 GMT 2019


> Date: Thu, 2 May 2019 12:45:09 -0700
> From: Kevin Buettner <kevinb@redhat.com>
> Cc: gdb-patches@sourceware.org, simark@simark.ca
> 
> >   (gdb) x/i 0x012e1ce5
> >      0x12e1ce5 <print_vectorlike.cold.65>:        movl   $0xf5,0x8(%esp)
> 
> What I (think I) actually want to see is "x/i 0x012e1f36".

  (gdb) x/i 0x012e1f36
     0x12e1f36 <print_vectorlike.cold.65+593>:    call   0x12e7b40 <emacs_abort>

> This is the address corresponding to the call of emacs_abort in the
> second address range.  What I want to see is whether
> print_vectorlike.cold.65 is used to print the address.

As you see, it is.

> Looking back at your earlier email where you provided me with
> the output of the disassemble command, i just noticed something
> odd:
> 
> >   Address range 0x12e1ce5 to 0x12e1f3b:
> >   1824	      emacs_abort ();
> >      0x012e1f36 <+593>:	call   0x12e7b40 <emacs_abort>
> 
> The address range includes more addresses than are shown.  I would
> have expected the range to be something like "0x012e1f36 to 0x12e1f3b"
> instead of starting at 0x12e1ce5 as shown.

As I described in an earlier message, there are many jumps to
print_vectorlike.cold.65 with different offsets from various places in
print_vectorlike's disassembly, the smallest offset is zero.  It
sounds like the 32-bit code generation produces many more "cold"
paths, and puts them all together under the name
print_vectorlike.cold.65.



More information about the Gdb-patches mailing list