The 'cold' function attribute and GDB

Kevin Buettner kevinb@redhat.com
Thu May 2 19:13:00 GMT 2019


On Thu, 02 May 2019 21:51:26 +0300
Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Thu, 2 May 2019 11:25:17 -0700
> > From: Kevin Buettner <kevinb@redhat.com>
> > Cc: gdb-patches@sourceware.org, simark@simark.ca
> > 
> > (gdb) x/i 0x000000000041fed1
> >    0x41fed1 <print_vectorlike+4293473313>:	callq  0x41cca5 <emacs_abort>
> > (gdb) b *0x41fed1
> > Breakpoint 6 at 0x41fed1: file /ironwood1/emacs-git/f30/bld/../../emacs/src/print.c, line 1824.
> > (gdb) info line *0x41fed1
> > Line 1824 of "/ironwood1/emacs-git/f30/bld/../../emacs/src/print.c"
> >    starts at address 0x41fed1 <print_vectorlike+4293473313>
> >    and ends at 0x5873b0 <print_unwind>.
> > 
> > These look okay to me too.  On Linux, I think we're lacking the minimal
> > symbol which Eli is seeing on Windows.  
> 
> Don't you see print_vectorlike.cold in the debug info, with objdump or
> elfread?  If not, perhaps ELF binaries record cold sections in some
> different way from PE-COFF.
> 
> I also see a lot of *.cold symbols with "nm -A" on the Emacs binary.
> Do you?

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.)

Kevin



More information about the Gdb-patches mailing list