Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* RE: break point command Z0 not supported
@ 2003-12-05 11:57 Manoj Verma, Noida
  2003-12-05 12:51 ` Mark Salter
  0 siblings, 1 reply; 4+ messages in thread
From: Manoj Verma, Noida @ 2003-12-05 11:57 UTC (permalink / raw)
  To: Nitin Gupta; +Cc: gdb

Hi Nitin,
Your point is well understood. 

But I have one concern, 
1) If I were to implement the GDB remote serial protocol and want to talk to
'gdbserver', then is this the right way to go for implementing the breapoint
mechanism?
2) Is 'Z0' packet supported for any known target? ( The target I am using is
'arm-linux') 

Thanks.

> -----Original Message-----
> From: Nitin Gupta [mailto:nitin.gupta@nevisnetworks.com]
> Sent: Friday, December 05, 2003 5:06 PM
> To: Manoj Verma, Noida
> Cc: gdb@sources.redhat.com
> 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
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: break point command Z0 not supported
  2003-12-05 11:57 break point command Z0 not supported Manoj Verma, Noida
@ 2003-12-05 12:51 ` Mark Salter
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Salter @ 2003-12-05 12:51 UTC (permalink / raw)
  To: manojv; +Cc: gdb

>>>>> Manoj Verma, Noida writes:

> Hi Nitin,
> Your point is well understood. 

> But I have one concern, 
> 1) If I were to implement the GDB remote serial protocol and want to talk to
> 'gdbserver', then is this the right way to go for implementing the breapoint
> mechanism?

Z0 is mostly an efficiency enhancement. With Z0, the remote stub saves the
existing opcode and inserts the breakpoint opcode. This reduces traffic on
the communication channel between stub and gdb.

> 2) Is 'Z0' packet supported for any known target? ( The target I am using is
> 'arm-linux') 

Almost all RedBoot ( http://ecos.sourceware.org/redboot/ ) supported targets
use Z packets.

--Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: break point command Z0 not supported
@ 2003-12-05 11:36 Nitin Gupta
  0 siblings, 0 replies; 4+ messages in thread
From: Nitin Gupta @ 2003-12-05 11:36 UTC (permalink / raw)
  To: Manoj Verma, Noida; +Cc: gdb

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* break point command Z0 not supported
@ 2003-12-05  7:03 Manoj Verma, Noida
  0 siblings, 0 replies; 4+ messages in thread
From: Manoj Verma, Noida @ 2003-12-05  7:03 UTC (permalink / raw)
  To: gdb; +Cc: Mark Salter, Ramana Radhakrishnan

Hi,
I am doing remote debugging using GDB server over ethernet. Both host and
target are i386-linux machines.

I am debugging a simple 'Hello World' application.

On the Gdb client side: 
(gdb) break main
(gdb) set debug remote 1
(gdb) continue

I see the following packet transaction (excerpt):

########################################################################
(gdb) c
Continuing.
Sending packet: $Z0,4000acb0,1#2d...Ack
Packet received: 
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m4000acb0,1#e4...Ack
Packet received: 55
Sending packet: $M4000acb0,1:cc#c4...Ack
Packet received: OK
Sending packet: $m8048338,1#3c...Ack
Packet received: 83
Sending packet: $M8048338,1:cc#1c...Ack
Packet received: OK
...
...<Manoj: omitted non-releveant data >
...
Sending packet: $M4000acb0,1:55#68...Ack
Packet received: OK
Sending packet: $M8048338,1:83#c1...Ack
Packet received: OK
########################################################################

My questions are:
1) What does it mean by 'software-breakpoint is NOT supported'?
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?

Kindly clarify..

Thanks..






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-05 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-05 11:57 break point command Z0 not supported Manoj Verma, Noida
2003-12-05 12:51 ` Mark Salter
  -- strict thread matches above, loose matches on Subject: below --
2003-12-05 11:36 Nitin Gupta
2003-12-05  7:03 Manoj Verma, Noida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox