From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18047 invoked by alias); 4 Oct 2011 08:25:02 -0000 Received: (qmail 18009 invoked by uid 22791); 4 Oct 2011 08:24:59 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 08:24:44 +0000 Received: by vws16 with SMTP id 16so190021vws.0 for ; Tue, 04 Oct 2011 01:24:44 -0700 (PDT) Received: by 10.52.21.65 with SMTP id t1mr913192vde.183.1317716683161; Tue, 04 Oct 2011 01:24:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.178.4 with HTTP; Tue, 4 Oct 2011 01:24:23 -0700 (PDT) In-Reply-To: References: From: Kevin Pouget Date: Tue, 04 Oct 2011 08:25:00 -0000 Message-ID: Subject: Re: [RFC - Python] New ObjFile event To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-10/txt/msg00065.txt.bz2 (sorry for the resend) On Mon, Oct 3, 2011 at 6:31 PM, Tom Tromey wrote: >>>>>> "Kevin" =3D=3D Kevin Pouget writes: > > Kevin> =A0Allow Python notification of new object-file loadings. > [...] > > Kevin> +During the callback, ``current objfile'' will be set to the new o= bject file > Kevin> +(@pxref{Objfiles In Python}). > > Why not simply make the objfile object an attribute of the event? > That seems cleaner to me. We already discussed this point, but it was at the end of ... March :) > > Kevin> and, likewise, allows Python's "gdb.current_objfile ()" to return > > Kevin> the current object file. > > > > Tom: > > I'm ambivalent about this part. > > > > It seems to me that the objfile should be an attribute of the event. > > Also setting it globally is ok, if you really want that, but it isn't a > > necessity. > > Kevin: > I was ambivalent about this point too; I chose "gdb.current_objfile()" be= cause autoloading > (http://sourceware.org/gdb/current/onlinedocs/gdb/Auto_002dloading.html) > already does it this way, and the two features are pretty similar. I > felt that it would have been strange to access "gdb.current_objfile ()" > in one case, and sth like "event.new_objfile" in the other case > > let me know if you agree with this perspective; it wouldn't be a big > deal to flip to the other solution otherwise (the discussion didn't go any further, I was busy fighting with the copyright assignment!) Let me know what you prefer, I'll change the code accordingly > Kevin> + =A0if (objfile =3D=3D NULL) > Kevin> + =A0 =A0 =A0 return; > > Indentation looks off. will be fixed in the next submission Thanks for your reviews, Kevin