From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1933 invoked by alias); 26 Mar 2015 18:43:13 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 1893 invoked by uid 55); 26 Mar 2015 18:43:12 -0000 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/18148] Definitions with DW_AT_const_value never make it into the psymtabs Date: Fri, 27 Mar 2015 16:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00502.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18148 --- Comment #1 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Andy Wingo : https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ff908ebf8612a737d9e168eca0604ff6c97556bc commit ff908ebf8612a737d9e168eca0604ff6c97556bc Author: Andy Wingo Date: Thu Mar 26 19:41:15 2015 +0100 Properly intern constants into psymtab Variables with a DW_AT_const_value but without a DW_AT_location were not getting added to the partial symbol table. They are added to the full symbol table, however, when the compilation unit's psymtabs are expanded. Before: (gdb) p one No symbol "one" in current context. (gdb) mt flush-symbol-cache (gdb) mt expand one.c (gdb) p one $1 = 1 After: (gdb) p one $1 = 1 To the user it's pretty strange, as depending on whether tab completion has forced expansion of all CUs or not the lookup might succeed, or not if the failure was already added to the symbol cache. This commit simply makes sure to add constants to the partial symbol tables. gdb/testsuite/ChangeLog: PR symtab/18148 * gdb.dwarf2/dw2-intercu.S (one, two): Add variables that have a const_value but not a location. * gdb.dwarf2/dw2-intercu.exp: Add tests that constants without location defined in non-main CUs are visible. gdb/ChangeLog: PR symtab/18148 * dwarf2read.c (struct partial_die_info): Add has_const_value member. (add_partial_symbol): Don't punt on symbols that have const_value attributes. (read_partial_die): Detect DW_AT_const_value. -- You are receiving this mail because: You are on the CC list for the bug.