From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25329 invoked by alias); 12 Dec 2013 10:55:17 -0000 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 Received: (qmail 25317 invoked by uid 89); 12 Dec 2013 10:55:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Dec 2013 10:55:15 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBCAtALS001191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Dec 2013 05:55:10 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rBCAt949004506; Thu, 12 Dec 2013 05:55:09 -0500 Message-ID: <52A9960C.2070906@redhat.com> Date: Thu, 12 Dec 2013 10:55:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Doug Evans CC: Hui Zhu , gdb-patches ml Subject: breakpoint.c:insert_bp_location: Constify local. (was: Re: [PATCH] Let gdbserver doesn't tell GDB it support target-side breakpoint conditions and commands if it doesn't support 'Z' packet) References: <5265022F.8060203@mentor.com> <52654A2C.9010202@redhat.com> <529707C7.4040504@mentor.com> <5298AE7C.6020607@redhat.com> <529C80D2.2080608@mentor.com> <529C9B42.20600@redhat.com> <529D62F7.80701@mentor.com> <52A22582.8040509@redhat.com> <52A40015.207@mentor.com> <52A61E86.3020005@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00491.txt.bz2 On 12/09/2013 09:07 PM, Doug Evans wrote: >> > @@ -2496,12 +2496,16 @@ insert_bp_location (struct bp_location *bl, >> > /* No overlay handling: just set the breakpoint. */ >> > TRY_CATCH (e, RETURN_MASK_ALL) >> > { >> > + int val; >> > + >> > val = bl->owner->ops->insert_location (bl); >> > + if (val) >> > + bp_err = GENERIC_ERROR; >> > } >> > if (e.reason < 0) >> > { >> > - val = 1; >> > - hw_bp_err_string = (char *) e.message; >> > + bp_err = e.error; >> > + bp_err_message = (char *) e.message; > Presumably there's a sufficient reason to keep them, > but the question must be asked. :-) > Are the casts necessary? > [does bp_err_message have to be a char *] A bit of an unrelated change, but OK, I'll bite. ;-) Pushed. ---------- breakpoint.c:insert_bp_location: Constify local. gdb/ 2013-12-12 Pedro Alves * breakpoint.c (insert_bp_location): Make 'hw_bp_err_string' local const, and remove casts. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 637a462..c49895b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-12-12 Pedro Alves + * breakpoint.c (insert_bp_location): Make 'hw_bp_err_string' local + const, and remove casts. + +2013-12-12 Pedro Alves + * cli/cli-cmds.c (source_script_from_stream) Use have_python instead of catching UNSUPPORTED_ERROR. * exceptions.h (UNSUPPORTED_ERROR): Delete. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 111660f..589aa19 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2396,7 +2396,7 @@ insert_bp_location (struct bp_location *bl, int *hw_bp_error_explained_already) { int val = 0; - char *hw_bp_err_string = NULL; + const char *hw_bp_err_string = NULL; struct gdb_exception e; if (!should_be_inserted (bl) || (bl->inserted && !bl->needs_update)) @@ -2501,7 +2501,7 @@ insert_bp_location (struct bp_location *bl, if (e.reason < 0) { val = 1; - hw_bp_err_string = (char *) e.message; + hw_bp_err_string = e.message; } } else @@ -2543,7 +2543,7 @@ insert_bp_location (struct bp_location *bl, if (e.reason < 0) { val = 1; - hw_bp_err_string = (char *) e.message; + hw_bp_err_string = e.message; } } else -- 1.7.11.7