Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Christian Biesinger via Gdb <gdb@sourceware.org>
To: Peng Yu <pengyu.ut@gmail.com>
Cc: Reuben Thomas via Gdb <gdb@sourceware.org>
Subject: Re: How to display instructions around the current instuction?
Date: Thu, 28 Jan 2021 14:11:07 +0100	[thread overview]
Message-ID: <CAPTJ0XE=e4Oner21Do0wkHp3Yq9dtp7F+TsYrKs_wpqPnDn6Dg@mail.gmail.com> (raw)
In-Reply-To: <CABrM6wnFF3Gz9B62qeoqGgRZo0D-djpKPh-X6LmXGYEapqBYQw@mail.gmail.com>

On Thu, Jan 28, 2021 at 12:13 AM Peng Yu via Gdb <gdb@sourceware.org> wrote:
>
> Hi,
>
> The following command will disply instructions below the current
> instructions. Is there a way to display around the current instruction
> (e.g., 5 instructions above and 5 instructions below)?

I believe "disas" should work:

Breakpoint 1, main () at a.cpp:5

5     std::cout << "Miau\n";

(gdb) disas
Dump of assembler code for function main():
   0x0000555555555155 <+0>: push   %rbp
   0x0000555555555156 <+1>: mov    %rsp,%rbp
=> 0x0000555555555159 <+4>: lea    0xea5(%rip),%rsi        # 0x555555556005
   0x0000555555555160 <+11>: lea    0x2ed9(%rip),%rdi        #
0x555555558040 <_ZSt4cout@GLIBCXX_3.4>
   0x0000555555555167 <+18>: call   0x555555555040
<_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
   0x000055555555516c <+23>: mov    $0x0,%eax
   0x0000555555555171 <+28>: pop    %rbp
   0x0000555555555172 <+29>: ret
End of assembler dump.

  parent reply	other threads:[~2021-01-28 13:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27 23:12 Peng Yu via Gdb
2021-01-28  8:48 ` Andreas Schwab
2021-01-28 17:08   ` Peng Yu via Gdb
2021-01-28 18:44     ` Andreas Schwab
2021-01-29 17:38       ` Tavis Ormandy via Gdb
2021-01-28  9:19 ` Stefan Puiu via Gdb
2021-01-28 17:06   ` Peng Yu via Gdb
2021-01-28 17:26     ` Eli Zaretskii via Gdb
2021-01-28 17:37       ` Peng Yu via Gdb
2021-01-28 17:41         ` Christian Biesinger via Gdb
2021-01-29  2:07           ` Peng Yu via Gdb
2021-01-29  2:22             ` Sterling Augustine via Gdb
2021-01-29  2:32               ` Peng Yu via Gdb
2021-01-29  2:47                 ` Sterling Augustine via Gdb
2021-01-28 17:57         ` Eli Zaretskii via Gdb
2021-01-28 18:00     ` Stefan Puiu via Gdb
2021-01-29  2:15       ` Peng Yu via Gdb
2021-01-28 13:11 ` Christian Biesinger via Gdb [this message]
2021-01-28 16:50   ` Peng Yu via Gdb
2021-01-28 16:53     ` Christian Biesinger via Gdb
2021-01-28 17:16       ` Peng Yu via Gdb
2021-01-28 17:16         ` Christian Biesinger via Gdb
2021-01-28 17:00     ` Sterling Augustine via Gdb
     [not found]       ` <CAGOmfbFh+6AJZFsDP8nFH1bs6kntC4khO+YmPkn3LUfcLAspZw@mail.gmail.com>
2021-01-28 17:45         ` Peng Yu via Gdb
2021-01-28 18:27 ` Pedro Alves
2021-01-29  1:58   ` Peng Yu via Gdb
2021-01-29  7:18     ` Eli Zaretskii via Gdb

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='CAPTJ0XE=e4Oner21Do0wkHp3Yq9dtp7F+TsYrKs_wpqPnDn6Dg@mail.gmail.com' \
    --to=gdb@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=pengyu.ut@gmail.com \
    /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