This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 0/2, gdbserver] Set linux target in async mode in default
On 09/26/2012 12:23 AM, Pedro Alves wrote:
Please explain better why this is necessary (probably with an example).
What exactly doesn't work if you don't do this change? It sounds as though
Hi, Pedro,
When we have a notification, we'll queue it and call 'async_file_mark'.
Then, notification can be sent in async handler 'handle_target_event'
later, which is done by my later patch posted here, mainly in
server.c:handle_target_event,
[PATCH 3/6] de-couple %Stop from notification: gdbserver
http://sourceware.org/ml/gdb-patches/2012-09/msg00480.html
The whole process is identical to all notifications, including %Stop.
Actually, this process is generalized from %Stop.
For example, we need a notification on 'trace status', and GDBserver
will send it once trace is stopped due to some reasons, such as
tracebuffer is full. We can add some code below to trigger event-loop,
so that such notification can be sent later (it doesn't compile, just to
show why do we need async for sending notification).
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 201a25b..1135f53 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -3472,6 +3472,10 @@ stop_tracing (void)
}
unpause_all (1);
+
+#ifndef IN_PROCESS_AGENT
+ QUEUE_enque (notif_p, notif_queue, ¬if_trace);
+ async_file_mark ();
+#endif
}
static int
Otherwise, when/how should we send notification in GDBserver?
this could make gdbserver push notifications down to GDB in all-stop
mode even when it isn't waiting for server replies?
I am assuming that 'it' means GDB', so answer is 'yes'.
If I understand 'non-stop for remote target' stuff correctly, %Stop
notification is sent to GDB in non-stop mode even when GDB isn't waiting
for server replies. Then, what I am trying to achieve is 'notifications
are sent to GDB in all-stop or non-stop mode even when GDB isn't waiting
for server replies'.
--
Yao