Commit ada397e9 authored by Gerhard Stenzel's avatar Gerhard Stenzel Committed by Jeremy Kerr

[POWERPC] spufs: fix incorrect file descriptors in SPU coredump note names

At present, ppu-gdb can't trace spu infomation with coredump generated
by the kernel. While the core dumps notes have correct contents, they
have the wrong names, as the file descriptors used to generate the note
names are off-by-one. An application that opens a SPE context as fd 3,
the current core dump code will generate notes like:
  SPU/4/mem
  SPU/4/regs
etc.

This confuses GDB, which knows it is looking for SPE context 3 (from
parsing the spu_context_run system call arguments), and cannot find
any notes that match context 3.

This change corrects the file descriptor counting, to only increment
the fd until after we've written the note name.
Signed-off-by: default avatarGerhard Stenzel <stenzel@de.ibm.com>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent 36d29edb
...@@ -133,8 +133,6 @@ static struct spu_context *coredump_next_context(int *fd) ...@@ -133,8 +133,6 @@ static struct spu_context *coredump_next_context(int *fd)
if (ctx->flags & SPU_CREATE_NOSCHED) if (ctx->flags & SPU_CREATE_NOSCHED)
continue; continue;
/* start searching the next fd next time we're called */
(*fd)++;
break; break;
} }
...@@ -157,6 +155,9 @@ int spufs_coredump_extra_notes_size(void) ...@@ -157,6 +155,9 @@ int spufs_coredump_extra_notes_size(void)
break; break;
size += rc; size += rc;
/* start searching the next fd next time */
fd++;
} }
return size; return size;
...@@ -239,6 +240,9 @@ int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset) ...@@ -239,6 +240,9 @@ int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset)
} }
spu_release_saved(ctx); spu_release_saved(ctx);
/* start searching the next fd next time */
fd++;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment