Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: [pushed] linux_spu_make_corefile_notes: return note_data instead of nullptr (was: [PATCH] Make target_read_alloc & al return vectors)
Date: Mon, 16 Apr 2018 20:51:00 -0000	[thread overview]
Message-ID: <27aef02a-2bb9-683a-2362-40cfad1174f4@ericsson.com> (raw)
In-Reply-To: <8b2d798a-9383-4f98-0248-6a1a8d4fa1a2@redhat.com>

On 2018-04-16 04:04 PM, Pedro Alves wrote:
> Hi Simon,
> 
> I noticed this recent regression:
> 
>  PASS: gdb.threads/gcore-stale-thread.exp: successfully compiled posix threads test case
>  PASS: gdb.threads/gcore-stale-thread.exp: set non-stop on
>  PASS: gdb.threads/gcore-stale-thread.exp: continue to breakpoint: break-here
> -PASS: gdb.threads/gcore-stale-thread.exp: save a corefile
> +UNSUPPORTED: gdb.threads/gcore-stale-thread.exp: save a corefile
>  PASS: gdb.threads/gcore-stale-thread.exp: exited thread is current due to non-stop
> 
> and bisection points at:
>  9018be22e02 ("Make target_read_alloc & al return vectors")
> 
> diff of gdb.log shows:
> 
>  gcore gdb/testsuite/outputs/gdb.threads/gcore-stale-thread/gcore-stale-thread.core
> -Saved corefile gdb/testsuite/outputs/gdb.threads/gcore-stale-thread/gcore-stale-thread.core
> -(gdb) PASS: gdb.threads/gcore-stale-thread.exp: save a corefile
> +Target does not support core file generation.
> +(gdb) UNSUPPORTED: gdb.threads/gcore-stale-thread.exp: save a corefile

Sorry about that, here's what I pushed to fix it:

From 07d28c777757148d13e429c4463da52cbb50d297 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Mon, 16 Apr 2018 16:47:06 -0400
Subject: [PATCH] linux_spu_make_corefile_notes: return note_data instead of
 nullptr

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    | 5 +++++
 gdb/linux-tdep.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ad7b993..3993491 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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.
diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 552a2a4..24bfd74 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -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)
-- 
2.7.4



  reply	other threads:[~2018-04-16 20:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22  4:03 [PATCH] Make target_read_alloc & al return vectors Simon Marchi
2018-04-07 17:21 ` Simon Marchi
2018-04-16 20:04 ` Pedro Alves
2018-04-16 20:51   ` Simon Marchi [this message]
2018-07-07  8:54 ` Andreas Schwab
2018-07-07 15:10   ` Simon Marchi
2018-07-07 15:17     ` Simon Marchi
2018-07-07 19:32       ` Andreas Schwab
2018-07-07 17:23     ` Andreas Schwab
2018-07-07 17:58       ` Simon Marchi
2018-07-07 18:24         ` Andreas Schwab
2018-07-16 18:02     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27aef02a-2bb9-683a-2362-40cfad1174f4@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox