From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127318 invoked by alias); 16 Apr 2018 20:04:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 127306 invoked by uid 89); 16 Apr 2018 20:04:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy=management X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Apr 2018 20:04:18 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 125E284250; Mon, 16 Apr 2018 20:04:17 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C9012166BAD; Mon, 16 Apr 2018 20:04:16 +0000 (UTC) Subject: Re: [PATCH] Make target_read_alloc & al return vectors To: Simon Marchi , gdb-patches@sourceware.org References: <1521691401-21512-1-git-send-email-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: <8b2d798a-9383-4f98-0248-6a1a8d4fa1a2@redhat.com> Date: Mon, 16 Apr 2018 20:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521691401-21512-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-04/txt/msg00326.txt.bz2 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 Thanks, Pedro Alves On 03/22/2018 04:03 AM, Simon Marchi wrote: > This patch started by changing target_read_alloc_1 to return a > byte_vector, to avoid manual memory management (in target_read_alloc_1 > and in the callers). To communicate failures to the callers, it > actually returns a gdb::optional. > > Adjusting target_read_stralloc was a bit more tricky, since it wants to > return a buffer of char, and not gdb_byte. Since you can't just cast a > gdb::byte_vector into a gdb::def_vector, I made > target_read_alloc_1 templated, so both versions (that return vectors of > gdb_byte and char) are generated. Since target_read_stralloc now > returns a gdb::char_vector instead of a gdb::unique_xmalloc_ptr, a > few callers need to be adjusted.