From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH][gdb/symtab] Prefer def over decl (inter-CU case, with context)
Date: Thu, 23 Apr 2020 15:57:51 +0200 [thread overview]
Message-ID: <48b49030-f005-37cd-8a56-19ed7492dda4@suse.de> (raw)
In-Reply-To: <20200409210804.GA6512@delia>
On 09-04-2020 23:08, Tom de Vries wrote:
> Hi,
>
> This is a follow-up patch on "[PATCH][gdb/symtab] Prefer def over decl
> (inter-CU case)" (
> https://sourceware.org/pipermail/gdb-patches/2020-April/167489.html ).
>
> Consider the test-case from that patch. It contains a decl and def of var a
> in different CUs, and tests whether var a can be printed using the def, even
> if the decl is found first.
>
> However, the test-case does this in a contextless environment, so if we add to
> the test-case like this to set the context to the CU containing main:
> ...
> gdb_test "p a" { = \{1, 2\}}
> +
> +if ![runto_main] then {
> + fail "can't run to main"
> + return 0
> +}
> +
> +gdb_test "p a" { = \{1, 2\}}
> ...
> then the second test fails, because the decl is found in the context.
>
> Fix this by preferring defs over decls in lookup_global_symbol.
>
> Build and reg-tested on x86_64-linux.
>
Committed.
Thanks,
- Tom
prev parent reply other threads:[~2020-04-23 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 21:08 Tom de Vries
2020-04-23 13:57 ` Tom de Vries [this message]
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=48b49030-f005-37cd-8a56-19ed7492dda4@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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