From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/3] gdbserver: replace event_queue with QUEUE
Date: Thu, 24 Jan 2013 18:48:00 -0000 [thread overview]
Message-ID: <510181E0.4060808@redhat.com> (raw)
In-Reply-To: <1358990040-10962-1-git-send-email-yao@codesourcery.com>
On 01/24/2013 01:13 AM, Yao Qi wrote:
> -
> /* Process one event. If an event was processed, 1 is returned
> otherwise 0 is returned. Scan the queue from head to tail,
> processing therefore the high priority events first, by invoking
> @@ -199,46 +161,18 @@ async_queue_event (gdb_event *event_ptr)
> static int
> process_event (void)
> {
...
> - free (event_ptr);
> + gdb_event *event_ptr = QUEUE_deque (gdb_event_p, event_queue);
> + event_handler_func *proc = event_ptr->proc;
> + gdb_fildes_t fd = event_ptr->fd;
>
> + xfree (event_ptr);
I think here
gdb_event_xfree (event_ptr);
would be better.
> /* Start up the event loop. This is the entry point to the event
> loop. */
>
> void
> start_event_loop (void)
> {
> + event_queue = QUEUE_alloc (gdb_event_p, gdb_event_xfree);
This will go wrong if we ever nest event loops.
Can you put this in a initialize_event_loop function instead,
called from main, close to the initialize_low, etc. calls, please?
Okay with that change.
--
Pedro Alves
prev parent reply other threads:[~2013-01-24 18:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-24 1:15 Yao Qi
2013-01-24 1:15 ` [PATCH 3/3] gdb: " Yao Qi
2013-01-24 19:08 ` Pedro Alves
2013-01-25 7:02 ` Yao Qi
2013-01-25 9:58 ` Pedro Alves
2013-01-24 1:15 ` [PATCH 2/3] Remove queue_position Yao Qi
2013-01-24 18:35 ` Tom Tromey
2013-01-24 18:53 ` Pedro Alves
2013-01-24 18:48 ` Pedro Alves [this message]
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=510181E0.4060808@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.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