-/* Generate corefile notes for SPU contexts. */
-
-static char *
-linux_spu_make_corefile_notes (bfd *obfd, char *note_data, int *note_size)
-{
- static const char *spu_files[] =
- {
- "object-id",
- "mem",
- "regs",
- "fpcr",
- "lslr",
- "decr",
- "decr_status",
- "signal1",
- "signal1_type",
- "signal2",
- "signal2_type",
- "event_mask",
- "event_status",
- "mbox_info",
- "ibox_info",
- "wbox_info",
- "dma_info",
- "proxydma_info",
- };
-
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- gdb_byte *spu_ids;
- LONGEST i, j, size;
-
- /* Determine list of SPU ids. */
- size = target_read_alloc (¤t_target, TARGET_OBJECT_SPU,
- NULL, &spu_ids);
-
- /* Generate corefile notes for each SPU file. */
- for (i = 0; i < size; i += 4)
- {
- int fd = extract_unsigned_integer (spu_ids + i, 4, byte_order);
-
- for (j = 0; j < sizeof (spu_files) / sizeof (spu_files[0]); j++)
- {
- char annex[32], note_name[32];
- gdb_byte *spu_data;
- LONGEST spu_len;
-
- xsnprintf (annex, sizeof annex, "%d/%s", fd, spu_files[j]);
- spu_len = target_read_alloc (¤t_target, TARGET_OBJECT_SPU,
- annex, &spu_data);
- if (spu_len > 0)
- {
- xsnprintf (note_name, sizeof note_name, "SPU/%s", annex);
- note_data = elfcore_write_note (obfd, note_data, note_size,
- note_name, NT_SPU,
- spu_data, spu_len);
- xfree (spu_data);
-
- if (!note_data)
- {
- xfree (spu_ids);
- return NULL;
- }
- }
- }
- }
-
- if (size > 0)
- xfree (spu_ids);
-
- return note_data;
-}
-