From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20524 invoked by alias); 18 Jul 2012 16:35:17 -0000 Received: (qmail 20212 invoked by uid 22791); 18 Jul 2012 16:35:14 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 18 Jul 2012 16:34:54 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IGYrjV005838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Jul 2012 12:34:53 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6IGYqx0024840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 18 Jul 2012 12:34:53 -0400 From: Tom Tromey To: Keith Seitz Cc: "gp \>\> \"gdb-patches\@sourceware.org ml\"" Subject: Re: [RFA] Cleanup: Use add_sal_to_sals for expressions References: <5005D93D.7020808@redhat.com> Date: Wed, 18 Jul 2012 16:35:00 -0000 In-Reply-To: <5005D93D.7020808@redhat.com> (Keith Seitz's message of "Tue, 17 Jul 2012 14:29:33 -0700") Message-ID: <878veh3u4z.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (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-07/txt/msg00279.txt.bz2 >>>>> "Keith" == Keith Seitz writes: Keith> This patch causes expressions to use add_sal_to_sals, which will then Keith> set a canonical name for the linespec, thereby negating the need to Keith> double-check for missing linespecs later (in decode_line_full). Keith> @@ -842,6 +842,8 @@ add_sal_to_sals (struct linespec_state *self, Keith> else Keith> canonical_name = xstrprintf ("%s:%d", filename, sal->line); Keith> } Keith> + else if (symname != NULL) Keith> + canonical_name = xstrdup (symname); [...] Keith> + sal = find_pc_line (ls->expr_pc, 0); Keith> + sal.pc = ls->expr_pc; Keith> + sal.section = find_pc_overlay (ls->expr_pc); Keith> + sal.explicit_pc = 1; Keith> + add_sal_to_sals (state, &sals, &sal, ls->expression); It seems to me that find_pc_line can return a sal with symtab set; search for "val.symtab = " in find_pc_sect_line. In this case it seems that you'd wind up with the wrong canonical form. Tom