From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46676 invoked by alias); 30 May 2015 15:17:03 -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 46653 invoked by uid 89); 30 May 2015 15:17:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ig0-f174.google.com Received: from mail-ig0-f174.google.com (HELO mail-ig0-f174.google.com) (209.85.213.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sat, 30 May 2015 15:16:59 +0000 Received: by igbyr2 with SMTP id yr2so34220919igb.0 for ; Sat, 30 May 2015 08:16:57 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.42.81.201 with SMTP id a9mr21128525icl.9.1432999017586; Sat, 30 May 2015 08:16:57 -0700 (PDT) Received: by 10.36.111.206 with HTTP; Sat, 30 May 2015 08:16:57 -0700 (PDT) In-Reply-To: References: <20150507180523.19629.77846.stgit@valrhona.uglyboxes.com> <20150507180559.19629.88488.stgit@valrhona.uglyboxes.com> <555A480B.9050200@redhat.com> <555BB47E.9060500@redhat.com> <555BB53F.8040307@redhat.com> <555BB5DF.90906@redhat.com> <555BB741.4050608@redhat.com> Date: Sat, 30 May 2015 15:17:00 -0000 Message-ID: Subject: Re: [PATCH v4 6/9] Explicit locations: introduce explicit locations From: Matt Rice To: Doug Evans Cc: Keith Seitz , Pedro Alves , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00736.txt.bz2 On Wed, May 27, 2015 at 4:36 AM, Matt Rice wrote: > On Tue, May 26, 2015 at 9:42 PM, Doug Evans wrote: >> Keith Seitz writes: >>> On 05/19/2015 03:14 PM, Pedro Alves wrote: >>>> On 05/19/2015 11:12 PM, Keith Seitz wrote: >>>>> On 05/19/2015 03:09 PM, Pedro Alves wrote: >>>>> >>>> OK, as long as >>>> >>>> b -source 'file with spaces -line 10' -line 20 >>>> >>>> works as expected (might be worth it of a test), the point is >>>> moot then. >>> >>> I think it does what is expected: >>> >>> (gdb) b -source 'file with spaces -line 10' -line 20 >>> No source file named file with spaces -line 10. >> >> This error message needs to better delineate the file name. >> One could either put it in quotes (and escape internal quotes), >> or change it to something like: >> No such source file: file with spaces -line 10. >> >>> I'll add a test if one is missing. These "with spaces" tests appear in >>> ls-errs.exp and can be obscured by the fact that they test the parsing >>> by generating errors. >> >> I'm still really uneasy with supporting >> b -source file with spaces -line 20 >> >> This is intended to be the low-level access to specifying locations. >> Low level APIs shouldn't be too concerned with easing typing. > > hmm, I just thought of a 2nd pitfall: > in objective-c "b -method" I believe is a currently working linespec > to set breakpoints on all the instance methods name 'method' that > accept zero arguments. > > thus there is the potential for collisions, the following header[1] > file declares a method on line 47: - (id) source; which should > currently be accepted via the linespec: 'b -source' > > [1] https://github.com/gnustep/gui/blob/master/Headers/AppKit/NSNibConnector.h It appears that my memory may be failing me: with the file foo.m: @interface Foo - (void) source; + (void) foo; @end @implementation Foo - (void) source {}; + (void) foo {}; @end int main() { [Foo foo]; return 0; } $ gcc -g foo.m -lobjc Reading symbols from a.out...done. (gdb) b foo Breakpoint 1 at 0x40076a: file foo.m, line 10. (gdb) b source Breakpoint 2 at 0x40075c: file foo.m, line 9. (gdb) b -source Function "-source" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) b -[Foo source] Note: breakpoint 2 also set at pc 0x40075c. Breakpoint 3 at 0x40075c: file foo.m, line 9. (gdb) b +foo Function "+foo" not defined. Make breakpoint pending on future shared library load? (y or [n]) n (gdb) b +[Foo foo] Note: breakpoint 1 also set at pc 0x40076a. Breakpoint 4 at 0x40076a: file foo.m, line 10. (gdb) So, this doesn't seem to work currently, and if it did work in the past it was not reflected in the testsuite or the documentation afaict. so 'b foo' and 'b source', can specify breakpoints on class or instance methods, but to specify a breakpoint on an instance method you must specify the [] brackets, and the class as well, rather than being able to specify a breakpoint on all instance methods or all class methods. haven't tested older versions though to see if this is actually my memory failing me, or just some undocumented feature which has stopped working, sorry for the noise.