From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31624 invoked by alias); 9 Dec 2010 21:45:07 -0000 Received: (qmail 31587 invoked by uid 22791); 9 Dec 2010 21:45:06 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_CP,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; Thu, 09 Dec 2010 21:44:59 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9LivQt018376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Dec 2010 16:44:57 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oB9LivRF030173; Thu, 9 Dec 2010 16:44:57 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oB9LiuFb023019; Thu, 9 Dec 2010 16:44:56 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 510C33780EF; Thu, 9 Dec 2010 14:44:56 -0700 (MST) From: Tom Tromey To: Keith Seitz Cc: gdb-patches@sourceware.org Subject: Re: [RFA] c++/11734 revisited References: <4D002672.5090504@redhat.com> Date: Thu, 09 Dec 2010 21:45:00 -0000 In-Reply-To: <4D002672.5090504@redhat.com> (Keith Seitz's message of "Wed, 08 Dec 2010 16:44:34 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2010-12/txt/msg00121.txt.bz2 >>>>> "Keith" == Keith Seitz writes: Keith> I originally proposed fixing this by switching to pre-expansion. Tom Keith> reports that this really mucks up indexing. As a result, I have Keith> rewritten this patch. I think I must have been unclear. The problem with using pre-expansion in the index code was that the index didn't include all the same info as the psymtabs, so there was no good way to avoid expanding too many CUs when asked to look up a common type like "int". I don't think this problem would affect psymtab.c. So, you could probably still use pre-expansion if you think that is better. And, true to form, I misremembered the many different attempts at fixing this that I went through -- apparently in the tree we currently do use pre-expansion for the index. Sorry about all that. Keith> It's such a nightmare, it would actually a primary reason to Keith> rewrite linespec.c entirely. One of these days, I'll find the Keith> time to do it. That will be a happy day. For us anyway ;-) Keith> 2010-12-08 Keith Seitz Keith> * linespec.c (decode_compound): Rename SAVED_ARG to Keith> THE_REAL_SAVED_ARG. The ChangeLog entry should mention the PR, so the commit will end up in bugzilla. Keith> + if (*saved_arg == '\'') Keith> + { Keith> + char *end = skip_quoted (saved_arg); Keith> + memcpy (saved_arg, saved_arg + 1, end - saved_arg); Keith> + memcpy (end - 2, end, strlen (saved_arg) + 1); For overlapping copies you must use memmove. Keith> +static const char * Keith> +psymtab_search_name (const char *name) Keith> +{ Keith> + switch (current_language->la_language) I don't think psymtab.c should refer to current_language. I guess the search language could be a parameter. I realize that at some point we'll need to use current_language, and that symtab.c isn't exactly clean in this regard. It doesn't seem too hard to avoid letting the rot creep into this code, though. I suspect this same bug is going to bite the index code, too, and we'll have to export this function for use there too. I'll check that out after your patch goes in. Keith> + return xstrdup (name); The return type of this function should be just "char *". Otherwise you will need casts when freeing. Keith> + cleanup = make_cleanup (xfree, (void *) search_name); ... like this one. Keith> +if {[gdb_compile $srcfiles $binfile executable {debug c++}] != "" } { Keith> + untested pr11734.exp Keith> + return -1 Keith> +} Keith> +if {[get_compiler_info $binfile "c++"]} { Keith> + return -1 Keith> +} Keith> + Keith> +gdb_exit Keith> +gdb_start Keith> +gdb_reinitialize_dir $srcdir/$subdir Keith> +gdb_load $binfile I don't know if you can use prepare_for_testing here, but if not you can at least use clean_restart. Tom