From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24164 invoked by alias); 17 Sep 2012 19:59:33 -0000 Received: (qmail 24152 invoked by uid 22791); 17 Sep 2012 19:59:31 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Sep 2012 19:59:18 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TDhTR-0004Kz-NB from Mike_Wrighton@mentor.com for gdb-patches@sourceware.org; Mon, 17 Sep 2012 12:59:17 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 17 Sep 2012 12:59:17 -0700 Received: from [172.30.7.20] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Mon, 17 Sep 2012 12:59:16 -0700 Message-ID: <50578114.3080307@mentor.com> Date: Mon, 17 Sep 2012 19:59:00 -0000 From: Mike Wrighton User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Subject: [commit] Hardware breakpoint errors patch, gdb/MAINTAINERS Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00323.txt.bz2 Hi, I've committed the following patches to fix the hardware breakpoint errors bug and add myself to the gdb/MAINTAINERS list (I had to correct an error in the gdb/Changelog entry hence 2 patches for that file). Regards, Mike =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.702 retrieving revision 1.703 diff -u -r1.702 -r1.703 --- src/gdb/breakpoint.c 2012/08/27 16:55:35 1.702 +++ src/gdb/breakpoint.c 2012/09/12 20:01:10 1.703 @@ -2375,9 +2375,12 @@ insert_bp_location (struct bp_location *bl, struct ui_file *tmp_error_stream, int *disabled_breaks, - int *hw_breakpoint_error) + int *hw_breakpoint_error, + int *hw_bp_error_explained_already) { int val = 0; + char *hw_bp_err_string = NULL; + struct gdb_exception e; if (!should_be_inserted (bl) || (bl->inserted && !bl->needs_update)) return 0; @@ -2474,8 +2477,15 @@ || !(section_is_overlay (bl->section))) { /* No overlay handling: just set the breakpoint. */ - - val = bl->owner->ops->insert_location (bl); + TRY_CATCH (e, RETURN_MASK_ALL) + { + val = bl->owner->ops->insert_location (bl); + } + if (e.reason < 0) + { + val = 1; + hw_bp_err_string = (char *) e.message; + } } else { @@ -2509,7 +2519,15 @@ if (section_is_mapped (bl->section)) { /* Yes. This overlay section is mapped into memory. */ - val = bl->owner->ops->insert_location (bl); + TRY_CATCH (e, RETURN_MASK_ALL) + { + val = bl->owner->ops->insert_location (bl); + } + if (e.reason < 0) + { + val = 1; + hw_bp_err_string = (char *) e.message; + } } else { @@ -2545,11 +2563,13 @@ { if (bl->loc_type == bp_loc_hardware_breakpoint) { - *hw_breakpoint_error = 1; - fprintf_unfiltered (tmp_error_stream, - "Cannot insert hardware " - "breakpoint %d.\n", - bl->owner->number); + *hw_breakpoint_error = 1; + *hw_bp_error_explained_already = hw_bp_err_string != NULL; + fprintf_unfiltered (tmp_error_stream, + "Cannot insert hardware breakpoint %d%s", + bl->owner->number, hw_bp_err_string ? ":" : ".\n"); + if (hw_bp_err_string) + fprintf_unfiltered (tmp_error_stream, "%s.\n", hw_bp_err_string); } else { @@ -2741,6 +2761,7 @@ int val = 0; int disabled_breaks = 0; int hw_breakpoint_error = 0; + int hw_bp_details_reported = 0; struct ui_file *tmp_error_stream = mem_fileopen (); struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream); @@ -2775,7 +2796,7 @@ continue; val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, - &hw_breakpoint_error); + &hw_breakpoint_error, &hw_bp_details_reported); if (val) error_flag = val; } @@ -2800,6 +2821,7 @@ int val = 0; int disabled_breaks = 0; int hw_breakpoint_error = 0; + int hw_bp_error_explained_already = 0; struct ui_file *tmp_error_stream = mem_fileopen (); struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream); @@ -2833,7 +2855,7 @@ continue; val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, - &hw_breakpoint_error); + &hw_breakpoint_error, &hw_bp_error_explained_already); if (val) error_flag = val; } @@ -2878,7 +2900,7 @@ { /* If a hardware breakpoint or watchpoint was inserted, add a message about possibly exhausted resources. */ - if (hw_breakpoint_error) + if (hw_breakpoint_error && !hw_bp_error_explained_already) { fprintf_unfiltered (tmp_error_stream, "Could not insert hardware breakpoints:\n\ @@ -2943,7 +2965,7 @@ struct bp_location *bl, **blp_tmp; int val; struct ui_file *tmp_error_stream; - int dummy1 = 0, dummy2 = 0; + int dummy1 = 0, dummy2 = 0, dummy3 = 0; struct inferior *inf; struct thread_info *tp; @@ -2967,7 +2989,7 @@ if (bl->inserted) { bl->inserted = 0; - val = insert_bp_location (bl, tmp_error_stream, &dummy1, &dummy2); + val = insert_bp_location (bl, tmp_error_stream, &dummy1, &dummy2, &dummy3); if (val != 0) { do_cleanups (old_chain); =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.509 retrieving revision 1.510 diff -u -r1.509 -r1.510 --- src/gdb/remote.c 2012/08/28 14:08:41 1.509 +++ src/gdb/remote.c 2012/09/12 20:01:10 1.510 @@ -7026,6 +7026,7 @@ int ch; int tcount = 0; char *p; + char *message; /* Catch cases like trying to read memory or listing threads while we're waiting for a stop reply. The remote server wouldn't be @@ -8181,6 +8182,7 @@ CORE_ADDR addr; struct remote_state *rs; char *p, *endbuf; + char *message; /* The length field should be set to the size of a breakpoint instruction, even though we aren't inserting one ourselves. */ @@ -8215,6 +8217,13 @@ switch (packet_ok (rs->buf, &remote_protocol_packets[PACKET_Z1])) { case PACKET_ERROR: + if (rs->buf[1] == '.') + { + message = strchr (rs->buf + 2, '.'); + if (message) + error ("Remote failure reply: %s", message + 1); + } + return -1; case PACKET_UNKNOWN: return -1; case PACKET_OK: =================================================================== RCS file: /cvs/src/src/gdb/MAINTAINERS,v retrieving revision 1.490 retrieving revision 1.491 diff -u -r1.490 -r1.491 --- src/gdb/MAINTAINERS 2012/08/30 18:59:53 1.490 +++ src/gdb/MAINTAINERS 2012/09/17 14:26:29 1.491 @@ -645,6 +645,7 @@ Nathan Williams nathanw@wasabisystems.com Bob Wilson bob.wilson@acm.org Jim Wilson wilson@tuliptree.org +Mike Wrighton wrighton@codesourcery.com Kwok Cheung Yeung kcy@codesourcery.com Elena Zannoni elena.zannoni@oracle.com Eli Zaretskii eliz@gnu.org =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.14670 retrieving revision 1.14671 diff -u -r1.14670 -r1.14671 --- src/gdb/ChangeLog 2012/09/17 18:27:57 1.14670 +++ src/gdb/ChangeLog 2012/09/17 19:16:48 1.14671 @@ -1,3 +1,7 @@ +2012-09-17 Mike Wrighton + + * MAINTAINERS (Write After Approval): Add "Mike Wrighton". + 2012-09-17 Jan Kratochvil * common/linux-ptrace.c: Change __i386__ to __i386__ || __x86_64__. @@ -175,6 +179,7 @@ (DECLARE_REGISTRY): Declare struct TAG ## _data. Use the tagged callback typedefs. +>>>>>>> 1.14670 2012-09-12 Doug Evans * dwarf2read.c (dwarf2_read_addr_index): Fix handling the case where =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.14671 retrieving revision 1.14672 diff -u -r1.14671 -r1.14672 --- src/gdb/ChangeLog 2012/09/17 19:16:48 1.14671 +++ src/gdb/ChangeLog 2012/09/17 19:29:52 1.14672 @@ -179,7 +179,6 @@ (DECLARE_REGISTRY): Declare struct TAG ## _data. Use the tagged callback typedefs. ->>>>>>> 1.14670 2012-09-12 Doug Evans * dwarf2read.c (dwarf2_read_addr_index): Fix handling the case where