From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4441 invoked by alias); 11 Dec 2002 22:31:32 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4425 invoked from network); 11 Dec 2002 22:31:30 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 11 Dec 2002 22:31:30 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DE2243C17; Wed, 11 Dec 2002 17:31:24 -0500 (EST) Message-ID: <3DF7BCBC.3060704@redhat.com> Date: Wed, 11 Dec 2002 14:34:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] dwarf2read.c: complain() -> complaint() References: <20021211200706.A87E13C17@localhost.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-12/txt/msg00379.txt.bz2 > ac131313@redhat.com (Andrew Cagney) writes: > >> > It looks fine to me. >> > >> > I was uncomfortable with the idea of having to create wrapper >> > functions at first --- the idea being that each occurrence of a >> > complaint string is its own independent complaint --- but it seems >> > like it'll do the right thing by default more often than making people >> > create complaint structures. So I'll go with that. > >> >> I'm not sure what you mean. The wrapper function was only suggested >> when an identical complaint is being reported from more than one place >> in the file. See "complaints.h". > > > I've read complaints.h, and complaints.c. I guess the behavior which > would make more sense to me is for complaints with identical message > texts to be treated as the same complaint, even if they're made from > distinct source locations. That way, the wrapper functions would be > unnecessary: you could just complain with the same text in two places, > and the identity of the messages would be enough to associate them. Ah, that. At the time I wrote: http://sources.redhat.com/ml/gdb-patches/2002-09/msg00446.html http://sources.redhat.com/ml/gdb-patches/2002-08/msg00360.html > I don't use the most efficient of algorithms when detecting duplicate complaints. But then, I don't know how often complaints are occuring and my objective is to fix the format miss-match. and it didn't raise an eyebrow. > As far as comparing format string addresses goes: don't compilers have > permission to merge identical strings, when strings are placed in > read-only memory? That is, if I write "foo" in two places, can't the > compiler make them both point to the same memory? > > If this is so, then the behavior of the complaints stuff depends on > compiler behavior. (Not that that's a very imporant problem.) GDB unfortunatly doesn't currently get past -Wwrite-strings so I don't think anyone tries to build it that way :-( It is definitly getting closer though! Andrew