* [RFC] Autoload-breakpoints new version [3/9] notification async
@ 2012-08-07 7:10 Hui Zhu
2012-08-08 13:26 ` Yao Qi
0 siblings, 1 reply; 10+ messages in thread
From: Hui Zhu @ 2012-08-07 7:10 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]
This patch is the extend for the notification function.
Current notification function cannot handle the packet when GDB doesn't want to send or receive packet from the remote target.
This patch do the extend make GDB can handle the notification even if it doesn't send or receive packet.
Thanks,
Hui
2012-08-07 Hui Zhu <hui_zhu@mentor.com>
* remote.c (async_client_callback): Move to the top.
(async_client_context): Ditto.
(remote_async_serial_handler): Ditto.
(PACKET_NotificationAsync): New enum.
(remote_pr): Add PACKET_NotificationAsync.
(remote_open_1): Call serial_async if need.
(readchar_buffer_ch): New variable.
(readchar): If need, return the value of readchar_buffer_ch.
(readchar_buffer_put): New function.
(remote_is_async_p): Add check for PACKET_ReportAsync.
(remote_notificationasync_check): New function.
(remote_async_serial_handler): Add code to handle notification.
(remote_async): Add check for PACKET_ReportAsync.
(_initialize_remote): Add PACKET_NotificationAsync.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: notification_async.txt --]
[-- Type: text/plain; charset="us-ascii"; name="notification_async.txt", Size: 5920 bytes --]
---
remote.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 98 insertions(+), 10 deletions(-)
--- a/remote.c
+++ b/remote.c
@@ -224,6 +224,11 @@ static void remote_query_supported (void
static void remote_check_symbols (struct objfile *objfile);
+static void (*async_client_callback) (enum inferior_event_type event_type,
+ void *context);
+static void *async_client_context;
+static serial_event_ftype remote_async_serial_handler;
+
void _initialize_remote (void);
struct stop_reply;
@@ -1297,6 +1302,7 @@ enum {
PACKET_QDisableRandomization,
PACKET_QAgent,
PACKET_AutoloadBreakpoints,
+ PACKET_NotificationAsync,
PACKET_MAX
};
@@ -3998,6 +4004,8 @@ static struct protocol_feature remote_pr
remote_string_tracing_feature, -1 },
{ "AutoloadBreakpoints", PACKET_DISABLE, remote_supported_packet,
PACKET_AutoloadBreakpoints },
+ { "NotificationAsync", PACKET_DISABLE, remote_supported_packet,
+ PACKET_NotificationAsync },
};
static char *remote_support_xml;
@@ -4355,6 +4363,10 @@ remote_open_1 (char *name, int from_tty,
if (target_async_permitted)
wait_forever_enabled_p = 1;
+
+ if (remote_protocol_packets[PACKET_NotificationAsync].support
+ != PACKET_DISABLE)
+ serial_async (remote_desc, remote_async_serial_handler, NULL);
}
/* This takes a program previously attached to and detaches it. After
@@ -6980,11 +6992,20 @@ remote_files_info (struct target_ops *ig
/* Read a single character from the remote end. */
+static int readchar_buffer_ch = -1;
+
static int
readchar (int timeout)
{
int ch;
+ if (readchar_buffer_ch != -1)
+ {
+ ch = readchar_buffer_ch;
+ readchar_buffer_ch = -1;
+ return ch;
+ }
+
ch = serial_readchar (remote_desc, timeout);
if (ch >= 0)
@@ -7007,6 +7028,17 @@ readchar (int timeout)
return ch;
}
+/* When the function that call the readchar got a char is not for it
+ and other function need this charï¼call this function to put
+ this char back. Then when other function call readchar, it will
+ got this char first. */
+
+static void
+readchar_buffer_put (int ch)
+{
+ readchar_buffer_ch = ch;
+}
+
/* Send the command in *BUF to the remote machine, and read the reply
into *BUF. Report an error if we get an error reply. Resize
*BUF using xrealloc if necessary to hold the result, and update
@@ -11207,25 +11239,71 @@ remote_is_async_p (void)
/* We only enable async when the user specifically asks for it. */
return 0;
+ if (remote_protocol_packets[PACKET_NotificationAsync].support
+ != PACKET_DISABLE)
+ return async_client_callback != NULL;
+
/* We're async whenever the serial device is. */
return serial_is_async_p (remote_desc);
}
+static int
+remote_notificationasync_check (void)
+{
+ int c = readchar (-1);
+
+ if (c == '%')
+ return 1;
+
+ readchar_buffer_put (c);
+ return 0;
+}
+
/* Pass the SERIAL event on and up to the client. One day this code
will be able to delay notifying the client of an event until the
point where an entire packet has been received. */
-static void (*async_client_callback) (enum inferior_event_type event_type,
- void *context);
-static void *async_client_context;
-static serial_event_ftype remote_async_serial_handler;
-
static void
remote_async_serial_handler (struct serial *scb, void *context)
{
- /* Don't propogate error information up to the client. Instead let
- the client find out about the error by querying the target. */
- async_client_callback (INF_REG_EVENT, async_client_context);
+ /* Check if this is ReportAsync. */
+ if (remote_notificationasync_check ())
+ {
+ int val;
+ struct remote_state *rs = get_remote_state ();
+
+ val = read_frame (&rs->buf, &rs->buf_size);
+ if (val >= 0)
+ {
+ if (remote_debug)
+ {
+ struct cleanup *old_chain;
+ char *str;
+
+ str = escape_buffer (rs->buf, val);
+ old_chain = make_cleanup (xfree, str);
+ fprintf_unfiltered (gdb_stdlog, " Notification received: %s\n",
+ str);
+ do_cleanups (old_chain);
+ }
+ handle_notification (rs->buf, val);
+ }
+ else
+ {
+ if (remote_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "putpkt: Junk: ");
+ fprintf_unfiltered (gdb_stdlog, "%%%s", rs->buf);
+ }
+ }
+ }
+ else
+ {
+ /* Don't propogate error information up to the client. Instead let
+ the client find out about the error by querying the target. */
+ if (async_client_callback)
+ async_client_callback (INF_REG_EVENT, async_client_context);
+ }
}
static void
@@ -11246,12 +11324,19 @@ remote_async (void (*callback) (enum inf
{
if (callback != NULL)
{
- serial_async (remote_desc, remote_async_serial_handler, NULL);
+ if (remote_protocol_packets[PACKET_NotificationAsync].support
+ == PACKET_DISABLE)
+ serial_async (remote_desc, remote_async_serial_handler, NULL);
async_client_callback = callback;
async_client_context = context;
}
else
- serial_async (remote_desc, NULL, NULL);
+ {
+ if (remote_protocol_packets[PACKET_NotificationAsync].support
+ == PACKET_DISABLE)
+ serial_async (remote_desc, NULL, NULL);
+ async_client_callback = NULL;
+ }
}
static void
@@ -11769,6 +11854,9 @@ Show the maximum size of the address (in
add_packet_config_cmd (&remote_protocol_packets[PACKET_AutoloadBreakpoints],
"AutoloadBreakpoints", "autoload-breakpoints", 0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_NotificationAsync],
+ "NotificationAsync", "notification-async", 0);
+
/* Keep the old ``set remote Z-packet ...'' working. Each individual
Z sub-packet has its own set and show commands, but users may
have sets to this variable in their .gdbinit files (or in their
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-07 7:10 [RFC] Autoload-breakpoints new version [3/9] notification async Hui Zhu @ 2012-08-08 13:26 ` Yao Qi 2012-08-11 15:20 ` Hui Zhu 0 siblings, 1 reply; 10+ messages in thread From: Yao Qi @ 2012-08-08 13:26 UTC (permalink / raw) To: gdb-patches; +Cc: Hui Zhu On Tuesday, August 07, 2012 03:09:46 PM Hui Zhu wrote: > This patch is the extend for the notification function. > Current notification function cannot handle the packet when GDB doesn't want > to send or receive packet from the remote target. This patch do the extend > make GDB can handle the notification even if it doesn't send or receive > packet. I am trying to understand what current GDB can do, and what patched GDB can do. If I understand it correctly, - current GDB only handle notification when it sends or receives packets - patched GDB can handle notification at any time when notification comes in. Looks this patch changes the way of GDB handling notifications (from "only-on- send-receive" handling to "anytime" handling), but has nothing to do with how notification is sent out from remote stub. If so, why do you add "NotificationAsync" in remote_supported_packet? Remote supported packets are used to tell GDB what feature remote stub has or doesn't have. In other words, "NotificationAsync" is a feature of GDB, instead of remote stub, so we don't need "NotificationAsync". I applied patch 1/9 and 3/9, and get following regressions in gdbserver with async mode on. FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown output after running) FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown output after running) FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit (timeout) -- Yao (齐尧) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-08 13:26 ` Yao Qi @ 2012-08-11 15:20 ` Hui Zhu 2012-08-13 2:25 ` Yao Qi 0 siblings, 1 reply; 10+ messages in thread From: Hui Zhu @ 2012-08-11 15:20 UTC (permalink / raw) To: Yao Qi; +Cc: gdb-patches, Hui Zhu On Wed, Aug 8, 2012 at 9:24 PM, Yao Qi <yao@codesourcery.com> wrote: > On Tuesday, August 07, 2012 03:09:46 PM Hui Zhu wrote: >> This patch is the extend for the notification function. >> Current notification function cannot handle the packet when GDB doesn't want >> to send or receive packet from the remote target. This patch do the extend >> make GDB can handle the notification even if it doesn't send or receive >> packet. > > I am trying to understand what current GDB can do, and what patched GDB can > do. If I understand it correctly, > > - current GDB only handle notification when it sends or receives packets > - patched GDB can handle notification at any time when notification comes > in. > > Looks this patch changes the way of GDB handling notifications (from "only-on- > send-receive" handling to "anytime" handling), but has nothing to do with how > notification is sent out from remote stub. If so, why do you add > "NotificationAsync" in remote_supported_packet? Remote supported packets are > used to tell GDB what feature remote stub has or doesn't have. In other > words, "NotificationAsync" is a feature of GDB, instead of remote stub, so we > don't need "NotificationAsync". I agree with you. > > I applied patch 1/9 and 3/9, and get following regressions in gdbserver with > async mode on. > > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown output > after running) > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown output > after running) > FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit > (timeout) My part is OK, Could you tell me how do you do the test? > > -- > Yao (齐尧) Thanks, Hui ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-11 15:20 ` Hui Zhu @ 2012-08-13 2:25 ` Yao Qi 2012-08-14 12:01 ` Hui Zhu 0 siblings, 1 reply; 10+ messages in thread From: Yao Qi @ 2012-08-13 2:25 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb-patches, Hui Zhu On 08/11/2012 11:19 PM, Hui Zhu wrote: >> > >> >I applied patch 1/9 and 3/9, and get following regressions in gdbserver with >> >async mode on. >> > >> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown output >> >after running) >> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown output >> >after running) >> > FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit >> >(timeout) > My part is OK, Could you tell me how do you do the test? > In gdb build dir, add the following line into testsuite/site.exp set GDBFLAGS "-ex \"set target-async on\"" make check RUNTESTFLAGS="--target_board=native-gdbserver" or you can set GDBFLAGS in your own board file other than testuite/site.exp. -- Yao ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-13 2:25 ` Yao Qi @ 2012-08-14 12:01 ` Hui Zhu 2012-08-15 14:23 ` Hui Zhu 0 siblings, 1 reply; 10+ messages in thread From: Hui Zhu @ 2012-08-14 12:01 UTC (permalink / raw) To: Yao Qi; +Cc: gdb-patches, Hui Zhu On Mon, Aug 13, 2012 at 10:24 AM, Yao Qi <yao@codesourcery.com> wrote: > On 08/11/2012 11:19 PM, Hui Zhu wrote: >>> >>> > >>> >I applied patch 1/9 and 3/9, and get following regressions in gdbserver >>> > with >>> >async mode on. >>> > >>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown >>> > output >>> >after running) >>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown >>> > output >>> >after running) >>> > FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit >>> >(timeout) >> >> My part is OK, Could you tell me how do you do the test? >> > > In gdb build dir, add the following line into testsuite/site.exp > > set GDBFLAGS "-ex \"set target-async on\"" > > make check RUNTESTFLAGS="--target_board=native-gdbserver" > > or you can set GDBFLAGS in your own board file other than testuite/site.exp. > > -- > Yao Hi guys, I found this issue is because notification "Stop:" cannot be handled in async handler. What I thought is push it back a buffer and let GDB handle it later that GDB in right status to handle it. I didn't have other good idea on this issue is because I cannot reproduce it in command line. Do you have some comments on this issue? Thanks, Hui ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-14 12:01 ` Hui Zhu @ 2012-08-15 14:23 ` Hui Zhu 2012-08-23 10:44 ` Hui Zhu 2012-08-23 12:46 ` Yao Qi 0 siblings, 2 replies; 10+ messages in thread From: Hui Zhu @ 2012-08-15 14:23 UTC (permalink / raw) To: Yao Qi; +Cc: gdb-patches, Hui Zhu [-- Attachment #1: Type: text/plain, Size: 1607 bytes --] On Tue, Aug 14, 2012 at 8:01 PM, Hui Zhu <teawater@gmail.com> wrote: > On Mon, Aug 13, 2012 at 10:24 AM, Yao Qi <yao@codesourcery.com> wrote: >> On 08/11/2012 11:19 PM, Hui Zhu wrote: >>>> >>>> > >>>> >I applied patch 1/9 and 3/9, and get following regressions in gdbserver >>>> > with >>>> >async mode on. >>>> > >>>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown >>>> > output >>>> >after running) >>>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown >>>> > output >>>> >after running) >>>> > FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit >>>> >(timeout) >>> >>> My part is OK, Could you tell me how do you do the test? >>> >> >> In gdb build dir, add the following line into testsuite/site.exp >> >> set GDBFLAGS "-ex \"set target-async on\"" >> >> make check RUNTESTFLAGS="--target_board=native-gdbserver" >> >> or you can set GDBFLAGS in your own board file other than testuite/site.exp. >> >> -- >> Yao > > Hi guys, > > I found this issue is because notification "Stop:" cannot be handled > in async handler. > What I thought is push it back a buffer and let GDB handle it later > that GDB in right status to handle it. > > I didn't have other good idea on this issue is because I cannot > reproduce it in command line. > > Do you have some comments on this issue? > > Thanks, > Hui Hi, I done a new version to handle this issue. Because readchar will throw error and pop_target directly in remote.c. So I change it use another way to handle it. Not sure it is good or not. But it make test can be passed. Thanks, Hui [-- Attachment #2: notification_async.txt --] [-- Type: text/plain, Size: 6680 bytes --] --- --- remote.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 98 insertions(+), 10 deletions(-) --- a/remote.c +++ b/remote.c @@ -224,6 +224,11 @@ static void remote_query_supported (void static void remote_check_symbols (struct objfile *objfile); +static void (*async_client_callback) (enum inferior_event_type event_type, + void *context); +static void *async_client_context; +static serial_event_ftype remote_async_serial_handler; + void _initialize_remote (void); struct stop_reply; @@ -1297,6 +1302,7 @@ enum { PACKET_QDisableRandomization, PACKET_QAgent, PACKET_AutoloadBreakpoints, + PACKET_NotificationAsync, PACKET_MAX }; @@ -3998,6 +4004,8 @@ static struct protocol_feature remote_pr remote_string_tracing_feature, -1 }, { "AutoloadBreakpoints", PACKET_DISABLE, remote_supported_packet, PACKET_AutoloadBreakpoints }, + { "NotificationAsync", PACKET_DISABLE, remote_supported_packet, + PACKET_NotificationAsync }, }; static char *remote_support_xml; @@ -4355,6 +4363,10 @@ remote_open_1 (char *name, int from_tty, if (target_async_permitted) wait_forever_enabled_p = 1; + + if (remote_protocol_packets[PACKET_NotificationAsync].support + != PACKET_DISABLE) + serial_async (remote_desc, remote_async_serial_handler, NULL); } /* This takes a program previously attached to and detaches it. After @@ -6980,11 +6992,20 @@ remote_files_info (struct target_ops *ig /* Read a single character from the remote end. */ +static int readchar_buffer_ch = -1; + static int readchar (int timeout) { int ch; + if (readchar_buffer_ch != -1) + { + ch = readchar_buffer_ch; + readchar_buffer_ch = -1; + return ch; + } + ch = serial_readchar (remote_desc, timeout); if (ch >= 0) @@ -6993,8 +7014,12 @@ readchar (int timeout) switch ((enum serial_rc) ch) { case SERIAL_EOF: - pop_target (); - error (_("Remote connection closed")); + if (timeout) + { + pop_target (); + error (_("Remote connection closed")); + } + break; /* no return */ case SERIAL_ERROR: pop_target (); @@ -7007,6 +7032,17 @@ readchar (int timeout) return ch; } +/* When the function that call the readchar got a char is not for it + and other function need this charï¼call this function to put + this char back. Then when other function call readchar, it will + got this char first. */ + +static void +readchar_buffer_put (int ch) +{ + readchar_buffer_ch = ch; +} + /* Send the command in *BUF to the remote machine, and read the reply into *BUF. Report an error if we get an error reply. Resize *BUF using xrealloc if necessary to hold the result, and update @@ -7507,7 +7543,11 @@ getpkt_or_notif_sane_1 (char **buf, long show up within remote_timeout intervals. */ do c = readchar (timeout); - while (c != SERIAL_TIMEOUT && c != '$' && c != '%'); + while (c != SERIAL_TIMEOUT && c != SERIAL_EOF && c != '$' + && c != '%'); + + if (c == SERIAL_EOF) + return -1; if (c == SERIAL_TIMEOUT) { @@ -11207,25 +11247,72 @@ remote_is_async_p (void) /* We only enable async when the user specifically asks for it. */ return 0; + if (remote_protocol_packets[PACKET_NotificationAsync].support + != PACKET_DISABLE) + return async_client_callback != NULL; + /* We're async whenever the serial device is. */ return serial_is_async_p (remote_desc); } +static int +remote_is_notificationasync (void) +{ + int c = serial_readchar (remote_desc, 0); + + if (c == '%') + return 1; + + if (c >= 0) + readchar_buffer_put (c); + return 0; +} + /* Pass the SERIAL event on and up to the client. One day this code will be able to delay notifying the client of an event until the point where an entire packet has been received. */ -static void (*async_client_callback) (enum inferior_event_type event_type, - void *context); -static void *async_client_context; -static serial_event_ftype remote_async_serial_handler; - static void remote_async_serial_handler (struct serial *scb, void *context) { - /* Don't propogate error information up to the client. Instead let - the client find out about the error by querying the target. */ - async_client_callback (INF_REG_EVENT, async_client_context); + /* Check if this is ReportAsync. */ + if (remote_is_notificationasync ()) + { + int val; + struct remote_state *rs = get_remote_state (); + + val = read_frame (&rs->buf, &rs->buf_size); + if (val >= 0) + { + if (remote_debug) + { + struct cleanup *old_chain; + char *str; + + str = escape_buffer (rs->buf, val); + old_chain = make_cleanup (xfree, str); + fprintf_unfiltered (gdb_stdlog, " Notification received: %s\n", + str); + do_cleanups (old_chain); + } + handle_notification (rs->buf, val); + } + else + { + if (remote_debug) + { + fprintf_unfiltered (gdb_stdlog, "putpkt: Junk: "); + fprintf_unfiltered (gdb_stdlog, "%%%s", rs->buf); + } + } + } + else + { + /* Don't propogate error information up to the client. Instead let + the client find out about the error by querying the target. */ + if (async_client_callback) + async_client_callback (INF_REG_EVENT, async_client_context); + } } static void @@ -11246,12 +11333,19 @@ remote_async (void (*callback) (enum inf { if (callback != NULL) { - serial_async (remote_desc, remote_async_serial_handler, NULL); + if (remote_protocol_packets[PACKET_NotificationAsync].support + == PACKET_DISABLE) + serial_async (remote_desc, remote_async_serial_handler, NULL); async_client_callback = callback; async_client_context = context; } else - serial_async (remote_desc, NULL, NULL); + { + if (remote_protocol_packets[PACKET_NotificationAsync].support + == PACKET_DISABLE) + serial_async (remote_desc, NULL, NULL); + async_client_callback = NULL; + } } static void @@ -11769,6 +11863,9 @@ Show the maximum size of the address (in add_packet_config_cmd (&remote_protocol_packets[PACKET_AutoloadBreakpoints], "AutoloadBreakpoints", "autoload-breakpoints", 0); + add_packet_config_cmd (&remote_protocol_packets[PACKET_NotificationAsync], + "NotificationAsync", "notification-async", 0); + /* Keep the old ``set remote Z-packet ...'' working. Each individual Z sub-packet has its own set and show commands, but users may have sets to this variable in their .gdbinit files (or in their ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-15 14:23 ` Hui Zhu @ 2012-08-23 10:44 ` Hui Zhu 2012-08-23 11:20 ` Pedro Alves 2012-08-23 12:46 ` Yao Qi 1 sibling, 1 reply; 10+ messages in thread From: Hui Zhu @ 2012-08-23 10:44 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches, Hui Zhu, Yao Qi On Wed, Aug 15, 2012 at 10:22 PM, Hui Zhu <teawater@gmail.com> wrote: > On Tue, Aug 14, 2012 at 8:01 PM, Hui Zhu <teawater@gmail.com> wrote: >> On Mon, Aug 13, 2012 at 10:24 AM, Yao Qi <yao@codesourcery.com> wrote: >>> On 08/11/2012 11:19 PM, Hui Zhu wrote: >>>>> >>>>> > >>>>> >I applied patch 1/9 and 3/9, and get following regressions in gdbserver >>>>> > with >>>>> >async mode on. >>>>> > >>>>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (unknown >>>>> > output >>>>> >after running) >>>>> > FAIL: gdb.mi/mi-nonstop-exit.exp: finished exec continue (2) (unknown >>>>> > output >>>>> >after running) >>>>> > FAIL: gdb.mi/mi-nsmoribund.exp: resume all, waiting for program exit >>>>> >(timeout) >>>> >>>> My part is OK, Could you tell me how do you do the test? >>>> >>> >>> In gdb build dir, add the following line into testsuite/site.exp >>> >>> set GDBFLAGS "-ex \"set target-async on\"" >>> >>> make check RUNTESTFLAGS="--target_board=native-gdbserver" >>> >>> or you can set GDBFLAGS in your own board file other than testuite/site.exp. >>> >>> -- >>> Yao >> >> Hi guys, >> >> I found this issue is because notification "Stop:" cannot be handled >> in async handler. >> What I thought is push it back a buffer and let GDB handle it later >> that GDB in right status to handle it. >> >> I didn't have other good idea on this issue is because I cannot >> reproduce it in command line. >> >> Do you have some comments on this issue? >> >> Thanks, >> Hui > > Hi, > > I done a new version to handle this issue. > Because readchar will throw error and pop_target directly in remote.c. > So I change it use another way to handle it. Not sure it is good or > not. But it make test can be passed. > > Thanks, > Hui Hi Pedro, You reviewed the prev version of this patch that named report-async. Now, I gived up the report-async and just extend the notification for the function. So could you help me with it? Thanks a lot. Best, Hui ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-23 10:44 ` Hui Zhu @ 2012-08-23 11:20 ` Pedro Alves 0 siblings, 0 replies; 10+ messages in thread From: Pedro Alves @ 2012-08-23 11:20 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb-patches, Hui Zhu, Yao Qi On 08/23/2012 11:43 AM, Hui Zhu wrote: > On Wed, Aug 15, 2012 at 10:22 PM, Hui Zhu <teawater@gmail.com> wrote: > Hi Pedro, > > You reviewed the prev version of this patch that named report-async. > Now, I gived up the report-async and just extend the notification for > the function. Great, looking forward to seeing that. > So could you help me with it? Thanks a lot. Yep. Give me a moment while I dig myself out of post-vacation email catching up. -- Pedro Alves ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-15 14:23 ` Hui Zhu 2012-08-23 10:44 ` Hui Zhu @ 2012-08-23 12:46 ` Yao Qi 2012-08-23 14:30 ` Hui Zhu 1 sibling, 1 reply; 10+ messages in thread From: Yao Qi @ 2012-08-23 12:46 UTC (permalink / raw) To: Hui Zhu; +Cc: gdb-patches, Hui Zhu On 08/15/2012 10:22 PM, Hui Zhu wrote: > struct stop_reply; > @@ -1297,6 +1302,7 @@ enum { > PACKET_QDisableRandomization, > PACKET_QAgent, > PACKET_AutoloadBreakpoints, > + PACKET_NotificationAsync, > PACKET_MAX > }; > > @@ -3998,6 +4004,8 @@ static struct protocol_feature remote_pr > remote_string_tracing_feature, -1 }, > { "AutoloadBreakpoints", PACKET_DISABLE, remote_supported_packet, > PACKET_AutoloadBreakpoints }, > + { "NotificationAsync", PACKET_DISABLE, remote_supported_packet, > + PACKET_NotificationAsync }, > }; Hui, As we discussed in this thread, Re: [RFC] Autoload-breakpoints new version [3/9] notification async http://sourceware.org/ml/gdb-patches/2012-08/msg00337.html "NotificationAsync" is not needed anymore, so your patch should be updated to reflect this. -- Yao ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [RFC] Autoload-breakpoints new version [3/9] notification async 2012-08-23 12:46 ` Yao Qi @ 2012-08-23 14:30 ` Hui Zhu 0 siblings, 0 replies; 10+ messages in thread From: Hui Zhu @ 2012-08-23 14:30 UTC (permalink / raw) To: Yao Qi; +Cc: gdb-patches, Hui Zhu On Thu, Aug 23, 2012 at 8:46 PM, Yao Qi <yao@codesourcery.com> wrote: > On 08/15/2012 10:22 PM, Hui Zhu wrote: >> >> struct stop_reply; >> @@ -1297,6 +1302,7 @@ enum { >> PACKET_QDisableRandomization, >> PACKET_QAgent, >> PACKET_AutoloadBreakpoints, >> + PACKET_NotificationAsync, >> PACKET_MAX >> }; >> >> @@ -3998,6 +4004,8 @@ static struct protocol_feature remote_pr >> remote_string_tracing_feature, -1 }, >> { "AutoloadBreakpoints", PACKET_DISABLE, remote_supported_packet, >> PACKET_AutoloadBreakpoints }, >> + { "NotificationAsync", PACKET_DISABLE, remote_supported_packet, >> + PACKET_NotificationAsync }, >> }; > > > Hui, > As we discussed in this thread, > > Re: [RFC] Autoload-breakpoints new version [3/9] notification async > http://sourceware.org/ml/gdb-patches/2012-08/msg00337.html > > "NotificationAsync" is not needed anymore, so your patch should be updated > to reflect this. > > -- > Yao Hi Yao, 1. We still not sure keep the support packet "NotificationAsync" is good or not. 2. Even if we don't need support packet "NotificationAsync". The notification still need the extend for async. So if you don't mind, I suggest you keep review this patch. And after I got your comments, I update a new one. Thanks, Hui ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-08-23 14:30 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2012-08-07 7:10 [RFC] Autoload-breakpoints new version [3/9] notification async Hui Zhu 2012-08-08 13:26 ` Yao Qi 2012-08-11 15:20 ` Hui Zhu 2012-08-13 2:25 ` Yao Qi 2012-08-14 12:01 ` Hui Zhu 2012-08-15 14:23 ` Hui Zhu 2012-08-23 10:44 ` Hui Zhu 2012-08-23 11:20 ` Pedro Alves 2012-08-23 12:46 ` Yao Qi 2012-08-23 14:30 ` Hui Zhu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox