From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7842 invoked by alias); 22 Sep 2013 06:25:20 -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 7825 invoked by uid 89); 22 Sep 2013 06:25:19 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Sep 2013 06:25:19 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.5 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VNd66-0004Wb-F3 from Yao_Qi@mentor.com ; Sat, 21 Sep 2013 23:24:46 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 21 Sep 2013 23:24:45 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Sat, 21 Sep 2013 23:24:45 -0700 Message-ID: <523E8D0A.2050205@codesourcery.com> Date: Sun, 22 Sep 2013 06:25:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Doug Evans CC: Subject: Re: [RFC 3/3] Test on solib load and unload References: <520B7F70.6070207@codesourcery.com> <1377663394-4975-1-git-send-email-yao@codesourcery.com> <1377663394-4975-4-git-send-email-yao@codesourcery.com> <521D7BCA.10806@codesourcery.com> <21051.32359.845429.92304@ruffy.mtv.corp.google.com> In-Reply-To: <21051.32359.845429.92304@ruffy.mtv.corp.google.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00794.txt.bz2 On 09/20/2013 06:44 AM, Doug Evans wrote: > > +standard_testfile .c > > +set executable $testfile > > +set expfile $testfile.exp > > + > > +# make check RUNTESTFLAGS='solib.exp SOLIB_NUMBER=1024' > > SOLIB_NUMBER doesn't read very well. > How about NUM_SOLIBS? > I should mention the naming convention I used here before. It is "TEST_PARAMETER". "SOLIB" is like a name space, and all variables used in this test should be prefixed by "SOLIB_". I tried "." to replace "_", but "." is not allowed to use. If we write a test case on backtrace, and we need variable to control the depth of bt, we can name it "BACKTRACE_DEPTH". > > +if ![info exists SOLIB_NUMBER] { > > + set SOLIB_NUMBER 128 > > +} > > + > > +for {set i 0} {$i < $SOLIB_NUMBER} {incr i} { > > + > > + # Produce source files. > > + set libname "solib-lib$i" > > + set src [standard_temp_file $libname.c] > > + set exe [standard_temp_file $libname] > > + > > + set code "int shr$i (void) {return $i;}" > > + set f [open $src "w"] > > + puts $f $code > > + close $f > > IWBN if the test harness provided utilities for generating source > files instead of hardcoding the generating of them in the test. > Parameters to such a set of functions would include things like the name > of a high level entry point (what one might pass to dlsym), the number > of functions in the file, the number of classes, etc. > IMO, it is not the perf test framework's responsibility to generate source files and I am not sure the utilities like these can be reused by other tests. We can add a new proc gdb_produce_source with two parameters, NAME and SOURCES. NAME is the file name and SOURCES is a list of lines of source code we want to write to file NAME. For instance, gdb_produce_source $src { "int shr$i (void) {return 0;}" } It can be used here and replace some code in gdb.exp. -- Yao (齐尧)