This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC - Python] New ObjFile event


(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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]