From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58471 invoked by alias); 21 Feb 2020 15:36:56 -0000 Mailing-List: contact gdb-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: , Sender: gdb-cvs-owner@sourceware.org List-Subscribe: Sender: gdb-cvs-owner@sourceware.org Received: (qmail 58418 invoked by uid 9882); 21 Feb 2020 15:36:56 -0000 Date: Fri, 21 Feb 2020 15:36:00 -0000 Message-ID: <20200221153656.58417.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb] Fix cc-with-dwz regression X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: bd360d3048e80234a8e772573c9ca3cac9c0466b X-Git-Newrev: 1eb731795357d77ac1f6200edd04f86d210bec79 X-SW-Source: 2020-02/txt/msg00216.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1eb731795357d77ac1f6200edd04f86d210bec79 commit 1eb731795357d77ac1f6200edd04f86d210bec79 Author: Tom de Vries Date: Fri Feb 21 16:36:48 2020 +0100 [gdb] Fix cc-with-dwz regression I noticed a regression with board cc-with-dwz: ... FAIL: gdb.cp/m-static.exp: static const int initialized elsewhere FAIL: gdb.cp/m-static.exp: info variable everywhere ... The problem started with commit 0494dbecdf "Consolidate partial symtab dependency reading". The commit replaces the dwarf2_psymtab::expand_psymtab specific reading of dependencies, which contains a "dependencies[i]->user == NULL" test, with a generic partial_symtab::read_dependencies call, which does not test the user field. This patch fixes the regression by adding back the test, in the generic partial_symtab::read_dependencies. Build and reg-tested on x86_64-linux. Tested natively, as well as with boards cc-with-dwz and cc-with-dwz-m. The patch fixes all 33 regressions with cc-with-dwz, and all 2929 regression with cc-with-dwz-m. gdb/ChangeLog: 2020-02-21 Tom de Vries PR gdb/25534 * psymtab.c (partial_symtab::read_dependencies): Don't read dependency if dependencies[i]->user != NULL. Diff: --- gdb/ChangeLog | 6 ++++++ gdb/psymtab.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d480ff4..90eb475 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-02-21 Tom de Vries + + PR gdb/25534 + * psymtab.c (partial_symtab::read_dependencies): Don't read dependency + if dependencies[i]->user != NULL. + 2020-02-21 Ali Tamur * dwarf2/read.c (dwarf2_name): Add null check. diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 56576b3..fd7fc8f 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1688,7 +1688,8 @@ partial_symtab::read_dependencies (struct objfile *objfile) { for (int i = 0; i < number_of_dependencies; ++i) { - if (!dependencies[i]->readin_p ()) + if (!dependencies[i]->readin_p () + && dependencies[i]->user == NULL) { /* Inform about additional files to be read in. */ if (info_verbose)