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: Remote Protocol: Z? packet proposal


@item @code{Z?}@code{,}@var{t}@code{,}@var{count} --- probe for breakpoint/watchpoint support @strong{(draft)}
@cindex @code{Z?} packet

@var{t} is type: see @ref{insert breakpoint or watchpoint
packet}. @var{count} is the number of breakpoints of type inserted
(including this one.)
Perhaphs

@var{t} is the breakpoint or watchpoint type (@pxref{insert breakpoint or watchpoint packet}). @var{count} is the total number of breakpoints/watchpoints of type @var{t} that need to be inserted.

Should it include that mysterious @var{other} parameter? If it isn't doing anything useful then no.

Reply:
@table @samp
@item E00
for error -- packet type not supported
TARGET_ENOSYS 78 Function not implemented

@item E01
for error -- hardware resources exhausted
TARGET_ENOSPC 28 No space left on device

@item E02
for error -- any other error
@item OK
for success
@item @samp{}
If not supported.
@end table
(Hmm, I should change the documentation to follow this style -- Split the basic Z documentation into separate entries.)

I'd make ``E00'' ``any other error''. My weak rationale is that ZERO isn't defined in <errno.h> so is safe.

For the others, I think we should adopt (abuse) POSIX <errno.h> error numbers (assuming that POSIX has defined them, anywone?). The above are guesses (but UNIX like variants like to differ on what they mean :-/).

Anyway, what ever we settle on, they should be defined in include/gdb/errno.h.

In use, this would look something like this:

user> hbreak main
 -> Z?,1,1
 <- OK
gdb> Hardware Breakpoint at main
user> hbreak foo
  -> Z?,1,2
  <- E01
gdb> Cannot insert hardware breakpoint -- exhausted resources
user> watch i
  -> Z?,2,1
  <- E00
gdb> Target does not support hardware watchpoints
(Hmm. Something else for me to change. The doco uses ``<-'' and ``->'' the other way round. Looking at posts, though, every one uses these the way you do => the doco is at fault.)

Andrew



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