From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2897C386F439; Thu, 23 Apr 2020 13:42:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2897C386F439 From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/25807] [readnow] FAIL: gdb.threads/tls.exp: print a_thread_local Date: Thu, 23 Apr 2020 13:42:52 +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-Resolution: 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: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 13:42:52 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25807 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Tom de Vries : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dde82891ce5b6= d2c8109f512cd0732325f4cd0557 commit de82891ce5b6d2c8109f512cd0732325f4cd0557 Author: Tom de Vries Date: Thu Apr 23 15:42:47 2020 +0200 [gdb/symtab] Prefer def over decl (inter-CU case) When running test-case gdb.threads/tls.exp with target board -readnow, = we have: ... (gdb) print a_thread_local^M Cannot find thread-local storage for process 0, executable file tls/tls= :^M Cannot find thread-local variables on this target^M (gdb) FAIL: gdb.threads/tls.exp: print a_thread_local ... while with native we have: ... (gdb) print a_thread_local^M Cannot read `a_thread_local' without registers^M (gdb) PASS: gdb.threads/tls.exp: print a_thread_local ... The difference in behaviour can be explained as follows. Without -read= now, we have two a_thread_locals, the def and the decl, each in a different CU: ... $ gdb -batch outputs/gdb.threads/tls/tls \ -ex "maint expand-symtabs" \ -ex "print a_thread_local" \ -ex "maint print symbols" \ | grep "a_thread_local;" Cannot read `a_thread_local' without registers int a_thread_local; computed at runtime int a_thread_local; unresolved ... and with -readnow, we have the opposite order: ... $ gdb -readnow -batch outputs/gdb.threads/tls/tls \ -ex "maint expand-symtabs" \ -ex "print a_thread_local" \ -ex "maint print symbols" \ | grep "a_thread_local;" Cannot find thread-local storage for process 0, executable file tls/tls: Cannot find thread-local variables on this target int a_thread_local; unresolved int a_thread_local; computed at runtime ... Fix the FAIL by preferring the def over the decl (something we already = do intra-CU since the fix for PR24971, commit 93e55f0a03 "[gdb/symtab] Pre= fer var def over decl"). Build and reg-tested on x86_64-linux. gdb/ChangeLog: 2020-04-23 Tom de Vries PR symtab/25807 * block.c (best_symbol, better_symbol): Promote to external. * block.h (best_symbol, better_symbol): Declare. * symtab.c (lookup_symbol_in_objfile_symtabs): Prefer def over decl. gdb/testsuite/ChangeLog: 2020-04-23 Tom de Vries * gdb.base/decl-before-def-decl.c: New test. * gdb.base/decl-before-def-def.c: New test. * gdb.base/decl-before-def.exp: New file. --=20 You are receiving this mail because: You are on the CC list for the bug.=