From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28431 invoked by alias); 13 Dec 2012 20:05:57 -0000 Received: (qmail 28415 invoked by uid 22791); 13 Dec 2012 20:05:55 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,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; Thu, 13 Dec 2012 20:05:50 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBDK5hgf012137 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Dec 2012 15:05:43 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBDK5eTJ005750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 13 Dec 2012 15:05:41 -0500 From: Tom Tromey To: "Pierre Muller" Cc: "'Joel Brobecker'" , "'asmwarrior'" , "'Eli Zaretskii'" , Subject: Re: [RFC-v5] Fix .text section offset for windows DLL (was Calling __stdcall functions in the inferior) References: <20121024194517.GK3555@adacore.com> <011901cdb2ab$48076b90$d81642b0$@muller@ics-cnrs.unistra.fr> <20121105171121.GA2972@adacore.com> <50991f5f.8382440a.1100.ffff82abSMTPIN_ADDED@mx.google.com> <509ABA17.30507@redhat.com> <000301cdbd96$f5cd9f10$e168dd30$@muller@ics-cnrs.unistra.fr> <20121122173019.GF9964@adacore.com> <15690.5992342674$1353883881@news.gmane.org> <87624si9ur.fsf@fleche.redhat.com> <001501cdccaf$ad85e9b0$0891bd10$@muller@ics-cnrs.unistra.fr> <20121207071035.GG31477@adacore.com> <37373.4003318988$1355395714@news.gmane.org> <87sj7a3p3i.fsf@fleche.redhat.com> <12936.6976012991$1355415704@news.gmane.org> Date: Thu, 13 Dec 2012 20:05:00 -0000 In-Reply-To: <12936.6976012991$1355415704@news.gmane.org> (Pierre Muller's message of "Thu, 13 Dec 2012 17:21:05 +0100") Message-ID: <87bodx4t0r.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-12/txt/msg00470.txt.bz2 Pierre> + char *section_name; /* Recorded section name. Tom> It seems like this could be const. Pierre> Sorry, Pierre> but you will need to teach me some more C language Pierre> so that I understand what that would change... Pierre> In pascal the const only exists for function/procedure parameters Pierre> not for fields of structures... Pierre> Does it simply mean that any attempt to use it Pierre> as a (char *) type will result in an error? Pierre> But them, how can you set the value of such a field? In C the const modifies the type. So "const char *section_name" means "section name is a pointer to const characters" -- that is, the characters cannot be modified via the "section_name" pointer. In this case const is probably borderline useful. In other parts of gdb, where used[*], it serves both a documentation purpose and as a barrier against coding mistakes. [*] It isn't extremely widely used since gdb predates the existence of const. Pierre> Sorry about my ignorance... Pierre> Remember that I am a pascal fan lost in C land just because Pierre> I maintain GDB pascal language support... No worries. Tom