* Make -list-thread-groups accept iN ids
@ 2010-06-05 5:57 Vladimir Prus
2010-06-07 18:29 ` Tom Tromey
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Prus @ 2010-06-05 5:57 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 232 bytes --]
This patch makes the -list-thread-groups accept group ids in the format iN,
since that's the format used for it in all output now. Checked in.
Thanks,
--
Vladimir Prus
CodeSourcery
vladimir@codesourcery.com
(650) 331-3385 x722
[-- Attachment #2: iN.diff --]
[-- Type: text/x-patch, Size: 1997 bytes --]
Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.11876
diff -u -p -r1.11876 ChangeLog
--- gdb/ChangeLog 4 Jun 2010 21:39:46 -0000 1.11876
+++ gdb/ChangeLog 5 Jun 2010 05:54:06 -0000
@@ -1,3 +1,8 @@
+2010-06-05 Vladimir Prus <vladimir@codesourcery.com>
+
+ * mi/mi-main.c (mi_cmd_list_thread_groups): Adjust
+ for current naming of thread groups (iN, not N).
+
2010-06-04 Sergio Durigan Junior <sergiodj@redhat.com>
* ada-lang.c (ada_operator_length): Constify `struct expression'.
Index: gdb/mi/mi-main.c
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-main.c,v
retrieving revision 1.176
diff -u -p -r1.176 mi-main.c
--- gdb/mi/mi-main.c 17 May 2010 20:49:39 -0000 1.176
+++ gdb/mi/mi-main.c 5 Jun 2010 05:54:06 -0000
@@ -817,10 +817,15 @@ mi_cmd_list_thread_groups (char *command
for (; optind < argc; ++optind)
{
char *end;
- int inf = strtoul (argv[optind], &end, 0);
+ int inf;
+
+ if (*(argv[optind]) != 'i')
+ error ("invalid syntax of group id '%s'", argv[optind]);
+
+ inf = strtoul (argv[optind] + 1, &end, 0);
if (*end != '\0')
- error ("invalid group id '%s'", argv[optind]);
+ error ("invalid syntax of group id '%s'", argv[optind]);
VEC_safe_push (int, ids, inf);
}
if (VEC_length (int, ids) > 1)
@@ -837,11 +842,13 @@ mi_cmd_list_thread_groups (char *command
else if (VEC_length (int, ids) == 1)
{
/* Local thread groups, single id. */
- int pid = *VEC_address (int, ids);
+ int id = *VEC_address (int, ids);
+ struct inferior *inf = find_inferior_id (id);
- if (!in_inferior_list (pid))
- error ("Invalid thread group id '%d'", pid);
- print_thread_info (uiout, -1, pid);
+ if (!inf)
+ error ("Non-existent thread group id '%d'", id);
+
+ print_thread_info (uiout, -1, inf->pid);
}
else
{
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Make -list-thread-groups accept iN ids
2010-06-05 5:57 Make -list-thread-groups accept iN ids Vladimir Prus
@ 2010-06-07 18:29 ` Tom Tromey
0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2010-06-07 18:29 UTC (permalink / raw)
To: Vladimir Prus; +Cc: gdb-patches
>>>>> "Volodya" == Vladimir Prus <vladimir@codesourcery.com> writes:
Volodya> This patch makes the -list-thread-groups accept group ids in
Volodya> the format iN, since that's the format used for it in all
Volodya> output now. Checked in.
It seems like it is possible for an existing front end to have worked
around this problem already. If so, I think supporting both iNNN and
plain NNN would be a good idea.
Tom
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-07 18:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-05 5:57 Make -list-thread-groups accept iN ids Vladimir Prus
2010-06-07 18:29 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).