From 12ab8a602f4ebb83654346ccbcf63df58a7497f8 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 7 Aug 2008 21:25:28 +0000 Subject: [PATCH] ChangeLog: * spu-tdep.c (info_spu_dma_cmdlist): Only show entries with the valid bit set. Ensure display order respects partial order defined by dependency bits. testsuite/ChangeLog: * gdb.arch/spu-info.exp: Updated for "info spu dma" changes. --- gdb/ChangeLog | 6 ++++ gdb/spu-tdep.c | 46 +++++++++++++++++++++++++---- gdb/testsuite/ChangeLog | 4 +++ gdb/testsuite/gdb.arch/spu-info.exp | 8 ++--- 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5e4b8cf047a..2be158e0204 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2008-08-07 Ulrich Weigand + + * spu-tdep.c (info_spu_dma_cmdlist): Only show entries with + the valid bit set. Ensure display order respects partial + order defined by dependency bits. + 2008-08-06 John David Anglin * solib-pa64.c (read_dld_descriptor): Return zero if load map is not diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 81988350fa5..64c7051c6ca 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1742,8 +1742,44 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr) NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; + int *seq = alloca (nr * sizeof (int)); + int done = 0; struct cleanup *chain; - int i; + int i, j; + + + /* Determine sequence in which to display (valid) entries. */ + for (i = 0; i < nr; i++) + { + /* Search for the first valid entry all of whose + dependencies are met. */ + for (j = 0; j < nr; j++) + { + ULONGEST mfc_cq_dw3; + ULONGEST dependencies; + + if (done & (1 << (nr - 1 - j))) + continue; + + mfc_cq_dw3 = extract_unsigned_integer (buf + 32*j + 24, 8); + if (!spu_mfc_get_bitfield (mfc_cq_dw3, 16, 16)) + continue; + + dependencies = spu_mfc_get_bitfield (mfc_cq_dw3, 0, nr - 1); + if ((dependencies & done) != dependencies) + continue; + + seq[i] = j; + done |= 1 << (nr - 1 - j); + break; + } + + if (j == nr) + break; + } + + nr = i; + chain = make_cleanup_ui_out_table_begin_end (uiout, 10, nr, "dma_cmd"); @@ -1766,7 +1802,6 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr) ULONGEST mfc_cq_dw0; ULONGEST mfc_cq_dw1; ULONGEST mfc_cq_dw2; - ULONGEST mfc_cq_dw3; int mfc_cmd_opcode, mfc_cmd_tag, rclass_id, tclass_id; int lsa, size, list_lsa, list_size, mfc_lsa, mfc_size; ULONGEST mfc_ea; @@ -1775,10 +1810,9 @@ info_spu_dma_cmdlist (gdb_byte *buf, int nr) /* Decode contents of MFC Command Queue Context Save/Restore Registers. See "Cell Broadband Engine Registers V1.3", section 3.3.2.1. */ - mfc_cq_dw0 = extract_unsigned_integer (buf + 32*i, 8); - mfc_cq_dw1 = extract_unsigned_integer (buf + 32*i + 8, 8); - mfc_cq_dw2 = extract_unsigned_integer (buf + 32*i + 16, 8); - mfc_cq_dw3 = extract_unsigned_integer (buf + 32*i + 24, 8); + mfc_cq_dw0 = extract_unsigned_integer (buf + 32*seq[i], 8); + mfc_cq_dw1 = extract_unsigned_integer (buf + 32*seq[i] + 8, 8); + mfc_cq_dw2 = extract_unsigned_integer (buf + 32*seq[i] + 16, 8); list_lsa = spu_mfc_get_bitfield (mfc_cq_dw0, 0, 14); list_size = spu_mfc_get_bitfield (mfc_cq_dw0, 15, 26); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 204eb8ab6ad..28046a966cf 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-08-07 Ulrich Weigand + + * gdb.arch/spu-info.exp: Updated for "info spu dma" changes. + 2008-08-06 Tom Tromey * gdb.python/python.exp: New file. diff --git a/gdb/testsuite/gdb.arch/spu-info.exp b/gdb/testsuite/gdb.arch/spu-info.exp index e59b071a7d7..265b21d3751 100644 --- a/gdb/testsuite/gdb.arch/spu-info.exp +++ b/gdb/testsuite/gdb.arch/spu-info.exp @@ -106,12 +106,12 @@ gdb_test "info spu mailbox" \ # 'info spu dma'. gdb_test "info spu dma" \ - "Tag-Group Status.*Tag-Group Mask.*Stall-and-Notify .*Atomic Cmd Status.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*" \ + "Tag-Group Status.*Tag-Group Mask.*Stall-and-Notify .*Atomic Cmd Status.*" \ "info spu dma" # 'info spu proxydma'. gdb_test "info spu proxydma" \ - "Tag-Group Status.*Tag-Group Mask.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*" \ + "Tag-Group Status.*Tag-Group Mask.*" \ "info spu proxydma" # Event tests. @@ -186,14 +186,14 @@ gdb_test "info spu event" \ # 'info spu dma' should be empty. c_to "Marker DMA" gdb_test "info spu dma" \ - "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000000.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*0.*0.*0.*0.*0x00000 0x00000.*" \ + "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000000.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000\[\r\n\]+" \ "info spu dma (empty)" # 'info spu dma' should be filled with some data. c_to "Marker DMAWait" gdb_test "next" "" "next" gdb_test "info spu dma" \ - "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*getl.*putllc.*get.*mfcsync.*get.*0.*0.*0.*0.*0x00000 0x00000.*" \ + "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*get.*5.*0.*0.*0x00080\[ \r\n\]+" \ "info spu dma (non-empty)" gdb_test "finish" "" "finish" -- 2.30.2