From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61652 invoked by alias); 7 Feb 2020 14:45:50 -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 61643 invoked by uid 89); 7 Feb 2020 14:45:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-29.3 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=pst, HX-HELO:sk:mail-ot X-HELO: mail-ot1-f42.google.com Received: from mail-ot1-f42.google.com (HELO mail-ot1-f42.google.com) (209.85.210.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 14:45:46 +0000 Received: by mail-ot1-f42.google.com with SMTP id i6so2343740otr.7 for ; Fri, 07 Feb 2020 06:45:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dr+VOrE0n8PdA1stGTQgOuCh8QeNLDNhhsKNGI+24GU=; b=wFWbxyCGaQexPEBnEE+p+LoU0oz3qD/mS+BvFrAJ7jpSjdSn3lgSlNXNeVb4qBigkj 5s3NM+F8TottiwZB8AS7AedUzHJIpxyHz2mzt/QANemMGilo8VBMl8mfIpF5gyfimRY6 GhW2r1LrmR9hhcCX/rpLSq3nrA/HLyL3c0kz2GV0McF7TXLjHhE4jpLO3cIVqi7k5yl6 KXRZdBPB0xAGMFVbhOqKYzH44rwnw/GLHtJ05HZYI5cS1XVkKmyvv5ynoWluJfvpBABi 5Cdamnmo/gWoJyqoVWhflcgl/IpZvPdg8suvV1re8mrWdT8XVepJQMrIUiiOdOfRZNSm J8wQ== MIME-Version: 1.0 References: <20200207113429.GA6532@delia> In-Reply-To: <20200207113429.GA6532@delia> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Fri, 07 Feb 2020 14:45:00 -0000 Message-ID: Subject: Re: [PATCH][gdb] Mention CU offset for if verbose To: Tom de Vries Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00158.txt.bz2 On Fri, Feb 7, 2020 at 6:34 AM Tom de Vries wrote: > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index dafe01d94a..28ade424fd 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -8020,6 +8020,20 @@ create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) > struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile; > dwarf2_psymtab *pst; > > + const char *artificial = ""; This may not matter but I'd use static const char artificial[] = "..." > + if (strcmp (name, artificial) == 0) > + { > + sect_offset cu_offset = per_cu->sect_off; > + const char *cu_offset_str = sect_offset_str (cu_offset); > + const char *sep = "@"; > + char *new_name = (char *) xmalloc (strlen (artificial) + strlen (sep) > + + strlen (cu_offset_str) + 1); > + strcpy (new_name, artificial); > + strcat (new_name, sep); > + strcat (new_name, cu_offset_str); Use concat() instead of malloc/strcpy/strcat? > + name = new_name; > + } > + > pst = new dwarf2_psymtab (name, objfile, 0); > > pst->psymtabs_addrmap_supported = true;