This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
RE: break point command Z0 not supported
- From: "Nitin Gupta" <nitin dot gupta at nevisnetworks dot com>
- To: "Manoj Verma, Noida" <manojv at noida dot hcltech dot com>
- Cc: <gdb at sources dot redhat dot com>
- Date: Fri, 5 Dec 2003 17:06:16 +0530
- Subject: RE: break point command Z0 not supported
Hi Manoj,
> 2) The gdb is reading data at some particular location (here
> 4000acb0 & 8048338)and inserting "cc" at that address. And at
> the end of 'continue' response it replaces back the original
> data at that particular address. Is this the standard way of
> GDB functioning?
>
The way GDB and many other debuggers work is by this way only. Here is
my understanding of the ways thing happen in general.
You have a breakpoint instruction and whenever a user issues a
breakpoint at a particular location, the dubugger will _replace_ the
instruction at that very location with a breakpoint insn. It saves the
removed insn in its breakpoint table. Now when the CPU hits this
breakpoint insn, a debug exception is raised that is handled by an
appropriate handler. giving control back to GDB. at this point GDB again
_replace_ the breakpoint insn with the original insn held in its
breakpoint table. Then when you give a next or a step, this insn is
executed.
This is valid for targets that have a valid breakpoint insn. For those
not supporting breakpoint insns, alternate code that can just raise a
debug exception is inserted.
Hope this helps.
Thanks and Regards
Nitin Gupta