From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5664 invoked by alias); 25 Oct 2019 20:08:06 -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 5649 invoked by uid 89); 25 Oct 2019 20:08:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy=doable X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Oct 2019 20:08:05 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E489B2105B; Fri, 25 Oct 2019 16:08:02 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id 20E4D20E95; Fri, 25 Oct 2019 16:08:00 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id E8598204C9; Fri, 25 Oct 2019 16:07:59 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Fri, 25 Oct 2019 20:08:00 -0000 From: "Christian Biesinger (Code Review)" To: Christian Biesinger , gdb-patches@sourceware.org Cc: Tom Tromey , Luis Machado Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v2] Only make a nullterminated string if we need to X-Gerrit-Change-Id: I183302e1f51483ff6dff0fd5c3b0f32f0f04a5d2 X-Gerrit-Change-Number: 222 X-Gerrit-ChangeURL: X-Gerrit-Commit: 5e11c9b9bba232a71f62bef9f7fb3e798e1c9ffa In-Reply-To: References: X-Gerrit-Comment-Date: Fri, 25 Oct 2019 16:07:59 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3 Content-Type: text/plain; charset=UTF-8 Message-Id: <20191025200759.E8598204C9@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg00936.txt.bz2 Christian Biesinger has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/222 ...................................................................... Patch Set 2: > Patch Set 1: > > Thanks for the patch. > > The patch moves the `linkage_name_copy` code a bit lower. > But, I think this copy is actually no longer needed at all, and > so the code can be removed. The only real (non-flag) use of > linkage_name_copy is to again copy: > > strcpy (mangled_ptr, linkage_name_copy); > > ... but this could be replaced by a memcpy and then a store of > the trailing \0. > > Wouldn't this change also re-enable the string_view change? > It seems that way to me, but I wonder if I am missing something here. I did update the patch to use the memcpy. There are still two issues blocking the string_view change: - The demangle call mentioned in my previous comment. This could be addressed by just always doing alloca + memcpy, which should be relatively cheap compared to the actual demangling, I'd think - Even if copy_name==false, this function will still copy the name if it is not nullterminated (it has to, because general_symbol_info expects a nullterminated string). This could be fixed by adding a size to general_symbol_info. That should be doable, and I'll look into it However, I think this patch is good even before solving those two issues. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I183302e1f51483ff6dff0fd5c3b0f32f0f04a5d2 Gerrit-Change-Number: 222 Gerrit-PatchSet: 2 Gerrit-Owner: Christian Biesinger Gerrit-Reviewer: Christian Biesinger Gerrit-Reviewer: Luis Machado Gerrit-CC: Tom Tromey Gerrit-Comment-Date: Fri, 25 Oct 2019 20:07:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment