From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32251 invoked by alias); 24 Sep 2009 17:31:02 -0000 Received: (qmail 32231 invoked by uid 22791); 24 Sep 2009 17:31:00 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_34,J_CHICKENPOX_63 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Sep 2009 17:30:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6B5812BAACA for ; Thu, 24 Sep 2009 13:30:55 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2SetJf9koYjL for ; Thu, 24 Sep 2009 13:30:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 3147C2BAAB2 for ; Thu, 24 Sep 2009 13:30:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id C46D9F593C; Thu, 24 Sep 2009 10:30:52 -0700 (PDT) Date: Thu, 24 Sep 2009 17:31:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: gdb.objc/objcdecode.exp test error.. Message-ID: <20090924173052.GC2112@adacore.com> References: <8ba6bed40903051731s41c9183aha18af51113f3c0ea@mail.gmail.com> <20090306173345.GI3744@adacore.com> <200903061913.43419.pedro@codesourcery.com> <8ba6bed40903070407q3e91f0ffs6fc67b2b9c329081@mail.gmail.com> <8ba6bed40903080716k3fbeb56t5605aef1864b26a3@mail.gmail.com> <20090923231317.GA18470@adacore.com> <8ba6bed40909232348j47027093of7a2bafb8120e5ce@mail.gmail.com> <20090924164115.GA2112@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090924164115.GA2112@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-09/txt/msg00748.txt.bz2 > 2009-09-23 Matt Rice > > * gdb.objc/ambiguous.exp: New objc tests for 8343 with shared libs. > * gdb.objc/ambiguous.m: New objc file. > * gdb.objc/objcdecode2.m: New objc file. > * gdb.objc/objcdecode3.m: New objc file. I'm going to treat this testcase independently from the rest as well... The objc files are missing a copyright header. Can you add one, please? > set lib_flags [list debug additional_flags=[list -g -fPIC -I${srcdir}/${subdir}] ] The additional flags that you are adding are a little suspicious. gdb_compile_shlib is already supposed to handle that, I think. For use the -g is covered by the "debug" flag. -fPIC seems to be already taken care of through the addition of the -fpic flag, which is very similar (apparently, if I understand the GCC doc correctly, -fPIC just tries to avoid system limitations and -fpic doesn't). I'm also surprised that the -I[...] option is needed at all. We have C files in gdb.base that #include .h files, and yet we don't seem to need to explicitly provide a -I flag. See macscp.exp for one example of that, where macscp1.c includes macscp3.h. The problem with providing the -I switch is that it's specific to GCC and may not work with other compilers. > set binfile ${objdir}/${subdir}/${testfile} > set ambig_opts [list debug additional_flags=[list -g \ > -DSHLIB_NAME=\"$decode3_binfile\" \ > -L${objdir}/${subdir} \ > -Wl,-rpath,${objdir}/${subdir} \ > -ldl -lobjcdecode2 \ > -I${srcdir}/${subdir}] ] Same here. -g should not be necessary. Neither should be the -I. Neither should be the various -L/-Wl options... Or is there something special for SOs with ObjC code? > set name "setup ambiguous expression" > gdb_test "break foo" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file .*" $name When using gdb_test, it's fine to use a variable, but it is not necessary. The use of a variable with gdb_test_multiple is just because it avoids duplicating the test name. > gdb_test "run" \ > "Breakpoint \[0-9\]+, -\\\[DecodeShlib bar\\\] \\\(.*\\\) at .*" \ > "break on bar class implementation" You should use "gdb_run_cmd" in this case. Otherwise, it would not work in a cross environement for instance. > # i'm not sure why this reacts differently than the above tests Just a nit: I should be capitalized. But thank you very much for adding a comment explaining why you've added the test. These are really helpful. > return 0 This is unnecessary. -- Joel