From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 955 invoked by alias); 6 Mar 2013 19:57:05 -0000 Received: (qmail 936 invoked by uid 22791); 6 Mar 2013 19:57:00 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Mar 2013 19:56:54 +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 r26Jus56002157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Mar 2013 14:56:54 -0500 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r26Jur4M025853 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 6 Mar 2013 14:56:53 -0500 Message-ID: <51379F85.4050005@redhat.com> Date: Wed, 06 Mar 2013 19:57:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: [RFA] Constify gen_printf/ax_string Content-Type: multipart/mixed; boundary="------------040701040104030708010401" 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: 2013-03/txt/msg00228.txt.bz2 This is a multi-part message in MIME format. --------------040701040104030708010401 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 658 Hi, As a follow-up to my "constify find_condition_and_thread" patch, which I am withdrawing, I will be submitting a patch to constify parse_exp_1. This patch is the only cleanup that I could split up off that (much larger) patch. Even if that approach is not liked/desired by maintainers, this patch has its own merit IMO. Tested by rebuilding (and testing on native-gdbserver, however fruitless that is on this type of patch). Keith ChangeLog 2013-03-06 Keith Seitz * ax-gdb.c (gen_printf): Make FORMAT const. * ax-gdb.h (gen_printf): Likewise. * ax-general.c (ax_string): Make STR const. * ax.h (ax_string): Likewise. --------------040701040104030708010401 Content-Type: text/x-patch; name="constify-ax_string-gen_printf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="constify-ax_string-gen_printf.patch" Content-length: 1826 diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 2029882..066826e 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -2558,7 +2558,7 @@ gen_trace_for_return_address (CORE_ADDR scope, struct gdbarch *gdbarch) struct agent_expr * gen_printf (CORE_ADDR scope, struct gdbarch *gdbarch, CORE_ADDR function, LONGEST channel, - char *format, int fmtlen, + const char *format, int fmtlen, struct format_piece *frags, int nargs, struct expression **exprs) { diff --git a/gdb/ax-gdb.h b/gdb/ax-gdb.h index e74d107..04772b7 100644 --- a/gdb/ax-gdb.h +++ b/gdb/ax-gdb.h @@ -117,7 +117,7 @@ extern void require_rvalue (struct agent_expr *ax, struct axs_value *value); struct format_piece; extern struct agent_expr *gen_printf (CORE_ADDR, struct gdbarch *, - CORE_ADDR, LONGEST, char *, int, + CORE_ADDR, LONGEST, const char *, int, struct format_piece *, int, struct expression **); diff --git a/gdb/ax-general.c b/gdb/ax-general.c index 32a47a7..8bd4df6 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -337,7 +337,7 @@ ax_tsv (struct agent_expr *x, enum agent_op op, int num) is counted in the length.) */ void -ax_string (struct agent_expr *x, char *str, int slen) +ax_string (struct agent_expr *x, const char *str, int slen) { int i; diff --git a/gdb/ax.h b/gdb/ax.h index 1c36125..32887ef 100644 --- a/gdb/ax.h +++ b/gdb/ax.h @@ -221,7 +221,7 @@ extern void ax_reg_mask (struct agent_expr *ax, int reg); extern void ax_tsv (struct agent_expr *expr, enum agent_op op, int num); /* Append a string to the bytecode stream. */ -extern void ax_string (struct agent_expr *x, char *str, int slen); +extern void ax_string (struct agent_expr *x, const char *str, int slen); /* Functions for printing out expressions, and otherwise debugging --------------040701040104030708010401--