From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16499 invoked by alias); 5 Jul 2008 17:58:59 -0000 Received: (qmail 16489 invoked by uid 22791); 5 Jul 2008 17:58:58 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 05 Jul 2008 17:58:39 +0000 Received: (qmail 20796 invoked from network); 5 Jul 2008 17:58:37 -0000 Received: from unknown (HELO 172.16.unknown.plus.ru) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Jul 2008 17:58:37 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Don't try to report =?utf-8?q?=09resumed_thread_it_the_thread_list_is?= empty. Date: Sat, 05 Jul 2008 17:58:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_GZ7bIu+DLnvzwOp" Message-Id: <200807052158.30295.vladimir@codesourcery.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00071.txt.bz2 --Boundary-00=_GZ7bIu+DLnvzwOp Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 158 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 --Boundary-00=_GZ7bIu+DLnvzwOp Content-Type: text/x-diff; charset="utf-8"; name="on_resume.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="on_resume.diff" Content-length: 1332 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 + + * 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 * 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); --Boundary-00=_GZ7bIu+DLnvzwOp--