On Thu, Sep 1, 2011 at 12:18 PM, Eli Zaretskii wrote: >> From: Kevin Pouget >> Date: Thu, 1 Sep 2011 11:17:51 +0200 >> Cc: pmuldoon@redhat.com, gdb-patches@sourceware.org >> >>  This event indicates that the inferior or one of its threads has received as >>  signal.  @code{gdb.SignalEvent} has the following attributes: >> >> +@item events.newobjfile >> +Emits @code{gdb.NewObjFileEvent} which indicates that a new object-file has >> +been loaded by @value{GDBN}. >> + >> +During the callback, ``current objfile'' will be set to the new object file. >> + >>  @table @code >>  @defivar SignalEvent stop_signal >>  A string representing the signal received by the inferior.  A list of possible >> @@ -22949,10 +22955,10 @@ The following objfile-related functions are available in the > > The addition doesn't look right: shouldn't it be _after_ the following > @table line?  events.newobjfile is an attribute of the same object as > stop_signal, right? sorry; I moved the paragraph to the right place. >> +When auto-loading a Python script (@pxref{Auto-loading}) and during new >> +object-file callbacks, @value{GDBN} sets the ``current objfile'' to the > > Why did you use "new" here?  New in relation to what? "new" here refers to object-file, but I'm not sure I can write "during new-object-file callbacks", can I? I also added a label reference to make things clearer here: > During the callback, ``current objfile'' will be set to the new object file > (@pxref{Objfiles In Python}). (I'm not sure why there is no `_' between 'current' and 'objfile', I copied it from another place --- @value{GDBN} sets the ``current objfile'' to the corresponding objfile.) Many thanks, Kevin 2011-09-01 Kevin Pouget Allow Python notification of new object-file loadings. * Makefile.in (SUBDIR_PYTHON_SRCS): Add py-newobjfilevent.c. (SUBDIR_PYTHON_OBS): Add py-newobjfileevent.o. Add build rule for this file. * python/py-event.h (emit_new_objfile_event): New prototype. (newobjfile): New Python event emitter. * python/py-evts.c (gdbpy_initialize_py_events): Add newobjfile to Python event registry. * python/py-inferior.c: Include objfiles.h (python_new_objfile): New function. (gdbpy_initialize_inferior): Add python_new_objfile to the new objfile observers. * python/py-newobjfileevent.c: New file. * python-internal.h (gdbpy_initialize_new_objfile_event): New prototype. (gdbpy_current_objfile): New global variable. * python/python.c (gdbpy_current_objfile): Make global. (_initialize_python): Add gdbpy_initialize_new_objfile_event call. 2011-09-01 Kevin Pouget Allow Python notification of new object-file loadings. * gdb.texinfo (Events In Python): Document `gdb.NewObjFileEvent' events emitter. (Objfiles In Python): Indicate that `gdb.current_objfile' is also set during new object-file callbacks. 2011-09-01 Kevin Pouget Allow Python notification of new object-file loadings. * gdb.python/py-events.exp: Test newobjfile event. * gdb.python/py-events.py: Register newobjfile callback. * gdb.python/py-events.c: Add call to shared library * gdb.python/py-events-shlib.c: New file.