linux_spu_make_corefile_notes: return note_data instead of nullptr
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 16 Apr 2018 20:47:06 +0000 (16:47 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 16 Apr 2018 20:47:06 +0000 (16:47 -0400)
Since commit

  9018be2 ("Make target_read_alloc & al return vectors")

the test gdb.threads/gcore-stale-thread.exp test results in UNSUPPORTED:

  UNSUPPORTED: gdb.threads/gcore-stale-thread.exp: save a corefile

The problem is that the linux_spu_make_corefile_notes started returning
nullptr when reading TARGET_OBJECT_SPU fails.  The previous (and proper)
behaviour is to return the note_data received as a parameter, so that
other functions may continue to append to this buffer.

With this patch, the test goes back to PASS.

gdb/ChangeLog:

* linux-tdep.c (linux_spu_make_corefile_notes): Return note_data
instead of nullptr.

gdb/ChangeLog
gdb/linux-tdep.c

index ad7b99341511e04cfb65ccdda5056deabd0e90e0..39934911e9daf5bb9e99833fcd8cfd9601318fd2 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-16  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * linux-tdep.c (linux_spu_make_corefile_notes): Return note_data
+       instead of nullptr.
+
 2018-04-16  Pedro Alves  <palves@redhat.com>
 
        * MAINTAINERS (sh): Remove.
index 552a2a495b4330aa274a4c423c874a1896487c03..24bfd74dea07553f1712a70eec0605b751d4145d 100644 (file)
@@ -1426,7 +1426,7 @@ linux_spu_make_corefile_notes (bfd *obfd, char *note_data, int *note_size)
     spu_ids = target_read_alloc (&current_target, TARGET_OBJECT_SPU, NULL);
 
   if (!spu_ids)
-    return nullptr;
+    return note_data;
 
   /* Generate corefile notes for each SPU file.  */
   for (size_t i = 0; i < spu_ids->size (); i += 4)
This page took 0.028086 seconds and 4 git commands to generate.