From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B6379385DC19; Thu, 9 Apr 2020 11:52:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6379385DC19 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug symtab/25807] New: [readnow] FAIL: gdb.threads/tls.exp: print a_thread_local Date: Thu, 09 Apr 2020 11:52:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vries 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 09 Apr 2020 11:52:50 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25807 Bug ID: 25807 Summary: [readnow] FAIL: gdb.threads/tls.exp: print a_thread_local Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: symtab Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- When running test-case gdb.threads/tls.exp with target board -readnow, we h= ave: ... (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 -readnow,= we have two a_thread_locals, the def and the decl: ... $ 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 ... [ With the tentative fix for PR25764, submitted here ( https://sourceware.org/pipermail/gdb-patches/2020-April/167458.html ), we s= eem to stabilize that search order and make the test fail without -readnow as w= ell. ] Anyway, this seems to be a variant of PR24985 - "Cannot print value of glob= al variable because decl in one CU shadows def in other CU", in the sense that= we probably prefer to find the "computed at runtime" symbol rather than the "unresolved" symbol. But, the tentative patch at PR24985 comment 3 doesn't fix this, because that patch exploits the fact that the decl has an incomplete type, while in this case the type is complete. So, I'm filing this as a separate PR. --=20 You are receiving this mail because: You are on the CC list for the bug.=