[PATCH v3 09/12] btrace, python: Enable ptwrite listener registration.
Willgerodt, Felix
felix.willgerodt@intel.com
Tue May 31 11:26:23 GMT 2022
> -----Original Message-----
> From: Metzger, Markus T <markus.t.metzger@intel.com>
> Sent: Montag, 30. Mai 2022 16:55
> To: Willgerodt, Felix <felix.willgerodt@intel.com>
> Cc: gdb-patches@sourceware.org
> Subject: RE: [PATCH v3 09/12] btrace, python: Enable ptwrite listener
> registration.
>
> Hello Felix,
>
> >> >+ apply_ext_lang_ptwrite_listener (inferior_ptid);
> >>
> >> Should this be called ptwrite_filter?
> >>
> >
> >No, that wasn't my intention. I can rename "listener" to "filter" if you
> >want, but that would affect the whole series and documentation.
> >Or are you just requesting the extension functions to be updated?
>
> This reminded me of frame filters or frame decorators. Maybe
> ptwrite_interpreter would be another term that is more specific than
> ptwrite_listener.
>
> Yes, we'd want to change this everywhere to make GDB's internals
> match the terminology we use in the documentation.
I personally don't have a strong preference and Eli didn't reject the listener
terminology. I was a bit against filter in the past, as we don't "hide" anything
for ptwrite (contrary to frame filters). But I think either of the three is fine.
Eli, are you fine with changing everything to the filter terminology, also in
the documentation? I just want agreement before making all the necessary
changes.
For convenience, the last patch with the documentation I posted:
https://sourceware.org/pipermail/gdb-patches/2022-May/188782.html
>
> >> >+ /* PyObject pointer to the ptwrite listener function. */
> >> >+ void *ptw_listener = nullptr;
> >> >+
> >>
> >> The comment says that this is a PyObject. Why is it declared void *?
> >>
> >
> >Because I didn't want to include a python header for PyObject here.
> >Afaik, btrace.h should be kept free of those.
>
> Including python headers is better than void * declarations IMHO.
>
> Maybe we can hide it all behind a callback function that is provided
> by the python layer?
Sorry, I just realized that actually the comment is wrong. Other extension
languages could also provide a different type to call. In the end it is a
function pointer. I will fix the comment.
Regards,
Felix
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
More information about the Gdb-patches
mailing list