From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31459 invoked by alias); 29 May 2013 09:48:32 -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 31449 invoked by uid 89); 29 May 2013 09:48:31 -0000 X-Spam-SWARE-Status: No, score=-4.0 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=no version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 29 May 2013 09:48:31 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Uhczd-0004qw-1U from Luis_Gustavo@mentor.com ; Wed, 29 May 2013 02:48:29 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 29 May 2013 02:48:29 -0700 Received: from [172.30.64.149] ([172.30.64.149]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 29 May 2013 02:48:28 -0700 Message-ID: <51A5CEE2.4070100@codesourcery.com> Date: Wed, 29 May 2013 09:48:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Nicolas Blanc CC: gdb-patches@sourceware.org, palves@redhat.com, tromey@redhat.com, eliz@gnu.org, yao@codesourcery.com Subject: Re: [patch v4 2/3] Test adding and removing a symbol file at runtime. References: <1369818805-14288-1-git-send-email-nicolas.blanc@intel.com> <1369818805-14288-3-git-send-email-nicolas.blanc@intel.com> In-Reply-To: <1369818805-14288-3-git-send-email-nicolas.blanc@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00987.txt.bz2 Hi, More nits On 05/29/2013 11:13 AM, Nicolas Blanc wrote: > +unsigned char inline elf_st_type (unsigned char st_info) > +{ > + return ELF32_ST_TYPE (st_info); > +} > +#endif > + > + Double empty line here. There are more occurrences of this throughout the testcase. > +void gdb_add_symbol_file (void* addr, const char* file) > +{ > + return; > +} > + > + Here. > +void gdb_remove_symbol_file (void* addr) > +{ > + return; > +} > + > + Here. > +struct segment > +{ > + char* mapped_addr; > + Elf_Phdr* phdr; > + struct segment* next; > +}; > + > + Here and so on. > +# Test adding and removing a symbol file dynamically: > +# 1) Load the main executable. > +# 2) Run to GDB_ADD_SYMBOl_FILE in $srcfile. > +# 3) Set a pending breakpoint at BAR in $libsrc. > +# 4) Load $shlib_name using 'add-symbol-file'. > +# 5) Continue to BAR in $libsrc. > +# 6) Set a breakpiont at FOO in $librc. > +# 7) Continue to FOO in $libsrc. > +# 8) Set a breakpoint at GDB_REMOVE_SYMBOL_FILE. > +# 9) Continue to GDB_REMOVE_SYMBOL_FILE in $srcfile. > +# 10) Remove $shlib_name using 'remove-symbol-file'. > +# 11) Check that the breakpoints at FOO and BAR are pending. > +# 12) Check that the execution can continue without error. > + > + Double empty line again. > +if [skip_shlib_tests] { > + return 0 > +} > + > + > +if [is_remote target] { > + return 0 > +} > + > +set target_size TARGET_UNKNOWN > +if [is_lp64_target] { > + set target_size TARGET_LP64 > +} elseif [is_ilp32_target] { > + set target_size TARGET_ILP32 > +} else { > + return 0 > +} > + > +set testfile sym-file-main > +set libfile sym-file-lib > +set srcfile ${testfile}.c > +set binfile ${objdir}/${subdir}/${testfile} > + > +set libsrc "${srcdir}/${subdir}/${libfile}.c" > +set libname "${libfile}.so" > +set shlib_name "${objdir}/${subdir}/${libname}" > +set libobj "${objdir}/${subdir}/${libname}" > +set execsrc "${srcdir}/${subdir}/${srcfile}" > +set exec_opts [list debug "additional_flags=-D$target_size -DSHLIB_NAME\\=\"$shlib_name\""] I'm wondering if the newer function "prepare_for_testing" can be used here to prevent having to deal with all these individual options.