This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC - Python] New ObjFile event
- From: Kevin Pouget <kevin dot pouget at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 4 Oct 2011 10:24:23 +0200
- Subject: Re: [RFC - Python] New ObjFile event
- References: <AANLkTimybJtpUzy13FuLxQQMJfeWQuf3-cgqGmu23Bq5@mail.gmail.com> <AANLkTin=YO__Mz88HPFoT7a6_it5BxthnUdODJMs52eG@mail.gmail.com> <m362r3q9ih.fsf@fleche.redhat.com> <AANLkTikmMVf7Lz=8ccdXeo1WG8k+ivHMCXkC7BkZkLNP@mail.gmail.com> <AANLkTi=ObZFW+uoecfzvHhXr55zYZzSgX2ocJJrvXDv0@mail.gmail.com> <m339m4dgzr.fsf@redhat.com> <AANLkTima2Kk8C16hjj0kTtvsH9W33CbiE2y6wrVQXns5@mail.gmail.com> <m3ipt68mrs.fsf@fleche.redhat.com> <BANLkTi=NqJK6c+Cbvhc1M2fE=cS=5khSJg@mail.gmail.com> <CAPftXUKyge-BpB05PTn=5C=1HG6hgv8eS9rDYiZhooVMrrgZuQ@mail.gmail.com> <E1Qz4Lp-0007E1-Kl@fencepost.gnu.org> <CAPftXULTp2Z9PsY_RM+MAwahcEjNk2s=kgqUhz1guCMYUXGN9g@mail.gmail.com> <m3botyujd4.fsf@fleche.redhat.com> <CAPftXULEe9R4m7tF=vtJe6NTXHSFAkXgsHCPb3r0mU4wKx0FFg@mail.gmail.com>
(sorry for the resend)
On Mon, Oct 3, 2011 at 6:31 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
>
> Kevin> ?Allow Python notification of new object-file loadings.
> [...]
>
> Kevin> +During the callback, ``current objfile'' will be set to the new object 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()" because 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> + ?if (objfile == NULL)
> Kevin> + ? ? ? return;
>
> Indentation looks off.
will be fixed in the next submission
Thanks for your reviews,
Kevin