Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: patch for invalid hw breakpoints
Date: Mon, 05 Jun 2006 14:30:00 -0000	[thread overview]
Message-ID: <44843FD6.7060300@codesourcery.com> (raw)
In-Reply-To: <uac8wdk30.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

Eli Zaretskii wrote:
>>Date: Thu, 1 Jun 2006 17:11:59 -0400
>>From: Daniel Jacobowitz <drow@false.org>
>>Cc: Nathan Sidwell <nathan@codesourcery.com>, gdb-patches@sourceware.org
>>

> 
> Indeed.  But I think remote.c shouldn't throw an internal error in
> such cases.

This patch ok?

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


[-- Attachment #2: remote-1.patch --]
[-- Type: text/x-patch, Size: 3301 bytes --]

2006-06-05  Nathan Sidwell  <nathan@codesourcery.com>

	* gdb/remote.c (remote_insert_watchpoint): Return -1, rather than
	fatal error if packet is disabled.
	(remote_remove_watchpoint, remote_insert_hw_breakpoint,
	remote_remove_hw_breakpoint): Likewise.

Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.202.2.4
diff -c -3 -p -r1.202.2.4 remote.c
*** gdb/remote.c	24 May 2006 08:00:02 -0000	1.202.2.4
--- gdb/remote.c	5 Jun 2006 14:26:11 -0000
*************** remote_insert_watchpoint (CORE_ADDR addr
*** 4670,4678 ****
    enum Z_packet_type packet = watchpoint_to_Z_packet (type);
  
    if (remote_protocol_packets[PACKET_Z0 + packet].support == PACKET_DISABLE)
!     error (_("Can't set hardware watchpoints without the '%s' (%s) packet."),
! 	   remote_protocol_packets[PACKET_Z0 + packet].name,
! 	   remote_protocol_packets[PACKET_Z0 + packet].title);
  
    sprintf (buf, "Z%x,", packet);
    p = strchr (buf, '\0');
--- 4670,4676 ----
    enum Z_packet_type packet = watchpoint_to_Z_packet (type);
  
    if (remote_protocol_packets[PACKET_Z0 + packet].support == PACKET_DISABLE)
!     return -1;
  
    sprintf (buf, "Z%x,", packet);
    p = strchr (buf, '\0');
*************** remote_remove_watchpoint (CORE_ADDR addr
*** 4705,4714 ****
    enum Z_packet_type packet = watchpoint_to_Z_packet (type);
  
    if (remote_protocol_packets[PACKET_Z0 + packet].support == PACKET_DISABLE)
!     error (_("Can't clear hardware watchpoints without the '%s' (%s) packet."),
! 	   remote_protocol_packets[PACKET_Z0 + packet].name,
! 	   remote_protocol_packets[PACKET_Z0 + packet].title);
! 
    sprintf (buf, "z%x,", packet);
    p = strchr (buf, '\0');
    addr = remote_address_masked (addr);
--- 4703,4710 ----
    enum Z_packet_type packet = watchpoint_to_Z_packet (type);
  
    if (remote_protocol_packets[PACKET_Z0 + packet].support == PACKET_DISABLE)
!     return -1;
!   
    sprintf (buf, "z%x,", packet);
    p = strchr (buf, '\0');
    addr = remote_address_masked (addr);
*************** remote_insert_hw_breakpoint (CORE_ADDR a
*** 4796,4805 ****
    BREAKPOINT_FROM_PC (&addr, &len);
  
    if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
!     error (_("Can't set hardware breakpoint without the '%s' (%s) packet."),
! 	   remote_protocol_packets[PACKET_Z1].name,
! 	   remote_protocol_packets[PACKET_Z1].title);
! 
    *(p++) = 'Z';
    *(p++) = '1';
    *(p++) = ',';
--- 4792,4799 ----
    BREAKPOINT_FROM_PC (&addr, &len);
  
    if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
!     return -1;
!   
    *(p++) = 'Z';
    *(p++) = '1';
    *(p++) = ',';
*************** remote_remove_hw_breakpoint (CORE_ADDR a
*** 4838,4846 ****
    BREAKPOINT_FROM_PC (&addr, &len);
  
    if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
!     error (_("Can't clear hardware breakpoint without the '%s' (%s) packet."),
! 	   remote_protocol_packets[PACKET_Z1].name,
! 	   remote_protocol_packets[PACKET_Z1].title);
  
    *(p++) = 'z';
    *(p++) = '1';
--- 4832,4838 ----
    BREAKPOINT_FROM_PC (&addr, &len);
  
    if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
!     return -1;
  
    *(p++) = 'z';
    *(p++) = '1';

  parent reply	other threads:[~2006-06-05 14:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <447EE9A8.4050800@codesourcery.com>
2006-06-01 17:21 ` Eli Zaretskii
2006-06-01 17:26   ` Daniel Jacobowitz
2006-06-01 17:46     ` Nathan Sidwell
2006-06-01 18:03       ` Daniel Jacobowitz
2006-06-01 20:53         ` Eli Zaretskii
2006-06-01 21:12           ` Daniel Jacobowitz
2006-06-02  8:44             ` Eli Zaretskii
2006-06-02 13:52               ` Daniel Jacobowitz
2006-06-02 20:56                 ` Eli Zaretskii
2006-06-02 20:57                   ` Daniel Jacobowitz
2006-06-05 14:30               ` Nathan Sidwell [this message]
2006-06-05 19:58                 ` Eli Zaretskii
2006-06-02  7:26         ` Nathan Sidwell
2006-06-02  8:13           ` Eli Zaretskii
2006-06-01 18:33       ` Nathan Sidwell

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=44843FD6.7060300@codesourcery.com \
    --to=nathan@codesourcery.com \
    --cc=dan@codesourcery.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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