public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Cc: <simon.marchi@polymtl.ca>
Subject: Re: [PATCH,v2] Make language setting tests more robust
Date: Mon, 06 Feb 2017 18:04:00 -0000	[thread overview]
Message-ID: <932c60a6-c132-2a93-22f2-c909edc18bc0@codesourcery.com> (raw)
In-Reply-To: <693288e6-921d-7ff2-e81f-4aa8ccdd75a3@redhat.com>

On 02/06/2017 10:50 AM, Pedro Alves wrote:
> On 02/06/2017 02:54 PM, Luis Machado wrote:
>>
>> The story here is that i noticed 3 tests with such a problem:
>>
>> FAIL: gdb.compile/compile-ifunc.exp: nodebug: set language c
>> FAIL: gdb.dwarf2/data-loc.exp: set language ada
>> FAIL: gdb.dwarf2/dynarr-ptr.exp: set language ada
>>
>> And my build had a glibc with debugging symbols and sources, therefore
>> GDB had set the initial language to asm before main.
>
> There's a comment about that in gdb.compile/compile-ifunc.exp:
>
>     # This binary has no debug information, so force the language to C in case
>     # GDB happened to see real asm code when it stopped at the entry point
>     # when talking to a remote target, like gdbserver.  This guarantees the
>     # feature check below will work.
>     gdb_test_no_output "set language c" ""
>
> So the question is, why did the gdb_test_no_output work back then,
> and doesn't now?
>

I can't confirm it worked before since i haven't looked at this 
particular setup then.

> In top.c:check_frame_language_change()
> [...]
>   if (has_stack_frames ())
>     {
>       enum language flang;
>
>       flang = get_frame_language (frame);
>       if (!warned
> 	  && flang != language_unknown
> 	  && flang != current_language->la_language)
> 	{
> 	  printf_filtered ("%s\n", lang_frame_mismatch_warn);
> 	  warned = 1;
> 	}
>
> what does get_frame_language return?  Isn't it returning
> language_unknown for you?  Why not?
>

That returns language_asm for me. Supposedly because gdb has seen asm 
from glibc and then sticked with it when it reached the test program's 
main. And the program has no debug info.

>> FAIL: gdb.dwarf2/data-loc.exp: set language ada
>> FAIL: gdb.dwarf2/dynarr-ptr.exp: set language ada

Same as above, language_asm.

Maybe gdb should've switched to language_unknown when it reached main 
for this/these particular cases?

The logic to complain about a mismatch of language between the frame and 
the user selection seems sane.

  reply	other threads:[~2017-02-06 18:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 15:17 [PATCH] " Luis Machado
2017-02-01 18:38 ` Simon Marchi
2017-02-01 19:22   ` Luis Machado
2017-02-01 19:25     ` Simon Marchi
2017-02-01 21:50   ` Keith Seitz
2017-02-01 23:29     ` Luis Machado
2017-02-02  1:24     ` Simon Marchi
2017-02-01 20:21 ` [PATCH,v2] " Luis Machado
2017-02-02  1:33   ` Simon Marchi
2017-02-03  0:37   ` Pedro Alves
2017-02-06 14:54     ` Luis Machado
2017-02-06 15:09       ` Luis Machado
2017-02-06 16:51       ` Pedro Alves
2017-02-06 18:04         ` Luis Machado [this message]
2017-02-06 18:08           ` Pedro Alves
2017-02-06 18:22             ` Luis Machado
2017-02-06 18:24               ` Pedro Alves
2017-02-06 19:56                 ` 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=932c60a6-c132-2a93-22f2-c909edc18bc0@codesourcery.com \
    --to=lgustavo@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    /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).