* [MI non-stop 02/11] Add 'stopped-threads' field to the *stopped output.
@ 2008-06-28 16:43 Vladimir Prus
2008-07-11 12:32 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Prus @ 2008-06-28 16:43 UTC (permalink / raw)
To: gdb-patches
By Pawel' suggestion, the MI non-stop spec say *stopped should explicitly say
which threads are stopped -- so that frontend need not check for 'non-stop'
flag to decide if all threads are stopped or not. It's actually simple to do,
so here's a patch. The infrun.c change affects MI only, so presumably I may
commit it without seeking approval?
- Volodya
[gdb]
* infrun.c (normal_stop): For MI, report which threads
were stopped.
[gdb/testsuite]
* lib/mi-support.exp (mi_expect_stop): Adjust for the new field.
---
gdb/infrun.c | 17 +++++++++++++++--
gdb/testsuite/lib/mi-support.exp | 6 +++---
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 9d03a7f..cf23c18 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4021,8 +4021,21 @@ Further execution is probably impossible.\n"));
}
if (ui_out_is_mi_like_p (uiout))
- ui_out_field_int (uiout, "thread-id",
- pid_to_thread_id (inferior_ptid));
+ {
+
+ ui_out_field_int (uiout, "thread-id",
+ pid_to_thread_id (inferior_ptid));
+ if (non_stop)
+ {
+ struct cleanup *back_to = make_cleanup_ui_out_list_begin_end
+ (uiout, "stopped-threads");
+ ui_out_field_int (uiout, NULL,
+ pid_to_thread_id (inferior_ptid));
+ do_cleanups (back_to);
+ }
+ else
+ ui_out_field_string (uiout, "stopped-threads", "all");
+ }
/* The behavior of this routine with respect to the source
flag is:
SRC_LINE: Print only source line
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index e4d9580..d32d373 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -1016,13 +1016,13 @@ proc mi_expect_stop { reason func args file line extra test } {
set a $after_reason
- verbose -log "mi_expect_stop: expecting: \\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$prompt_re$"
+ verbose -log "mi_expect_stop: expecting: \\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=.*,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"\}$after_stopped\r\n$prompt_re$"
gdb_expect {
- -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$prompt_re$" {
+ -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=.*,frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$after_stopped\r\n$prompt_re$" {
pass "$test"
return $expect_out(2,string)
}
- -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$prompt_re$" {
+ -re "\\*stopped,${r}${a}${bn}thread-id=\"$decimal\",stopped-threads=.*,frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}.*\r\n$prompt_re$" {
fail "$test (stopped at wrong place)"
return -1
}
--
1.5.3.5
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [MI non-stop 02/11] Add 'stopped-threads' field to the *stopped output.
2008-06-28 16:43 [MI non-stop 02/11] Add 'stopped-threads' field to the *stopped output Vladimir Prus
@ 2008-07-11 12:32 ` Daniel Jacobowitz
2008-07-13 5:40 ` Vladimir Prus
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2008-07-11 12:32 UTC (permalink / raw)
To: gdb-patches
On Sat, Jun 28, 2008 at 08:38:13PM +0400, Vladimir Prus wrote:
>
> By Pawel' suggestion, the MI non-stop spec say *stopped should explicitly say
> which threads are stopped -- so that frontend need not check for 'non-stop'
> flag to decide if all threads are stopped or not. It's actually simple to do,
> so here's a patch. The infrun.c change affects MI only, so presumably I may
> commit it without seeking approval?
Yes, that's right.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [MI non-stop 02/11] Add 'stopped-threads' field to the *stopped output.
2008-07-11 12:32 ` Daniel Jacobowitz
@ 2008-07-13 5:40 ` Vladimir Prus
0 siblings, 0 replies; 3+ messages in thread
From: Vladimir Prus @ 2008-07-13 5:40 UTC (permalink / raw)
To: gdb-patches
Daniel Jacobowitz wrote:
> On Sat, Jun 28, 2008 at 08:38:13PM +0400, Vladimir Prus wrote:
>>
>> By Pawel' suggestion, the MI non-stop spec say *stopped should explicitly say
>> which threads are stopped -- so that frontend need not check for 'non-stop'
>> flag to decide if all threads are stopped or not. It's actually simple to do,
>> so here's a patch. The infrun.c change affects MI only, so presumably I may
>> commit it without seeking approval?
>
> Yes, that's right.
I've checked the patch without any changes.
Thanks,
Volodya
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-13 5:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-28 16:43 [MI non-stop 02/11] Add 'stopped-threads' field to the *stopped output Vladimir Prus
2008-07-11 12:32 ` Daniel Jacobowitz
2008-07-13 5:40 ` Vladimir Prus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox