From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24933 invoked by alias); 18 Feb 2020 02:33:13 -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 24924 invoked by uid 89); 18 Feb 2020 02:33:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-qv1-f65.google.com Received: from mail-qv1-f65.google.com (HELO mail-qv1-f65.google.com) (209.85.219.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Feb 2020 02:33:10 +0000 Received: by mail-qv1-f65.google.com with SMTP id y8so8493838qvk.6 for ; Mon, 17 Feb 2020 18:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/39Equzis/kVPedhTn7CQrsR5jv93H4VF9HZY6DS0m0=; b=pgdRq6XNWYyytqTPqoD5cExVe5MZUjWmCB0duU0LL+HnEPsqXUq3q2+zlshSwobx3A rQgrmHtE+BzMtP3lJ3kgl8AQAR3rS2ABgJ3yI4kKxXPD/gyrAh6ucYtV2aBFUvSXXNNE zLhlsHeDXMEc2JurzodfGsWO3BzNadrahH+MYSoEpPuAAygq0afN9zFUqa2JnjwlCSvI 6Lfk/uA+j9WM0/LUdXOIXh8qnlvu90xG0eeayRsfKbTAwnhAAn6xLCSHxlBCt2qD16Xc YkvjgAmFw/ltGqmqGk2LWOcaQrzYK3rVPjZEHnD3pZCmykg0fqlLWv679AOgVzWL6VzX bBQQ== Return-Path: Received: from [192.168.0.185] ([179.177.236.155]) by smtp.gmail.com with ESMTPSA id g18sm1218314qki.13.2020.02.17.18.33.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Feb 2020 18:33:08 -0800 (PST) Subject: Re: [PATCH] Search .dwo in the binary directory. To: Ali Tamur , gdb-patches@sourceware.org Cc: Nitika.Achra@amd.com, JiniSusan.George@amd.com References: <20200213061903.83384-1-tamur@google.com> From: Luis Machado Message-ID: <63be4d46-9c25-7deb-a7cc-69276cf740f8@linaro.org> Date: Tue, 18 Feb 2020 02:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200213061903.83384-1-tamur@google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00700.txt.bz2 Hi, On 2/13/20 3:19 AM, Ali Tamur via gdb-patches wrote: > .dwo files generated by the compiler usually resides in the same directory as > the generated binary itself. Add that binary to the list of directories to > search when searching for the .dwo file. Thanks. This seems to be aligned with what find_separate_debug_file does: /* First try in the same directory as the original file. */ std::string debugfile = dir; debugfile += debuglink; I guess you meant "Add that binary's path to the list ...". > > gdb/ChangeLog: > > * dwarf2/read.c (try_open_dwop_file): Include binary directory to > the list of directories to search. Search the path also when looking > for a .dwo file. > --- > gdb/dwarf2/read.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c > index 7edbd9d7df..39f583e758 100644 > --- a/gdb/dwarf2/read.c > +++ b/gdb/dwarf2/read.c > @@ -12012,9 +12012,14 @@ try_open_dwop_file (struct dwarf2_per_objfile *dwarf2_per_objfile, > else > search_path = debug_file_directory; > > + /* Add the directory of the binary to the search list. */ > + search_path_holder.reset( > + concat (ldirname (dwarf2_per_objfile->objfile->original_name).c_str (), > + dirname_separator_string, search_path, (char *) NULL)); > + search_path = search_path_holder.get (); > + > openp_flags flags = OPF_RETURN_REALPATH; > - if (is_dwp) > - flags |= OPF_SEARCH_IN_PATH; > + flags |= OPF_SEARCH_IN_PATH; This was the only use of is_dwp. Now the parameter is unused in try_open_dwop_file and this and other functions should be updated. Do you know what is_dwp is originally for? Other than telling the function we're interested in reading a dwp file? I see it was added back in 2012 by commit 80626a55b99a0cb91546f334fc683f7a9f351101. > > gdb::unique_xmalloc_ptr absolute_name; > desc = openp (search_path, flags, file_name, >