This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC - Python] New ObjFile event
- From: Tom Tromey <tromey at redhat dot com>
- To: Kevin Pouget <kevin dot pouget at gmail dot com>
- Cc: pmuldoon at redhat dot com, gdb-patches at sourceware dot org
- Date: Thu, 19 May 2011 14:21:11 -0600
- 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>
>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:
Kevin> + py-value.o \
Kevin> + py-newobjfileevent.o
Alphabetical, please. Applies elsewhere in the Makefile patch too.
Kevin> # found by configure; if GNU Make is not found, we fall back to a
Kevin> diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
Kevin> index 08d6c8c..3ea5068 100644
Kevin> --- a/gdb/doc/ChangeLog
Kevin> +++ b/gdb/doc/ChangeLog
Kevin> @@ -1,3 +1,9 @@
Kevin> +2011-03-29 Kevin Pouget <kevin.pouget@st.com>
Kevin> + * gdb.textinfo (Events In Python): Document `gdb.NewObjFileEvent'
Missing blank line after the date line, and typo: "texinfo", not
"textinfo".
Kevin> +@item events.newobjfile
Kevin> +Emits @code{gdb.NewObjFileEvent} which indicates that a new object-file has
Kevin> +been loaded in the inferior.
This is not an accurate description -- it may or may not be related to a
change in the inferior.
E.g., if the user did "set auto-solib-add off", then no objfile will be
made when a shared library is loaded.
Or, if the user does "add-symbol-file", then a new objfile will be made
even though nothing has changed in the inferior.
Maybe this isn't the event you actually wanted? I mean -- it is fine to
have this, and I'd like it if you followed through :-), but it may not
do what you are expecting.
Kevin> + /* Will be NULL when clearing the symtab. */
Kevin> + if (objfile)
Kevin> + cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);
Kevin> + else
Kevin> + cleanup = ensure_python_env (get_current_arch (), current_language);
I think it is better to just return early if objfile==NULL.
Or, emit a different event in this case.
Kevin> +2011-03-29 Kevin Pouget <kevin.pouget@st.com>
Kevin> + * testsuite/gdb.python/py-events-shlib.c: New file.
Missing newline.
Kevin> +# Start with a fresh gdb.
Kevin> +
Kevin> +gdb_exit
Kevin> +gdb_start
I think clean_restart is preferred here.
But maybe skip_python_tests has to be inserted in the middle of the
sequence?
Kevin> +gdb_test "run" ".*event type: new_objfile.*
Kevin> +.*new objfile name.*"
This style of test is hard to read. I'd prefer a \n in there.
Tom