Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Don't try to report  resumed thread it the thread list is empty.
@ 2008-07-05 17:58 Vladimir Prus
  2008-07-09 10:31 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Vladimir Prus @ 2008-07-05 17:58 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]


I've checked in the below to make GDB not assert in MI mode on
targets where single-threaded programs have zero threads in the
GDB thread table.

- Volodya


[-- Attachment #2: on_resume.diff --]
[-- Type: text/x-diff, Size: 1332 bytes --]

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.9517
diff -u -p -r1.9517 ChangeLog
--- gdb/ChangeLog	5 Jul 2008 13:48:20 -0000	1.9517
+++ gdb/ChangeLog	5 Jul 2008 17:56:47 -0000
@@ -1,3 +1,8 @@
+2008-07-05  Vladimir Prus  <vladimir@codesourcery.com>
+
+	* mi/mi-interp.c (mi_on_resume): Don't try to report
+	resumed thread it the thread list is empty.
+	
 2008-07-05  Pierre Muller  <muller@ics.u-strasbg.fr>
 
 	* cli/cli-decode.c (add_setshow_optional_filename_cmd): Set
Index: gdb/mi/mi-interp.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-interp.c,v
retrieving revision 1.34
diff -u -p -r1.34 mi-interp.c
--- gdb/mi/mi-interp.c	25 Jun 2008 15:15:42 -0000	1.34
+++ gdb/mi/mi-interp.c	5 Jul 2008 17:56:47 -0000
@@ -338,6 +338,12 @@ mi_on_resume (ptid_t ptid)
 
   if (PIDGET (ptid) == -1)
     fprintf_unfiltered (raw_stdout, "*running,thread-id=\"all\"\n");
+  else if (thread_count () == 0)
+    {
+      /* This is a target where for single-threaded programs the thread
+	 table has zero threads.  Don't print any thread-id field.  */
+      fprintf_unfiltered (raw_stdout, "*running\n");
+    }
   else
     {
       struct thread_info *ti = find_thread_pid (ptid);

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-09 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-05 17:58 Don't try to report resumed thread it the thread list is empty Vladimir Prus
2008-07-09 10:31 ` Pedro Alves
2008-07-09 12:04   ` Vladimir Prus
2008-07-09 12:52     ` Pedro Alves
2008-07-09 13:04       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox