* Re: Z packet support in Gdbserver?
[not found] <40B3650C.5090800@axis.com>
@ 2004-05-25 15:27 ` Daniel Jacobowitz
2004-05-26 8:05 ` Orjan Friberg
2004-05-25 18:03 ` Andrew Cagney
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-05-25 15:27 UTC (permalink / raw)
To: Orjan Friberg; +Cc: gdb-patches
On Tue, May 25, 2004 at 05:23:56PM +0200, Orjan Friberg wrote:
> I noticed there's no support for z/Z packets for hardware watchpoints in
> the gdbserver. (I searched the archives for this, but came up
> empty-handed.) I'd guess that (from looking at ptrace.c for i386, where
> it accesses the DR_ registers) that the Gdbserver gets to configure the
> hardware breakpoint mechanism through ptrace (PTRACE_POKEUSR, ...). But
> how does it get there in the first place, if not as a result of a z/Z
> packet? Through direct register writes (G packet)?
It's much simpler than that: gdbserver does not support hardware
watchpoints. No one's ever implemented it. As a copy/paste exercise
it would not be too hard; I still have pipe dreams of sharing the code
with GDB someday.
--
Daniel Jacobowitz
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Z packet support in Gdbserver?
2004-05-25 15:27 ` Z packet support in Gdbserver? Daniel Jacobowitz
@ 2004-05-26 8:05 ` Orjan Friberg
0 siblings, 0 replies; 5+ messages in thread
From: Orjan Friberg @ 2004-05-26 8:05 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
It's much simpler than that: gdbserver does not support hardware
watchpoints. No one's ever implemented it. As a copy/paste exercise
it would not be too hard; I still have pipe dreams of sharing the code
with GDB someday.
Ah, that explains it. So what's needed is basically two new function
pointers in struct target_ops (insert_watchpoint/remove_watchpoint) and
a snippet of code in server.c to recognize the z/Z packets. (I assume
that's what you meant by copy/paste exercise.)
--
Orjan Friberg
Axis Communications
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Z packet support in Gdbserver?
[not found] <40B3650C.5090800@axis.com>
2004-05-25 15:27 ` Z packet support in Gdbserver? Daniel Jacobowitz
@ 2004-05-25 18:03 ` Andrew Cagney
2004-05-26 11:10 ` Orjan Friberg
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Cagney @ 2004-05-25 18:03 UTC (permalink / raw)
To: Orjan Friberg; +Cc: gdb-patches
I noticed there's no support for z/Z packets for hardware watchpoints in the gdbserver. (I searched the archives for this, but came up empty-handed.) I'd guess that (from looking at ptrace.c for i386, where it accesses the DR_ registers) that the Gdbserver gets to configure the hardware breakpoint mechanism through ptrace (PTRACE_POKEUSR, ...). But how does it get there in the first place, if not as a result of a z/Z packet? Through direct register writes (G packet)?
Yep.
There are two ways to implement h/w watchpoints: in the target (as was
done for remote.c); or in the per-architecture code (as was done for
native i386). Both are correct. The missing bit is code to get the
per-architecture logic working with a remote target - this would involve
juggling things so that the h/w watchpoint registers are included in the
regcache and the target/arch to select either a local/remote mechanism.
More notes:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=735
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Z packet support in Gdbserver?
2004-05-25 18:03 ` Andrew Cagney
@ 2004-05-26 11:10 ` Orjan Friberg
2004-05-26 17:32 ` Andrew Cagney
0 siblings, 1 reply; 5+ messages in thread
From: Orjan Friberg @ 2004-05-26 11:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney wrote:
There are two ways to implement h/w watchpoints: in the target (as was
done for remote.c); or in the per-architecture code (as was done for
native i386). Both are correct. The missing bit is code to get the
per-architecture logic working with a remote target - this would involve
juggling things so that the h/w watchpoint registers are included in the
regcache and the target/arch to select either a local/remote mechanism.
Ok; I think I understand. The CRISv32 target is unlikely to ever have a
native debugger, but as a remote target it will be debuggable in kernel
mode (using a traditional remote stub) and in user mode (using
Gdbserver). For kernel mode, I have implemented the h/w watchpoint
register setup as a response to z/Z packets, so either I have to
duplicate that in the Gdbserver, or move it all into GDB, and have it
done through G packets.
--
Orjan Friberg
Axis Communications
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Z packet support in Gdbserver?
2004-05-26 11:10 ` Orjan Friberg
@ 2004-05-26 17:32 ` Andrew Cagney
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Cagney @ 2004-05-26 17:32 UTC (permalink / raw)
To: Orjan Friberg; +Cc: gdb-patches
Andrew Cagney wrote:
There are two ways to implement h/w watchpoints: in the target (as was done for remote.c); or in the per-architecture code (as was done for native i386). Both are correct. The missing bit is code to get the per-architecture logic working with a remote target - this would involve juggling things so that the h/w watchpoint registers are included in the regcache and the target/arch to select either a local/remote mechanism.
Ok; I think I understand. The CRISv32 target is unlikely to ever have a native debugger, but as a remote target it will be debuggable in kernel mode (using a traditional remote stub) and in user mode (using Gdbserver). For kernel mode, I have implemented the h/w watchpoint register setup as a response to z/Z packets, so either I have to duplicate that in the Gdbserver, or move it all into GDB, and have it done through G packets.
Yep.
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-05-26 17:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <40B3650C.5090800@axis.com>
2004-05-25 15:27 ` Z packet support in Gdbserver? Daniel Jacobowitz
2004-05-26 8:05 ` Orjan Friberg
2004-05-25 18:03 ` Andrew Cagney
2004-05-26 11:10 ` Orjan Friberg
2004-05-26 17:32 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox