From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: Don't try to report resumed thread it the thread list is empty.
Date: Sat, 05 Jul 2008 17:58:00 -0000 [thread overview]
Message-ID: <200807052158.30295.vladimir@codesourcery.com> (raw)
[-- 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);
next reply other threads:[~2008-07-05 17:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 17:58 Vladimir Prus [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200807052158.30295.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox