This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,v2] Make language setting tests more robust


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?

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?

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

Likewise.

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]