This is the mail archive of the gdb-patches@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]

Re: [rfc/help] Split up Z packet enable/disable cmd


Andrew Cagney wrote:
> 
> Hello,
> 
> The attatched patch replaces the
> 
>         (gdb) set remote Z-packet {auto,on,off}
> 
> with separate set/show commands for each Z packet variant.  Support for
> software / hardware breakpoints and read/write/access watchpoints is
> orthogonal.  Targets will report no support for one but support for
> another - since GDB grouped them all together it confused the poor
> program :-(
> 
> This patch splits the Z packet enable/disable command into separate
> commands so that each sub packet can be disabled/enabled independantly.
> 

That is a great idea.  I had noticed that but my target accepts both break and
watchpoints so I hadn't implemented anything to the sort.

At first I thought your patch would conflict with my (unsubmitted) patch, but after
a closer look I see that they somewhat complementary.  Well, it does cause some
conflicts but that is life...

> 
> PS: It doesn't fix the compile time test for remote watchpoints but it
> does enable the code always (so that I've a better chance of not
> breaking it :-).
> 
Well, my patch takes care of that part. This is a good opportunity to ask what
people think of my solution.  It is working on a beta version and a candidate
for being submitted as a complement to Andrews patch.

I have set TARGET_CAN_USE_HARDWARE_WATCHPOINT to a function which will call
target_Z_packet_supported_p().  remote_Z_packet_supported_p() sends a "probe"
packet if the support is set to auto and we haven't asserted if the target
accepts or not the Z packet (OK, I will have to make it Z4 or something).

If the Z-packet support is in auto and we have not connected to the target yet,
we cannot access if watchpoints are allowed (if it is set to enabled or disabled
we assume the user knows).  In this case I print:
"Cannot set watchpoints before connecting to remote target: Z-packet support unknown."

That is the only real restriction.  As I don't meddle at all with the breakpoint.c 
code it results in a very simple fix.

There are 3 new target vector entries:
to_Z_packet_supported_p
to_insert_watchpoint
to_remove_watchpoint

Comments?
 

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@cygnus.com
2323 Yonge Street, Suite #300           Tel:  416-482-2661 ext. 311
Toronto, Ontario   M4P 2C9              Fax:  416-482-6299

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