This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: breakpoint instruction isn't shown in disassemble or examine (x)commands?
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: Marco Molteni <molter at tin dot it>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 30 Sep 2004 16:46:31 +0200
- Subject: Re: breakpoint instruction isn't shown in disassemble or examine (x)commands?
- References: <20040930010335.2fa022b5.molter@tin.it>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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?