* remote.c (remote_get_threadlist): If the response
authorVladimir Prus <vladimir@codesourcery.com>
Mon, 25 Feb 2008 09:59:06 +0000 (09:59 +0000)
committerVladimir Prus <vladimir@codesourcery.com>
Mon, 25 Feb 2008 09:59:06 +0000 (09:59 +0000)
       is empty, don't try to parse it.

gdb/ChangeLog
gdb/remote.c

index 1af57618e4b94540cb4280508f10754bc76454a5..0cbb6c2d1dae3eb80384f6cb5e44b9a91b903976 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-25  Vladimir Prus  <vladimir@codesourcery.com>
+
+       * remote.c (remote_get_threadlist): If the response
+       is empty, don't try to parse it.
+
 2008-02-23  Vladimir Prus  <vladimir@codesourcery.com>
 
        Unbreak 'target async'.
index 8fdc0da71d76c847d0d01761404cc9db5c033452..3f50ff28df1f2e8302d88362d4558f61d8b55563 100644 (file)
@@ -1740,9 +1740,12 @@ remote_get_threadlist (int startflag, threadref *nextthread, int result_limit,
   putpkt (rs->buf);
   getpkt (&rs->buf, &rs->buf_size, 0);
 
-  *result_count =
-    parse_threadlist_response (rs->buf + 2, result_limit, &echo_nextthread,
-                              threadlist, done);
+  if (*rs->buf == '\0')
+    *result_count = 0;
+  else
+    *result_count =
+      parse_threadlist_response (rs->buf + 2, result_limit, &echo_nextthread,
+                                 threadlist, done);
 
   if (!threadmatch (&echo_nextthread, nextthread))
     {