Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, simark@simark.ca
Subject: Re: The 'cold' function attribute and GDB
Date: Thu, 02 May 2019 19:45:00 -0000	[thread overview]
Message-ID: <20190502124509.0d2c546c@f29-4.lan> (raw)
In-Reply-To: <83y33oodv2.fsf@gnu.org>

On Thu, 02 May 2019 22:28:17 +0300
Eli Zaretskii <eliz@gnu.org> wrote:

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

What I (think I) actually want to see is "x/i 0x012e1f36".

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.

If so, it should be possible to debug this problem without needing
to actually run it.

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.

Kevin


  reply	other threads:[~2019-05-02 19:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 18:59 Eli Zaretskii
2019-05-01 20:17 ` Simon Marchi
2019-05-02  2:51   ` Kevin Buettner
2019-05-02  6:59     ` Eli Zaretskii
2019-05-02  7:26       ` Kevin Buettner
2019-05-02 15:27         ` Eli Zaretskii
2019-05-02 15:59           ` Kevin Buettner
2019-05-02 16:46             ` Eli Zaretskii
2019-05-02 18:08               ` Simon Marchi
2019-05-02 18:47                 ` Eli Zaretskii
2019-05-02 18:55                   ` Kevin Buettner
2019-05-02 19:32                     ` Eli Zaretskii
2019-05-02 19:51                       ` Kevin Buettner
2019-05-02  7:06     ` Eli Zaretskii
2019-05-02  7:38       ` Kevin Buettner
2019-05-02 15:23         ` Eli Zaretskii
2019-05-02 15:56           ` Kevin Buettner
2019-05-02 16:43             ` Eli Zaretskii
2019-05-02 18:25           ` Kevin Buettner
2019-05-02 18:52             ` Eli Zaretskii
2019-05-02 19:13               ` Kevin Buettner
2019-05-02 19:28                 ` Eli Zaretskii
2019-05-02 19:45                   ` Kevin Buettner [this message]
2019-05-02 19:56                     ` Eli Zaretskii
2019-05-02 23:30                       ` Kevin Buettner
2019-05-04  8:30                         ` Eli Zaretskii
2019-05-05 20:04                           ` Kevin Buettner
2019-05-06 15:33                             ` Eli Zaretskii
2019-05-06 16:24                               ` Kevin Buettner
2019-05-02 15:17       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190502124509.0d2c546c@f29-4.lan \
    --to=kevinb@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox