From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2445 invoked by alias); 26 Aug 2011 10:42:55 -0000 Received: (qmail 2437 invoked by uid 22791); 26 Aug 2011 10:42:54 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_WEB,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout23.012.net.il (HELO mtaout23.012.net.il) (80.179.55.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Aug 2011 10:42:39 +0000 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LQJ0090070YGM00@a-mtaout23.012.net.il> for gdb-patches@sourceware.org; Fri, 26 Aug 2011 13:42:36 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.21.112]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LQJ0091872Y7180@a-mtaout23.012.net.il>; Fri, 26 Aug 2011 13:42:35 +0300 (IDT) Date: Fri, 26 Aug 2011 10:42:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 6/7] [python] API for macros: Add docs. In-reply-to: To: Matt Rice Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83sjoofo80.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <1314198654-9008-1-git-send-email-ratmice@gmail.com> <1314198654-9008-7-git-send-email-ratmice@gmail.com> <83k4a2h8qr.fsf@gnu.org> <831uw9gzro.fsf@gnu.org> X-IsSubscribed: yes 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: 2011-08/txt/msg00481.txt.bz2 > Date: Fri, 26 Aug 2011 01:04:21 -0700 > From: Matt Rice > Cc: gdb-patches@sourceware.org > > >> macro1.c:18 >> include_trail=[('/home/ratmice/tests/macro1.h', 1), > >> ('/home/ratmice/tests/macro1.c', 1)]> > >> macro1.c:18 > >> macro1.c:18 > > [...] > >> >  Returns all of the macros which are in effect for the source line > >> >  given by the @code{gdb.Symtab_and_line}'s @code{line} attribute. > >> > >> The problem I was trying to avoid (and which made my documentation for > >> this method admittedly crappy), is that your rephrased definition > >> seems to be plausible for the case when the user wants (C) in the > >> macro1.c:18 case, > >> e.g. the macros which are used ON the line.  When Symtab_and_line.macros() > >> outputs all of the macros which were defined before the line, which > >> are still in effect. > > > > Sorry, I don't follow.  Did you mean "B" instead of "C"?  What is the > > problem you see here with "C"?  It is defined only once, on line 16, > > and so is in effect on line 18.  I see no issues here.  What am I > > missing? > > No, I mean "C". > > >> macro1.c:18:  foo(); C; return 0; > > So say we are stopped on this line, and have Symtab_and_line for it. > the user wants to know `all the macros that are used at this source location' > In this case the answer would be 'C', and my concern is that 'which > are in effect' > can be misconstrued. e.g. with the above line in isolation, is 'C' in effect? Now I'm utterly confused. The output of `macros' shows not just C, but also AMACRO and B. All of them are "in effect" in line 18. So why are you talking only about C? The fact that it's actually mentioned in that line seems irrelevant, because you are documenting what the `macros' method returns. What am I missing here? > how about the following. > > Returns all of the macros defined before the source line given by the > @code{gdb.Symtab_and_line}'s @code{line} attribute which are in still > effect. How is this different from my suggestion above? > >> >> +@defmethod Symtab macros > >> >> +Return all of the macros contained in the symbol table. > >> >> +@end defmethod > >> > > >> > Return what, exactly? only their names? something else? > >> > >> i'll try 'Return a list of macro objects for all of the macros > >> contained in the symbol table.' > > > > Based on the example above (which I highly recommend to have in the > > manual), I'd say "a list of macro objects with their values and > > include trail". > > hrm, except what is above is the output of the string function, > if you actually print the return value without converting to a string > it prints something like (, ), What are the 0x.... numbers here?