public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-25807-4717-xhPWnMa0xR@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-25807-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=25807

--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=de82891ce5b6d2c8109f512cd0732325f4cd0557

commit de82891ce5b6d2c8109f512cd0732325f4cd0557
Author: Tom de Vries <tdevries@suse.de>
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 -readnow,
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] Prefer
var
    def over decl").

    Build and reg-tested on x86_64-linux.

    gdb/ChangeLog:

    2020-04-23  Tom de Vries  <tdevries@suse.de>

            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  <tdevries@suse.de>

            * 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-04-23 13:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 11:52 [Bug symtab/25807] New: " vries at gcc dot gnu.org
2020-04-09 11:57 ` [Bug symtab/25807] " vries at gcc dot gnu.org
2020-04-09 14:31 ` vries at gcc dot gnu.org
2020-04-23 13:42 ` cvs-commit at gcc dot gnu.org [this message]
2024-01-26 13:59 ` ssbssa at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-25807-4717-xhPWnMa0xR@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).