This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ping]: [PATCH] Attach discard_pending_stop_replies to observer inferior_exit


On 12/07/2012 10:50 AM, Yao Qi wrote:
Hi,
discard_pending_stop_replies is called in three places, remote_detach_1,
extended_remote_mourn_1 (/w param pid) and remote_close (/w param -1).
They will finally call observer_notify_inferior_exit in some way,

remote_detach_1 >remote_mourn_1 >generic_mourn_inferior >exit_inferior >observer_notify_inferior_exit
         extended_remote_mourn_1 >generic_mourn_inferior >exit_inferior >observer_notify_inferior_exit
remote_close >discard_all_inferiors >exit_inferior_silent >observer_notify_inferior_exit

so this inspires me that we can attach discard_pending_stop_replies
to inferior_exit observer, and don't have to worry about the case that
PID is -1.  This is what this patch does.  Regression tested on
x86_64-linux with native and gdbserver.  Is it OK?

gdb:

2012-12-07 Yao Qi <yao@codesourcery.com>

	* remote.c (discard_pending_stop_replies): Remove declaration.
	(remote_close): Remove call discard_pending_stop_replies.
	(remote_detach_1, extended_remote_mourn_1): Likewise.
	(discard_pending_stop_replies): Change parameter from PID to
	INF.
	(_initialize_remote): Attach discard_pending_stop_replies to
	inferior_exit observer.

Ping. http://sourceware.org/ml/gdb-patches/2012-12/msg00126.html


This patch is kind of a cleanup/preparatory patch for 'async remote notification' patch series. This patch uses 'inferior_exit' observer to discard pending stop replies, which is better than the current approach (call discard_pending_stop_replies in different places).

--
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]