This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]