Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Guard compile tests from running when unsupported + harden feature support check
Date: Wed, 19 Aug 2015 18:01:00 -0000	[thread overview]
Message-ID: <55D4C47F.6080902@codesourcery.com> (raw)
In-Reply-To: <55D48891.7050808@redhat.com>

On 08/19/2015 10:45 AM, Pedro Alves wrote:
> On 08/19/2015 02:34 PM, Luis Machado wrote:
>> Enabling debug info i see the standard error about missing libcc1, which
>> may be an alternate fix, though checking for unsupported languages does
>> sound useful to me.
>
> I disagree.  It's a bug, because the tests are testing C code.
>

I did a bit more investigation and here's what i found:

GDB generally sets the default language to C on top.c:gdb_init. Usually 
the dynamic loader code is not available, so GDB doesn't switch away 
from C when connecting to GDBserver.

It does for me because it sees real asm code from the dynamic loader, so 
the starting language is "asm". Now, the testcases have different behaviors.

For compile-ifunc.exp, when we run to main, we don't have any kind of 
debug info that tells GDB what language we are dealing with, so GDB 
doesn't switch away from the previously selected "asm". Forcing the 
language to C would fix this.

For compile-ops.exp, on the other hand, we run to "func" and it has 
debug info, but the source file is named "file1.txt". Not sure if this 
was on purpose, but it seems to throw GDB off when trying to find the 
source language, even though the DIE states it is C.

If i rename the source file to file1.c, then GDB correctly selects C as 
the current source language.

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.

> BTW, it'd be nice if the "No compiler support for this language"
> error told us which language is "this"...
>

Indeed it would be useful.


  reply	other threads:[~2015-08-19 18:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 12:54 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 [this message]
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
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=55D4C47F.6080902@codesourcery.com \
    --to=lgustavo@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --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