From: Andrew Cagney <ac131313@ges.redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb@sources.redhat.com
Subject: Re: Getting the i386 watchpoints into the taget vector?
Date: Fri, 20 Sep 2002 16:51:00 -0000 [thread overview]
Message-ID: <3D8BB499.7080306@ges.redhat.com> (raw)
In-Reply-To: <5137-Sat21Sep2002004300+0300-eliz@is.elta.co.il>
>> Date: Thu, 19 Sep 2002 21:57:40 -0400
>> From: Andrew Cagney <ac131313@ges.redhat.com>
>>
>> Instead of using a system interface, the i386 manipulates the
>> hardware watchpoint registers directly.
>
>
> Really? What I see is that most i386 ports use ptrace or similar
> interfaces to access the hardware watchpoints. So in what sense is
> this manipulation ``direct''?
(Probably bad choice of words).
GDB can implement watchpoints, for a remote target, using two mechanism:
- sending the remote target the watchpoint request (the Z packet) and
let the remote target implement the details
- manipulate the h/w watchpoint registers directly, sending the remote
target register read/write operations - what I believe i386-nat.c does.
The native equivalents are roughly:
- use some sort of custom h/w watchpoint kernel interface
- use ptrace(PT_GETREGS) / ptrace (PT_SETREGS)
>> One thought is to change the config/i386/nm-i386.h macros to something
>> native specific (native_insert_watchpoint()) and then have the various
>> native targets (infptrace.c, ...) add these methods to their target vector.
>>
>> It does restrict things to native targets. A remote target couldn't
>> make use of GDB's built-in knowledge of watchpoint registers.
>>
>> Another (less well thought out) idea, is for the target stack, to fall
>> back to the ``native watchpoint'' mechanism when the [remote] target
>> doesn't support watchpoints. I think this would mean putting the
>> ``native watchpoint'' methods in the architecture vector where the
>> target vector code could call it.
>
>
> Why not simply allow remote targets define the watchpoint-related
> macros? Let their definitions issue remote packets that will cause
> the target end DTRT. As long as the target is a i386-compatible
> machine, the internal bookkeeping we have in the current code will
> work.
I'm not sure what you mean here. If we used macro's then they would run
afowl of trying to make everything multi-arch.
Andrew
PS: Someone should implement the equivalent sim commands. sim/common
has a watchpoint framework. Just needs the sim<->gdb interface.
next prev parent reply other threads:[~2002-09-20 23:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-19 18:57 Andrew Cagney
2002-09-20 0:38 ` Kevin Buettner
2002-09-20 6:32 ` Paul Koning
2002-09-20 8:26 ` Andrew Cagney
2002-09-20 14:42 ` Eli Zaretskii
2002-09-20 16:51 ` Andrew Cagney [this message]
2002-09-21 1:32 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D8BB499.7080306@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=eliz@is.elta.co.il \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox