This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix query type decoding for info spu dma
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 13 Aug 2008 15:38:58 +0200 (CEST)
- Subject: [commit] Fix query type decoding for info spu dma
Hello,
another fix to the info spu dma command: when checking the query type,
we need to ignore bits outside the defined field (low two bits). For
info spu dma only (not info spu proxydma), we in addition have to
respect the TSQV (tag status query valid) bit -- if this is not set,
the remaining bits are undefined.
Fixed by the following patch. Tested on spu-elf, applied to mainline.
Bye,
Ulrich
ChangeLog:
* spu-tdep.c (info_spu_dma_command): Respect TSQV (tag status
query valid) bit. Ignore bits outside the condition field.
(info_spu_proxydma_command): Ignore bits outside the field.
Index: gdb/spu-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/spu-tdep.c,v
retrieving revision 1.33
diff -u -p -r1.33 spu-tdep.c
--- gdb/spu-tdep.c 7 Aug 2008 21:25:28 -0000 1.33
+++ gdb/spu-tdep.c 13 Aug 2008 13:09:56 -0000
@@ -1925,15 +1925,15 @@ info_spu_dma_command (char *args, int fr
}
else
{
- const char *query_msg;
+ const char *query_msg = _("no query pending");
- switch (dma_info_type)
- {
- case 0: query_msg = _("no query pending"); break;
- case 1: query_msg = _("'any' query pending"); break;
- case 2: query_msg = _("'all' query pending"); break;
- default: query_msg = _("undefined query type"); break;
- }
+ if (dma_info_type & 4)
+ switch (dma_info_type & 3)
+ {
+ case 1: query_msg = _("'any' query pending"); break;
+ case 2: query_msg = _("'all' query pending"); break;
+ default: query_msg = _("undefined query type"); break;
+ }
printf_filtered (_("Tag-Group Status 0x%s\n"),
phex (dma_info_status, 4));
@@ -1990,7 +1990,7 @@ info_spu_proxydma_command (char *args, i
{
const char *query_msg;
- switch (dma_info_type)
+ switch (dma_info_type & 3)
{
case 0: query_msg = _("no query pending"); break;
case 1: query_msg = _("'any' query pending"); break;
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com