From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13870 invoked by alias); 19 Sep 2009 14:34:43 -0000 Received: (qmail 13860 invoked by uid 22791); 19 Sep 2009 14:34:41 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-yw0-f184.google.com (HELO mail-yw0-f184.google.com) (209.85.211.184) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 19 Sep 2009 14:34:34 +0000 Received: by ywh14 with SMTP id 14so2403629ywh.26 for ; Sat, 19 Sep 2009 07:34:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.241.5 with SMTP id o5mr710107ybh.173.1253370873303; Sat, 19 Sep 2009 07:34:33 -0700 (PDT) In-Reply-To: <200909191552.02677.ghost@cs.msu.su> References: <200909191552.02677.ghost@cs.msu.su> Date: Sat, 19 Sep 2009 14:34:00 -0000 Message-ID: <8ba6bed40909190734l3b5701e1ub90941c385a590b6@mail.gmail.com> Subject: Re: Symbols/blocks questions From: Matt Rice To: Vladimir Prus Cc: gdb@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00232.txt.bz2 On Sat, Sep 19, 2009 at 4:52 AM, Vladimir Prus wrote: > > I am trying to port some MI improvement from the Apple GDB, > and got some questions about symbol/block handling. I'd > appreciate if somebody comment on it. > > 1. Given 'struct block *b', is it true that > > =A0 =A0block_for_pc (b.startaddr) =3D=3D b > > ? > > 2. Uness I am mistaken, in case of lines inside templates, > inline functions, and constructors, decode_line_1 returns > just one sal. (And breakpoint.c explicitly expands thsoe in > expand_line_sal). In what cases will decode_line_1 actually > return multiple sals? For overloaded functions? Anything else? > Would it be sensible, eventually, to make decode_line_1 > return all locations corresponding to file:line? decode_all_digits: single (break {,+,-}[0-9]+) decode_objc: multiple via decode_line_2 decode_indirect: single (break *functionptr) decode_dollar: single (the first break $convenience or break $function foun= d) decode_compound: multiple via decode_line_2 decode_variable: single, this one i'm less clear on if passed a symbol which is not a function, it throws an error 'whatever' not found. through symbols which are functions e.g. break main fall through, and those do not pass an error but return a single value. some of these could potentially return a single when ambiguity exist based on whatever they decide. e.g. a function void $foobar() { } void uhh() {} set $foobar =3D &uhh or something crazy like that that will never happen and could easily be avoided by the user. and decode_indirect i would assume uses whatever is in the scope objc categories are technically not overloaded functions but I think this is just semantics on the choice of the term overloaded function. I wouldn't take this as gospel or anything, i could have easily overlooked something, for instance i have no idea how Ada hooks into this.