public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
To: Marco Molteni <molter@tin.it>
Cc: gdb@sources.redhat.com
Subject: Re: breakpoint instruction isn't shown in disassemble or examine (x) commands?
Date: Thu, 30 Sep 2004 14:49:00 -0000	[thread overview]
Message-ID: <01c4a6fc$Blat.v2.2.2$6bb65f60@zahav.net.il> (raw)
In-Reply-To: <20040930010335.2fa022b5.molter@tin.it> (message from Marco Molteni on Thu, 30 Sep 2004 01:03:35 +0200)

> Date: Thu, 30 Sep 2004 01:03:35 +0200
> From: Marco Molteni <molter@tin.it>
> 
> I tought of doing something like (in various incantations):
> 
> (gdb) disassemble foo
> (gdb) break foo
> (gdb) disassemble foo
> 
> and was expecting of seeing the 0xcc instruction in the output of
> the second disassemble command; instead the output is the same
> as the first disassemble. Same results with the x command.
> It seems that gdb wants to "protect" me from seing that the executable
> is changed?

This is because GDB actually inserts the breakpoint instructions only
when it is about to run the inferior program.  That is, when you type
"break foo", GDB only records that a breakpoint is to be set at the
entry to `foo'; the breakpoint instruction is written there only when
you type "run" or "continue" or some other command that runs the
inferior.  When the inferior stops for any reason, the breakpoint
instruction is removed before GDB returns to the prompt.

> So somehow I have my sanity back, but the question remains: how
> can I see the breakpoint instruction from gdb itself?

Why do you need that?  You already know what you will see there,
right?

  reply	other threads:[~2004-09-30 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29 23:05 Marco Molteni
2004-09-30 14:49 ` Eli Zaretskii [this message]
2004-09-30 19:36   ` Marco Molteni
     [not found] <1096526181.3491.ezmlm@sources.redhat.com>
2004-09-30 17:30 ` Jim Ingham
2004-09-30 19:39   ` Marco Molteni
     [not found] <52BBA75459915749B68F93B604B636CD0D421E@neptune.TidalNetworks.net>
2004-09-30 17:56 ` Jim Ingham

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='01c4a6fc$Blat.v2.2.2$6bb65f60@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=molter@tin.it \
    /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).