Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: gdb/spu-tdep.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/spu-tdep.h ('k') | gdb/srec.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* SPU target-dependent code for GDB, the GNU debugger. 1 /* SPU target-dependent code for GDB, the GNU debugger.
2 Copyright (C) 2006-2012 Free Software Foundation, Inc. 2 Copyright (C) 2006-2013 Free Software Foundation, Inc.
3 3
4 Contributed by Ulrich Weigand <uweigand@de.ibm.com>. 4 Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
5 Based on a port by Sid Manning <sid@us.ibm.com>. 5 Based on a port by Sid Manning <sid@us.ibm.com>.
6 6
7 This file is part of GDB. 7 This file is part of GDB.
8 8
9 This program is free software; you can redistribute it and/or modify 9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by 10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or 11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version. 12 (at your option) any later version.
13 13
14 This program is distributed in the hope that it will be useful, 14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details. 17 GNU General Public License for more details.
18 18
19 You should have received a copy of the GNU General Public License 19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 21
22 #include "defs.h" 22 #include "defs.h"
23 #include "arch-utils.h" 23 #include "arch-utils.h"
24 #include "gdbtypes.h" 24 #include "gdbtypes.h"
25 #include "gdbcmd.h" 25 #include "gdbcmd.h"
26 #include "gdbcore.h" 26 #include "gdbcore.h"
27 #include "gdb_string.h" 27 #include <string.h>
28 #include "gdb_assert.h" 28 #include "gdb_assert.h"
29 #include "frame.h" 29 #include "frame.h"
30 #include "frame-unwind.h" 30 #include "frame-unwind.h"
31 #include "frame-base.h" 31 #include "frame-base.h"
32 #include "trad-frame.h" 32 #include "trad-frame.h"
33 #include "symtab.h" 33 #include "symtab.h"
34 #include "symfile.h" 34 #include "symfile.h"
35 #include "value.h" 35 #include "value.h"
36 #include "inferior.h" 36 #include "inferior.h"
37 #include "dis-asm.h" 37 #include "dis-asm.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 static enum register_status 185 static enum register_status
186 spu_pseudo_register_read_spu (struct regcache *regcache, const char *regname, 186 spu_pseudo_register_read_spu (struct regcache *regcache, const char *regname,
187 gdb_byte *buf) 187 gdb_byte *buf)
188 { 188 {
189 struct gdbarch *gdbarch = get_regcache_arch (regcache); 189 struct gdbarch *gdbarch = get_regcache_arch (regcache);
190 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); 190 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
191 enum register_status status; 191 enum register_status status;
192 gdb_byte reg[32]; 192 gdb_byte reg[32];
193 char annex[32]; 193 char annex[32];
194 ULONGEST id; 194 ULONGEST id;
195 ULONGEST ul;
195 196
196 status = regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id); 197 status = regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
197 if (status != REG_VALID) 198 if (status != REG_VALID)
198 return status; 199 return status;
199 xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname); 200 xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
200 memset (reg, 0, sizeof reg); 201 memset (reg, 0, sizeof reg);
201 target_read (&current_target, TARGET_OBJECT_SPU, annex, 202 target_read (&current_target, TARGET_OBJECT_SPU, annex,
202 reg, 0, sizeof reg); 203 reg, 0, sizeof reg);
203 204
204 store_unsigned_integer (buf, 4, byte_order, strtoulst (reg, NULL, 16)); 205 ul = strtoulst ((char *) reg, NULL, 16);
206 store_unsigned_integer (buf, 4, byte_order, ul);
205 return REG_VALID; 207 return REG_VALID;
206 } 208 }
207 209
208 static enum register_status 210 static enum register_status
209 spu_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, 211 spu_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
210 int regnum, gdb_byte *buf) 212 int regnum, gdb_byte *buf)
211 { 213 {
212 gdb_byte reg[16]; 214 gdb_byte reg[16];
213 char annex[32]; 215 char annex[32];
214 ULONGEST id; 216 ULONGEST id;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 internal_error (__FILE__, __LINE__, _("invalid regnum")); 249 internal_error (__FILE__, __LINE__, _("invalid regnum"));
248 } 250 }
249 } 251 }
250 252
251 static void 253 static void
252 spu_pseudo_register_write_spu (struct regcache *regcache, const char *regname, 254 spu_pseudo_register_write_spu (struct regcache *regcache, const char *regname,
253 const gdb_byte *buf) 255 const gdb_byte *buf)
254 { 256 {
255 struct gdbarch *gdbarch = get_regcache_arch (regcache); 257 struct gdbarch *gdbarch = get_regcache_arch (regcache);
256 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); 258 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
257 gdb_byte reg[32]; 259 char reg[32];
258 char annex[32]; 260 char annex[32];
259 ULONGEST id; 261 ULONGEST id;
260 262
261 regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id); 263 regcache_raw_read_unsigned (regcache, SPU_ID_REGNUM, &id);
262 xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname); 264 xsnprintf (annex, sizeof annex, "%d/%s", (int) id, regname);
263 xsnprintf (reg, sizeof reg, "0x%s", 265 xsnprintf (reg, sizeof reg, "0x%s",
264 phex_nz (extract_unsigned_integer (buf, 4, byte_order), 4)); 266 phex_nz (extract_unsigned_integer (buf, 4, byte_order), 4));
265 target_write (&current_target, TARGET_OBJECT_SPU, annex, 267 target_write (&current_target, TARGET_OBJECT_SPU, annex,
266 » » reg, 0, strlen (reg)); 268 » » (gdb_byte *) reg, 0, strlen (reg));
267 } 269 }
268 270
269 static void 271 static void
270 spu_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, 272 spu_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
271 int regnum, const gdb_byte *buf) 273 int regnum, const gdb_byte *buf)
272 { 274 {
273 gdb_byte reg[16]; 275 gdb_byte reg[16];
274 char annex[32]; 276 char annex[32];
275 ULONGEST id; 277 ULONGEST id;
276 278
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 regcache_cooked_read_unsigned (regcache, SPU_PC_REGNUM, &pc); 1130 regcache_cooked_read_unsigned (regcache, SPU_PC_REGNUM, &pc);
1129 /* Mask off interrupt enable bit. */ 1131 /* Mask off interrupt enable bit. */
1130 return SPUADDR (tdep->id, pc & -4); 1132 return SPUADDR (tdep->id, pc & -4);
1131 } 1133 }
1132 1134
1133 static void 1135 static void
1134 spu_write_pc (struct regcache *regcache, CORE_ADDR pc) 1136 spu_write_pc (struct regcache *regcache, CORE_ADDR pc)
1135 { 1137 {
1136 /* Keep interrupt enabled state unchanged. */ 1138 /* Keep interrupt enabled state unchanged. */
1137 ULONGEST old_pc; 1139 ULONGEST old_pc;
1140
1138 regcache_cooked_read_unsigned (regcache, SPU_PC_REGNUM, &old_pc); 1141 regcache_cooked_read_unsigned (regcache, SPU_PC_REGNUM, &old_pc);
1139 regcache_cooked_write_unsigned (regcache, SPU_PC_REGNUM, 1142 regcache_cooked_write_unsigned (regcache, SPU_PC_REGNUM,
1140 (SPUADDR_ADDR (pc) & -4) | (old_pc & 3)); 1143 (SPUADDR_ADDR (pc) & -4) | (old_pc & 3));
1141 } 1144 }
1142 1145
1143 1146
1144 /* Cell/B.E. cross-architecture unwinder support. */ 1147 /* Cell/B.E. cross-architecture unwinder support. */
1145 1148
1146 struct spu2ppu_cache 1149 struct spu2ppu_cache
1147 { 1150 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 1182
1180 static int 1183 static int
1181 spu2ppu_sniffer (const struct frame_unwind *self, 1184 spu2ppu_sniffer (const struct frame_unwind *self,
1182 struct frame_info *this_frame, void **this_prologue_cache) 1185 struct frame_info *this_frame, void **this_prologue_cache)
1183 { 1186 {
1184 struct gdbarch *gdbarch = get_frame_arch (this_frame); 1187 struct gdbarch *gdbarch = get_frame_arch (this_frame);
1185 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); 1188 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
1186 CORE_ADDR base, func, backchain; 1189 CORE_ADDR base, func, backchain;
1187 gdb_byte buf[4]; 1190 gdb_byte buf[4];
1188 1191
1189 if (gdbarch_bfd_arch_info (target_gdbarch)->arch == bfd_arch_spu) 1192 if (gdbarch_bfd_arch_info (target_gdbarch ())->arch == bfd_arch_spu)
1190 return 0; 1193 return 0;
1191 1194
1192 base = get_frame_sp (this_frame); 1195 base = get_frame_sp (this_frame);
1193 func = get_frame_pc (this_frame); 1196 func = get_frame_pc (this_frame);
1194 if (target_read_memory (base, buf, 4)) 1197 if (target_read_memory (base, buf, 4))
1195 return 0; 1198 return 0;
1196 backchain = extract_unsigned_integer (buf, 4, byte_order); 1199 backchain = extract_unsigned_integer (buf, 4, byte_order);
1197 1200
1198 if (!backchain) 1201 if (!backchain)
1199 { 1202 {
(...skipping 10 matching lines...) Expand all
1210 1213
1211 if (fi) 1214 if (fi)
1212 { 1215 {
1213 cache->regcache = frame_save_as_regcache (fi); 1216 cache->regcache = frame_save_as_regcache (fi);
1214 *this_prologue_cache = cache; 1217 *this_prologue_cache = cache;
1215 return 1; 1218 return 1;
1216 } 1219 }
1217 else 1220 else
1218 { 1221 {
1219 struct regcache *regcache; 1222 struct regcache *regcache;
1220 » regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch); 1223 » regcache = get_thread_arch_regcache (inferior_ptid, target_gdbarch ()) ;
1221 cache->regcache = regcache_dup (regcache); 1224 cache->regcache = regcache_dup (regcache);
1222 *this_prologue_cache = cache; 1225 *this_prologue_cache = cache;
1223 return 1; 1226 return 1;
1224 } 1227 }
1225 } 1228 }
1226 1229
1227 return 0; 1230 return 0;
1228 } 1231 }
1229 1232
1230 static void 1233 static void
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr)); 1369 store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr));
1367 regcache_cooked_write (regcache, regnum++, buf); 1370 regcache_cooked_write (regcache, regnum++, buf);
1368 } 1371 }
1369 1372
1370 /* Fill in argument registers. */ 1373 /* Fill in argument registers. */
1371 for (i = 0; i < nargs; i++) 1374 for (i = 0; i < nargs; i++)
1372 { 1375 {
1373 struct value *arg = args[i]; 1376 struct value *arg = args[i];
1374 struct type *type = check_typedef (value_type (arg)); 1377 struct type *type = check_typedef (value_type (arg));
1375 const gdb_byte *contents = value_contents (arg); 1378 const gdb_byte *contents = value_contents (arg);
1376 int len = TYPE_LENGTH (type); 1379 int n_regs = align_up (TYPE_LENGTH (type), 16) / 16;
1377 int n_regs = align_up (len, 16) / 16;
1378 1380
1379 /* If the argument doesn't wholly fit into registers, it and 1381 /* If the argument doesn't wholly fit into registers, it and
1380 all subsequent arguments go to the stack. */ 1382 all subsequent arguments go to the stack. */
1381 if (regnum + n_regs - 1 > SPU_ARGN_REGNUM) 1383 if (regnum + n_regs - 1 > SPU_ARGN_REGNUM)
1382 { 1384 {
1383 stack_arg = i; 1385 stack_arg = i;
1384 break; 1386 break;
1385 } 1387 }
1386 1388
1387 spu_value_to_regcache (regcache, regnum, type, contents); 1389 spu_value_to_regcache (regcache, regnum, type, contents);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 else if (reg != -1) 1607 else if (reg != -1)
1606 { 1608 {
1607 int optim, unavail; 1609 int optim, unavail;
1608 1610
1609 if (get_frame_register_bytes (frame, reg, 0, 4, buf, 1611 if (get_frame_register_bytes (frame, reg, 0, 4, buf,
1610 &optim, &unavail)) 1612 &optim, &unavail))
1611 target += extract_unsigned_integer (buf, 4, byte_order) & -4; 1613 target += extract_unsigned_integer (buf, 4, byte_order) & -4;
1612 else 1614 else
1613 { 1615 {
1614 if (optim) 1616 if (optim)
1615 » » error (_("Could not determine address of " 1617 » » throw_error (OPTIMIZED_OUT_ERROR,
1616 » » » "single-step breakpoint.")); 1618 » » » _("Could not determine address of "
1619 » » » "single-step breakpoint."));
1617 if (unavail) 1620 if (unavail)
1618 throw_error (NOT_AVAILABLE_ERROR, 1621 throw_error (NOT_AVAILABLE_ERROR,
1619 _("Could not determine address of " 1622 _("Could not determine address of "
1620 "single-step breakpoint.")); 1623 "single-step breakpoint."));
1621 } 1624 }
1622 } 1625 }
1623 1626
1624 target = target & lslr; 1627 target = target & lslr;
1625 if (target != next_pc) 1628 if (target != next_pc)
1626 insert_single_step_breakpoint (gdbarch, aspace, 1629 insert_single_step_breakpoint (gdbarch, aspace,
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 static struct spu_overlay_table * 1745 static struct spu_overlay_table *
1743 spu_get_overlay_table (struct objfile *objfile) 1746 spu_get_overlay_table (struct objfile *objfile)
1744 { 1747 {
1745 enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)? 1748 enum bfd_endian byte_order = bfd_big_endian (objfile->obfd)?
1746 BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE; 1749 BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
1747 struct minimal_symbol *ovly_table_msym, *ovly_buf_table_msym; 1750 struct minimal_symbol *ovly_table_msym, *ovly_buf_table_msym;
1748 CORE_ADDR ovly_table_base, ovly_buf_table_base; 1751 CORE_ADDR ovly_table_base, ovly_buf_table_base;
1749 unsigned ovly_table_size, ovly_buf_table_size; 1752 unsigned ovly_table_size, ovly_buf_table_size;
1750 struct spu_overlay_table *tbl; 1753 struct spu_overlay_table *tbl;
1751 struct obj_section *osect; 1754 struct obj_section *osect;
1752 char *ovly_table; 1755 gdb_byte *ovly_table;
1753 int i; 1756 int i;
1754 1757
1755 tbl = objfile_data (objfile, spu_overlay_data); 1758 tbl = objfile_data (objfile, spu_overlay_data);
1756 if (tbl) 1759 if (tbl)
1757 return tbl; 1760 return tbl;
1758 1761
1759 ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, objfile); 1762 ovly_table_msym = lookup_minimal_symbol ("_ovly_table", NULL, objfile);
1760 if (!ovly_table_msym) 1763 if (!ovly_table_msym)
1761 return NULL; 1764 return NULL;
1762 1765
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 1917
1915 /* There can be multiple symbols named "main". Search for the 1918 /* There can be multiple symbols named "main". Search for the
1916 "main" in *this* objfile. */ 1919 "main" in *this* objfile. */
1917 minsym = lookup_minimal_symbol ("main", NULL, objfile); 1920 minsym = lookup_minimal_symbol ("main", NULL, objfile);
1918 if (!minsym) 1921 if (!minsym)
1919 return; 1922 return;
1920 1923
1921 /* If we have debugging information, try to use it -- this 1924 /* If we have debugging information, try to use it -- this
1922 will allow us to properly skip the prologue. */ 1925 will allow us to properly skip the prologue. */
1923 pc = SYMBOL_VALUE_ADDRESS (minsym); 1926 pc = SYMBOL_VALUE_ADDRESS (minsym);
1924 symtab = find_pc_sect_symtab (pc, SYMBOL_OBJ_SECTION (minsym)); 1927 symtab = find_pc_sect_symtab (pc, SYMBOL_OBJ_SECTION (objfile, minsym));
1925 if (symtab != NULL) 1928 if (symtab != NULL)
1926 { 1929 {
1927 struct blockvector *bv = BLOCKVECTOR (symtab); 1930 struct blockvector *bv = BLOCKVECTOR (symtab);
1928 struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); 1931 struct block *block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
1929 struct symbol *sym; 1932 struct symbol *sym;
1930 struct symtab_and_line sal; 1933 struct symtab_and_line sal;
1931 1934
1932 sym = lookup_block_symbol (block, "main", VAR_DOMAIN); 1935 sym = lookup_block_symbol (block, "main", VAR_DOMAIN);
1933 if (sym) 1936 if (sym)
1934 { 1937 {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 error (_("\"info spu\" is only supported on the SPU architecture.")); 2041 error (_("\"info spu\" is only supported on the SPU architecture."));
2039 2042
2040 id = get_frame_register_unsigned (frame, SPU_ID_REGNUM); 2043 id = get_frame_register_unsigned (frame, SPU_ID_REGNUM);
2041 2044
2042 xsnprintf (annex, sizeof annex, "%d/event_status", id); 2045 xsnprintf (annex, sizeof annex, "%d/event_status", id);
2043 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, 2046 len = target_read (&current_target, TARGET_OBJECT_SPU, annex,
2044 buf, 0, (sizeof (buf) - 1)); 2047 buf, 0, (sizeof (buf) - 1));
2045 if (len <= 0) 2048 if (len <= 0)
2046 error (_("Could not read event_status.")); 2049 error (_("Could not read event_status."));
2047 buf[len] = '\0'; 2050 buf[len] = '\0';
2048 event_status = strtoulst (buf, NULL, 16); 2051 event_status = strtoulst ((char *) buf, NULL, 16);
2049 2052
2050 xsnprintf (annex, sizeof annex, "%d/event_mask", id); 2053 xsnprintf (annex, sizeof annex, "%d/event_mask", id);
2051 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, 2054 len = target_read (&current_target, TARGET_OBJECT_SPU, annex,
2052 buf, 0, (sizeof (buf) - 1)); 2055 buf, 0, (sizeof (buf) - 1));
2053 if (len <= 0) 2056 if (len <= 0)
2054 error (_("Could not read event_mask.")); 2057 error (_("Could not read event_mask."));
2055 buf[len] = '\0'; 2058 buf[len] = '\0';
2056 event_mask = strtoulst (buf, NULL, 16); 2059 event_mask = strtoulst ((char *) buf, NULL, 16);
2057 2060
2058 chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoEvent"); 2061 chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoEvent");
2059 2062
2060 if (ui_out_is_mi_like_p (current_uiout)) 2063 if (ui_out_is_mi_like_p (current_uiout))
2061 { 2064 {
2062 ui_out_field_fmt (current_uiout, "event_status", 2065 ui_out_field_fmt (current_uiout, "event_status",
2063 "0x%s", phex_nz (event_status, 4)); 2066 "0x%s", phex_nz (event_status, 4));
2064 ui_out_field_fmt (current_uiout, "event_mask", 2067 ui_out_field_fmt (current_uiout, "event_mask",
2065 "0x%s", phex_nz (event_mask, 4)); 2068 "0x%s", phex_nz (event_mask, 4));
2066 } 2069 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 signal1 = extract_unsigned_integer (buf, 4, byte_order); 2108 signal1 = extract_unsigned_integer (buf, 4, byte_order);
2106 signal1_pending = 1; 2109 signal1_pending = 1;
2107 } 2110 }
2108 2111
2109 xsnprintf (annex, sizeof annex, "%d/signal1_type", id); 2112 xsnprintf (annex, sizeof annex, "%d/signal1_type", id);
2110 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, 2113 len = target_read (&current_target, TARGET_OBJECT_SPU, annex,
2111 buf, 0, (sizeof (buf) - 1)); 2114 buf, 0, (sizeof (buf) - 1));
2112 if (len <= 0) 2115 if (len <= 0)
2113 error (_("Could not read signal1_type.")); 2116 error (_("Could not read signal1_type."));
2114 buf[len] = '\0'; 2117 buf[len] = '\0';
2115 signal1_type = strtoulst (buf, NULL, 16); 2118 signal1_type = strtoulst ((char *) buf, NULL, 16);
2116 2119
2117 xsnprintf (annex, sizeof annex, "%d/signal2", id); 2120 xsnprintf (annex, sizeof annex, "%d/signal2", id);
2118 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, buf, 0, 4); 2121 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, buf, 0, 4);
2119 if (len < 0) 2122 if (len < 0)
2120 error (_("Could not read signal2.")); 2123 error (_("Could not read signal2."));
2121 else if (len == 4) 2124 else if (len == 4)
2122 { 2125 {
2123 signal2 = extract_unsigned_integer (buf, 4, byte_order); 2126 signal2 = extract_unsigned_integer (buf, 4, byte_order);
2124 signal2_pending = 1; 2127 signal2_pending = 1;
2125 } 2128 }
2126 2129
2127 xsnprintf (annex, sizeof annex, "%d/signal2_type", id); 2130 xsnprintf (annex, sizeof annex, "%d/signal2_type", id);
2128 len = target_read (&current_target, TARGET_OBJECT_SPU, annex, 2131 len = target_read (&current_target, TARGET_OBJECT_SPU, annex,
2129 buf, 0, (sizeof (buf) - 1)); 2132 buf, 0, (sizeof (buf) - 1));
2130 if (len <= 0) 2133 if (len <= 0)
2131 error (_("Could not read signal2_type.")); 2134 error (_("Could not read signal2_type."));
2132 buf[len] = '\0'; 2135 buf[len] = '\0';
2133 signal2_type = strtoulst (buf, NULL, 16); 2136 signal2_type = strtoulst ((char *) buf, NULL, 16);
2134 2137
2135 chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoSignal"); 2138 chain = make_cleanup_ui_out_tuple_begin_end (current_uiout, "SPUInfoSignal");
2136 2139
2137 if (ui_out_is_mi_like_p (current_uiout)) 2140 if (ui_out_is_mi_like_p (current_uiout))
2138 { 2141 {
2139 ui_out_field_int (current_uiout, "signal1_pending", signal1_pending); 2142 ui_out_field_int (current_uiout, "signal1_pending", signal1_pending);
2140 ui_out_field_fmt (current_uiout, "signal1", "0x%s", phex_nz (signal1, 4)); 2143 ui_out_field_fmt (current_uiout, "signal1", "0x%s", phex_nz (signal1, 4));
2141 ui_out_field_int (current_uiout, "signal1_type", signal1_type); 2144 ui_out_field_int (current_uiout, "signal1_type", signal1_type);
2142 ui_out_field_int (current_uiout, "signal2_pending", signal2_pending); 2145 ui_out_field_int (current_uiout, "signal2_pending", signal2_pending);
2143 ui_out_field_fmt (current_uiout, "signal2", "0x%s", phex_nz (signal2, 4)); 2146 ui_out_field_fmt (current_uiout, "signal2", "0x%s", phex_nz (signal2, 4));
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2810 add_cmd ("mailbox", class_info, info_spu_mailbox_command, 2813 add_cmd ("mailbox", class_info, info_spu_mailbox_command,
2811 _("Display SPU mailbox facility status.\n"), 2814 _("Display SPU mailbox facility status.\n"),
2812 &infospucmdlist); 2815 &infospucmdlist);
2813 add_cmd ("dma", class_info, info_spu_dma_command, 2816 add_cmd ("dma", class_info, info_spu_dma_command,
2814 _("Display MFC DMA status.\n"), 2817 _("Display MFC DMA status.\n"),
2815 &infospucmdlist); 2818 &infospucmdlist);
2816 add_cmd ("proxydma", class_info, info_spu_proxydma_command, 2819 add_cmd ("proxydma", class_info, info_spu_proxydma_command,
2817 _("Display MFC Proxy-DMA status.\n"), 2820 _("Display MFC Proxy-DMA status.\n"),
2818 &infospucmdlist); 2821 &infospucmdlist);
2819 } 2822 }
OLDNEW
« no previous file with comments | « gdb/spu-tdep.h ('k') | gdb/srec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698