* Also allow -list-thread-groups (--available) without a live selected thread
@ 2009-01-14 14:29 Pedro Alves
2009-01-14 15:06 ` Marc Khouzam
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2009-01-14 14:29 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
Similarly to -thread-info, -thread-list-ids, -list-thread-groups (--available)
should always be issuable without a live selected thread.
I tested it in non-stop mode, and all-stop sync/async as well with
success, with an exited thread selected.
In the all-stop async case, '-list-thread-groups' always works,
even if the target is running, because it isn't (currently) asking
the remote side for anything. OTOH, '-list-thread-groups --available' will
error out with "Cannot execute this command while the target is running.",
which is expected due to limitations of the all-stop remote protocol
(same error as given by -thread-info). In non-stop mode, it always
works.
Checked in.
--
Pedro Alves
[-- Attachment #2: list_thread_groups_any_time.diff --]
[-- Type: text/x-diff, Size: 899 bytes --]
2009-01-14 Pedro Alves <pedro@codesourcery.com>
* mi/mi-main.c (mi_cmd_execute): Also allow -list-thread-groups
without a live selected thread.
---
gdb/mi/mi-main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: src/gdb/mi/mi-main.c
===================================================================
--- src.orig/gdb/mi/mi-main.c 2009-01-14 14:15:21.000000000 +0000
+++ src/gdb/mi/mi-main.c 2009-01-14 14:21:03.000000000 +0000
@@ -1355,7 +1355,8 @@ mi_cmd_execute (struct mi_parse *parse)
&& (is_exited (inferior_ptid))
&& (strcmp (parse->command, "thread-info") != 0
&& strcmp (parse->command, "thread-list-ids") != 0
- && strcmp (parse->command, "thread-select") != 0))
+ && strcmp (parse->command, "thread-select") != 0)
+ && strcmp (parse->command, "list-thread-groups") != 0)
{
struct ui_file *stb;
stb = mem_fileopen ();
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: Also allow -list-thread-groups (--available) without a live selected thread
2009-01-14 14:29 Also allow -list-thread-groups (--available) without a live selected thread Pedro Alves
@ 2009-01-14 15:06 ` Marc Khouzam
2009-01-14 15:22 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Marc Khouzam @ 2009-01-14 15:06 UTC (permalink / raw)
To: Pedro Alves, gdb-patches
Hi,
I had a quick look at the patch and I wanted to mention
that the parentheses are kind of weird. Don't get me wrong,
they do work, but there is some weird and unnecessary groupings
of conditions, if that matters.
Thanks for the patch though, I will use it.
Marc
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org
> [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Pedro Alves
> Sent: Wednesday, January 14, 2009 9:29 AM
> To: gdb-patches@sourceware.org
> Subject: Also allow -list-thread-groups (--available) without
> a live selected thread
>
> Similarly to -thread-info, -thread-list-ids,
> -list-thread-groups (--available)
> should always be issuable without a live selected thread.
>
> I tested it in non-stop mode, and all-stop sync/async as well with
> success, with an exited thread selected.
>
> In the all-stop async case, '-list-thread-groups' always works,
> even if the target is running, because it isn't (currently) asking
> the remote side for anything. OTOH, '-list-thread-groups
> --available' will
> error out with "Cannot execute this command while the target
> is running.",
> which is expected due to limitations of the all-stop remote protocol
> (same error as given by -thread-info). In non-stop mode, it always
> works.
>
> Checked in.
>
> --
> Pedro Alves
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Also allow -list-thread-groups (--available) without a live selected thread
2009-01-14 15:06 ` Marc Khouzam
@ 2009-01-14 15:22 ` Pedro Alves
0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2009-01-14 15:22 UTC (permalink / raw)
To: Marc Khouzam; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
On Wednesday 14 January 2009 15:05:34, Marc Khouzam wrote:
> I had a quick look at the patch and I wanted to mention
> that the parentheses are kind of weird. Don't get me wrong,
> they do work, but there is some weird and unnecessary groupings
> of conditions, if that matters.
Eh, it took me a moment to spot it. Oh man, the simplest things...
I've fixed it now. Thanks!
--
Pedro Alves
[-- Attachment #2: fix_parens.diff --]
[-- Type: text/x-diff, Size: 1053 bytes --]
2009-01-14 Pedro Alves <pedro@codesourcery.com>
* mi/mi-main.c (mi_cmd_execute): Clean up parenthesis mess from
previous change.
---
gdb/mi/mi-main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: src/gdb/mi/mi-main.c
===================================================================
--- src.orig/gdb/mi/mi-main.c 2009-01-14 15:16:04.000000000 +0000
+++ src/gdb/mi/mi-main.c 2009-01-14 15:16:53.000000000 +0000
@@ -1352,11 +1352,11 @@ mi_cmd_execute (struct mi_parse *parse)
{
if (target_can_async_p ()
&& target_has_execution
- && (is_exited (inferior_ptid))
+ && is_exited (inferior_ptid)
&& (strcmp (parse->command, "thread-info") != 0
&& strcmp (parse->command, "thread-list-ids") != 0
- && strcmp (parse->command, "thread-select") != 0)
- && strcmp (parse->command, "list-thread-groups") != 0)
+ && strcmp (parse->command, "thread-select") != 0
+ && strcmp (parse->command, "list-thread-groups") != 0))
{
struct ui_file *stb;
stb = mem_fileopen ();
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-14 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14 14:29 Also allow -list-thread-groups (--available) without a live selected thread Pedro Alves
2009-01-14 15:06 ` Marc Khouzam
2009-01-14 15:22 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox