From: Doug Evans <dje@google.com>
To: Pedro Alves <palves@redhat.com>
Cc: Luis Machado <lgustavo@codesourcery.com>,
gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix language of compilation unit with unknown file extension (Re: [PATCH] Guard compile tests from running when unsupported + harden feature support check)
Date: Wed, 19 Aug 2015 20:43:00 -0000 [thread overview]
Message-ID: <CADPb22Q228-SenifWCUZmQfuE9guGj9J_e51E8zJ7+kqvhZUeQ@mail.gmail.com> (raw)
In-Reply-To: <55D4E0CB.7070404@redhat.com>
On Wed, Aug 19, 2015 at 1:02 PM, Pedro Alves <palves@redhat.com> wrote:
> On 08/19/2015 08:57 PM, Pedro Alves wrote:
>> On 08/19/2015 07:01 PM, Luis Machado wrote:
>>> It could be either a GDB bug for not honoring the language in the DIE
>>> itself or a testcase issue for not naming the source file with the
>>> correct language extension.
>>
>> I think it's a GDB bug. See patch below.
>
> I had left some unnecessary bits in the test's assembly (copy/paste, and
> then insufficient trimming). Here's a leaner version.
>
> ---
> From 8451d7202d4126bfaec5a49fe555989b6fd9b2b1 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Wed, 19 Aug 2015 20:52:44 +0100
> Subject: [PATCH] Fix language of compilation unit with unknown file extension
>
> Here, in dwarfread.c:process_full_comp_unit:
>
> /* Set symtab language to language from DW_AT_language. If the
> compilation is from a C file generated by language preprocessors, do
> not set the language if it was already deduced by start_subfile. */
> if (!(cu->language == language_c
> && COMPUNIT_FILETABS (cust)->language != language_c))
> COMPUNIT_FILETABS (cust)->language = cu->language;
>
> in case start_subfile doesn't manage to deduce a language
> COMPUNIT_FILETABS(cust)->language ends up as language_unknown, not
> language_c. So the condition above evals false and we never set the
> language from the cu's language.
>
> gdb/ChangeLog:
> 2015-08-19 Pedro Alves <palves@redhat.com>
>
> * dwarf2read.c (process_full_comp_unit): To tell whether
> start_subfile managed to deduce a language, test for
> language_unknown instead of language_c.
>
> gdb/testsuite/ChangeLog:
> 2015-08-19 Pedro Alves <palves@redhat.com>
>
> * gdb.dwarf2/comp-unit-lang.exp: New file.
> * gdb.dwarf2/comp-unit-lang.c: New file.
LGTM.
I'm assuming the "global lang" in the test is necessary.
Didn't verify it though.
next prev parent reply other threads:[~2015-08-19 20:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 12:54 [PATCH] Guard compile tests from running when unsupported + harden feature support check Luis Machado
2015-08-19 13:15 ` Pedro Alves
2015-08-19 13:34 ` Luis Machado
2015-08-19 13:46 ` Pedro Alves
2015-08-19 18:01 ` Luis Machado
2015-08-19 19:57 ` [PATCH] Fix language of compilation unit with unknown file extension (Re: [PATCH] Guard compile tests from running when unsupported + harden feature support check) Pedro Alves
2015-08-19 20:02 ` Pedro Alves
2015-08-19 20:43 ` Doug Evans [this message]
2015-08-20 11:37 ` Pedro Alves
2015-08-27 4:57 ` [PATCH] Guard compile tests from running when unsupported + harden feature support check Luis Machado
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=CADPb22Q228-SenifWCUZmQfuE9guGj9J_e51E8zJ7+kqvhZUeQ@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.com \
--cc=palves@redhat.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