From: Phil Muldoon <pmuldoon@redhat.com>
To: Kevin Pouget <kevin.pouget@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC - Python] New ObjFile event
Date: Mon, 28 Mar 2011 08:54:00 -0000 [thread overview]
Message-ID: <m3ipv3pr3e.fsf@redhat.com> (raw)
In-Reply-To: <AANLkTin=YO__Mz88HPFoT7a6_it5BxthnUdODJMs52eG@mail.gmail.com> (Kevin Pouget's message of "Mon, 28 Mar 2011 04:06:29 -0400")
Kevin Pouget <kevin.pouget@gmail.com> writes:
> Hello,
>
> following this discussion at
> http://sourceware.org/ml/gdb/2011-03/msg00136.html, I would like to
> suggest a patch for the Python event system. Based on the ''exited",
> "cont", ... events, this patch allows a python script to register an
> interest to the loading of new object files in the debuggee. GDB
> observer "observer_attach_new_objfile" is used to trigger the Python
> callback.
Just a few nits. I am not a maintainer, so please don't take this as any
form of blessing ;)
> + py-value.o \
> + py-newobjfileevent.o
>
> SUBDIR_PYTHON_SRCS = \
> python/python.c \
> @@ -326,7 +327,8 @@
> python/py-threadevent.c \
> python/py-type.c \
> python/py-utils.c \
> - python/py-value.c
> + python/py-value.c \
> + python/py-newobjfileevent.c
I'm not sure on the status of 8.3 file naming conventions, whether they
matter anymore.
> +extern struct objfile *gdbpy_current_objfile;
> +static void
> +python_new_objfile (struct objfile *objfile)
> +{
> + struct cleanup *cleanup;
> +
> + /* Will be NULL when clearing the symtab. */
> + if (objfile)
> + cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);
> + else
> + cleanup = ensure_python_env (get_current_arch (), current_language);
> +
> + gdbpy_current_objfile = objfile;
> +
> + if (emit_new_objfile_event (objfile) < 0)
> + gdbpy_print_stack ();
The emit_new_objfile_event function seems to be missing?
> -static struct objfile *gdbpy_current_objfile;
> + source_python_script_for_objfile and new_objfile callbacks; it is NULL at
> + other times. */
> +/*static*/ struct objfile *gdbpy_current_objfile;
I realize this is something you are unsure of, but if you decide to emit
'static' can you remove the comment too.
> /* Set the current objfile to OBJFILE and then read STREAM,FILE as
> Python code. */
> @@ -1074,6 +1075,7 @@
> gdbpy_initialize_continue_event ();
> gdbpy_initialize_exited_event ();
> gdbpy_initialize_thread_event ();
> + gdbpy_initialize_new_objfile_event() ;
Needs a space after event and before the bracket.
Cheers
Phil
next prev parent reply other threads:[~2011-03-28 8:49 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTimybJtpUzy13FuLxQQMJfeWQuf3-cgqGmu23Bq5@mail.gmail.com>
2011-03-28 8:49 ` Kevin Pouget
2011-03-28 8:51 ` Kevin Pouget
2011-03-28 9:00 ` Phil Muldoon
2011-03-28 8:54 ` Phil Muldoon [this message]
2011-03-28 9:03 ` Phil Muldoon
2011-03-28 10:02 ` Kevin Pouget
2011-03-28 20:28 ` Tom Tromey
2011-03-29 11:11 ` Kevin Pouget
2011-03-30 11:32 ` Kevin Pouget
2011-03-30 12:14 ` Phil Muldoon
2011-03-30 12:15 ` Kevin Pouget
2011-05-19 20:21 ` Tom Tromey
2011-05-23 8:44 ` Kevin Pouget
2011-09-01 9:56 ` Kevin Pouget
2011-09-01 11:01 ` Eli Zaretskii
2011-09-01 11:09 ` Kevin Pouget
2011-10-03 16:32 ` Tom Tromey
[not found] ` <CAPftXULEe9R4m7tF=vtJe6NTXHSFAkXgsHCPb3r0mU4wKx0FFg@mail.gmail.com>
2011-10-04 8:25 ` Kevin Pouget
2011-10-04 17:02 ` Tom Tromey
2011-10-05 11:10 ` Kevin Pouget
2011-10-05 14:16 ` Tom Tromey
2011-10-05 17:40 ` Eli Zaretskii
2011-10-07 7:40 ` Kevin Pouget
2011-10-07 7:54 ` Kevin Pouget
2011-10-07 8:37 Andreas Tobler
2011-10-07 8:44 ` Kevin Pouget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3ipv3pr3e.fsf@redhat.com \
--to=pmuldoon@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=kevin.pouget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox