From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4591 invoked by alias); 1 Nov 2013 20:35:06 -0000 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 Received: (qmail 4578 invoked by uid 89); 1 Nov 2013 20:35:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Nov 2013 20:35:05 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA1KZ1Wb012530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Nov 2013 16:35:02 -0400 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA1KZ0QQ012470 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 1 Nov 2013 16:35:01 -0400 From: Tom Tromey To: Yao Qi Cc: Subject: Re: [PATCH 4/4] Test on solib load and unload References: <1383291300-13917-1-git-send-email-yao@codesourcery.com> <1383291300-13917-5-git-send-email-yao@codesourcery.com> Date: Fri, 01 Nov 2013 20:35:00 -0000 In-Reply-To: <1383291300-13917-5-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Fri, 1 Nov 2013 15:35:00 +0800") Message-ID: <87eh6zyi6j.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg00020.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> This patch is to add a test case to on the performance of GDB handling Yao> load and unload of shared library. A few Tcl nits on this patch... Yao> + gdb_produce_source $src { "int shr$i (void) {return 0;}" } This bit is weird. Combined with the definition of gdb_produce_source: Yao> +proc gdb_produce_source { name sources } { Yao> + set index 0 Yao> + set f [open $name "w"] Yao> + Yao> + while { ${index} < [llength ${sources}] } { Yao> + set line [lindex ${sources} ${index}] Yao> + set index [expr ${index} + 1] Yao> + Yao> + set line [uplevel list $line] Yao> + puts $f $line Yao> + } Yao> + close $f Yao> +} I don't see why this "uplevel list" stuff is needed. Just have the caller pass in the text to write to the file. The substitutions can be done there. There also doesn't seem to be a need for "sources" to be a list. Just make it one big string and let the caller work it out. Yao> + # Compile. Yao> + if { [gdb_compile_shlib $src $exe {debug}] != "" } { Yao> + untested "Couldn't compile $src." Yao> + return -1 This returns a value but I think the caller doesn't use it. This isn't a bug, but it does mean some head-scratching later on, and of course this will inevitably be copied into all the other perf tests... That said I think this probably *should* return a value and I'll comment on the other patch. Tom