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]

[RFA] Fix "set lang auto" oddity when inferior not started yet


Consider the following scenario:

        (gdb) file my_c_program
        (gdb) show lang
        The current source language is "auto; currently c".
        (gdb) set lang ada

Now, try to set the language_mode back to "auto", and see what
the language is:

        (gdb) set lang auto 
        (gdb) show lang
        The current source language is "auto".

We forgot to set the language!  This was reported to us a while ago
by the GPS team (GPS is an IDE that contains a frontend to GDB),
because they rely in some occasions on GDB to tell them what the
language is.

The attached patch fixes the problem.

2008-01-02  Joel Brobecker  <brobecker@adacore.com>

        * symfile.c (set_initial_language): Make non-static.
        * symfile.h (set_initial_language): Add declaration.
        * language.c: #include "symfile.h".
        (set_language): Call set_initial_language if the frame language
        could not be determined.

I also wrote a tiny testcase:

2008-01-02  Joel Brobecker  <brobecker@adacore.com>

        * gdb.base/set_lang_auto.exp: New testcase.

All tested on x86-linux, no regression.
OK to commit?

Thanks,
-- 
Joel

Attachment: set_lang_auto.diff
Description: Text document

Attachment: set_lang_auto-testcase.diff
Description: Text document


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