public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Dinn <adinn@redhat.com>
To: gdb@sourceware.org
Subject: Re: Question about disassembly
Date: Thu, 11 Mar 2021 12:22:12 +0000	[thread overview]
Message-ID: <4425a354-036c-7995-8b47-a92983b340e0@redhat.com> (raw)
In-Reply-To: <CAPTJ0XFJK0NT3fU6AUoj+OEpoRG2X8u2SgSKsOo0177YB0FgXQ@mail.gmail.com>

On 11/03/2021 12:16, Christian Biesinger via Gdb wrote:
> On Thu, Mar 11, 2021, 13:07 Mahmood Naderan via Gdb <gdb@sourceware.org>
> wrote:
> 
>> Hi
>> How can I debug disassembly instructions with "step" or "next"?
>> Right now, then I use 'n' it seems that gdb executes multiple assembly
>> instructions and then stops. Sound like it uses the source level debugging.
>>
> 
> Use stepi / nexti
You will probably want to print the next instruction after each step 
which can be done using x/i $pc.

I use the following command definitions (added to my .gdbinit).

define si
   stepi
   x/i $pc
end

define ni
   nexti
   x/i $pc
end

regards,


Andrew Dinn
-----------


  reply	other threads:[~2021-03-11 12:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 12:06 Mahmood Naderan
2021-03-11 12:16 ` Christian Biesinger
2021-03-11 12:22   ` Andrew Dinn [this message]
2021-03-11 12:29     ` Andreas Schwab
2021-03-11 23:27       ` Ruslan Kabatsayev

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=4425a354-036c-7995-8b47-a92983b340e0@redhat.com \
    --to=adinn@redhat.com \
    --cc=gdb@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).