From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C9875387700E for ; Fri, 20 Mar 2020 03:57:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C9875387700E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 667851E5F9; Thu, 19 Mar 2020 23:20:15 -0400 (EDT) Subject: Re: [PATCH] DWARFv5: Handle location list for split dwarf. To: nitachra , gdb-patches@sourceware.org Cc: JiniSusan.George@amd.com References: <20200318141516.19699-1-Nitika.Achra@amd.com> From: Simon Marchi Message-ID: <11a680a7-a1f1-1bf4-3e74-dfb8cb4dd570@simark.ca> Date: Thu, 19 Mar 2020 23:20:14 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200318141516.19699-1-Nitika.Achra@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2020 03:57:30 -0000 On 2020-03-18 10:15 a.m., nitachra wrote: > > Hi Simon, > > Thanks for the review. > >> @@ -332,7 +337,7 @@ dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton, >> enum debug_loc_kind kind; >> const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */ >> >> - if (baton->from_dwo) >> + if (baton->per_cu->version () < 5 && baton->from_dwo) > >> Can you please explain the rationale of this change? It's hard to tell whether it is correct or not without an explanation (and I prefer not having to guess your intentions). > > I made this change because clang and gcc are not generating the DW_LLE_GNU* entries with DWARFv5 and -gsplit-dwarf. > Instead they are generating DW_LLE_start* or DW_LLE_offset_pair with DW_LLE_base_addressx. Thanks. This is the kind of information that is useful to include in the commit message, that explains why you needed to do such and such change. > if (baton->from_dwo && kind != DEBUG_LOC_OFFSET_PAIR) > { > low += base_offset; > high += base_offset; > } > else > { > low += base_address; > high += base_address; > } > > > I made the above change because clang is emitting DW_LLE_offset_pair and DW_LLE_base_addressx for DWARFv5 and -gsplit-dwarf. > So we need to add the base address in the case of dwo also, otherwise the low and high address will be incorrect > and gdb will give when printing the variable values. > > These two changes combined will print the correct variable values. Overall the intent for this patch was to support the location > list for split dwarf and print the correct variable values. Hmm, all I get is . I checked the generated binary a bit closer (test.out and test.dwo), am I supposed to see a .debug_loclists or .debug_loclists.dwo section in there? Because I don't see any... Again, this is with this clang version, take from apt.llvm.org: clang version 10.0.0-++20200317072632+135744ce689-1~exp1~20200317063228.125 > >> I am not able to reproduce to get this error message, there must be something else to trigger this bug: > > To reproduce you have to apply the patch at https://sourceware.org/pipermail/gdb-patches/2020-January/164841.html > I updated the patch right now. Reapply the patch if you have already applied. You will be able to regenerate the error then. Ok. Note that if you have multiple closely related patches (and even more importantly if they have interdependencies), you can send them as a series, it then becomes much easier to track them. Also, please version your patches (if you look at other patches on the list, you'll see the subject may start with "[PATCH v2]"). That makes it much easier to know which one is the latest, especially if you start a new thread. Simon