mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-16 20:32:21 +08:00
* language.c (set_language_command): Use languages table when
printing available languages.
This commit is contained in:
@ -1,8 +1,16 @@
|
|||||||
Sat Feb 3 10:45:10 1996 Fred Fish <fnf@cygnus.com>
|
Mon Feb 5 09:51:55 1996 Tom Tromey <tromey@creche.cygnus.com>
|
||||||
|
|
||||||
* exec.c (exec_file_command): Fix problem reported by Hans Verkuil
|
* language.c (set_language_command): Use languages table when
|
||||||
(hans@wyst.hobby.nl) where filename in malloc'd memory is referenced
|
printing available languages.
|
||||||
after being freed.
|
|
||||||
|
Sat Feb 3 12:22:05 1996 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
|
Fix problems reported by Hans Verkuil (hans@wyst.hobby.nl):
|
||||||
|
* command.c (add_cmd): Add missing initialization for enums member.
|
||||||
|
Reorder members to match structure declaration to make it easier to
|
||||||
|
tell when one is missing.
|
||||||
|
* exec.c (exec_file_command): Fix problem where filename in malloc'd
|
||||||
|
memory is referenced after being freed.
|
||||||
|
|
||||||
Sat Feb 3 03:26:21 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
Sat Feb 3 03:26:21 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||||||
whenever the working language changes. That would be a lot faster. */
|
whenever the working language changes. That would be a lot faster. */
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
#include <ctype.h>
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
#ifdef ANSI_PROTOTYPES
|
#ifdef ANSI_PROTOTYPES
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -163,19 +164,31 @@ set_language_command (ignore, from_tty)
|
|||||||
enum language flang;
|
enum language flang;
|
||||||
char *err_lang;
|
char *err_lang;
|
||||||
|
|
||||||
/* FIXME -- do this from the list, with HELP. */
|
if (!language || !language[0])
|
||||||
if (!language || !language[0]) {
|
{
|
||||||
printf_unfiltered("The currently understood settings are:\n\n");
|
printf_unfiltered("The currently understood settings are:\n\n");
|
||||||
printf_unfiltered ("local or auto Automatic setting based on source file\n");
|
printf_unfiltered ("local or auto Automatic setting based on source file\n");
|
||||||
printf_unfiltered ("c Use the C language\n");
|
|
||||||
printf_unfiltered ("c++ Use the C++ language\n");
|
for (i = 0; i < languages_size; ++i)
|
||||||
printf_unfiltered ("chill Use the Chill language\n");
|
{
|
||||||
printf_unfiltered ("fortran Use the Fortran language\n");
|
/* Already dealt with these above. */
|
||||||
printf_unfiltered ("modula-2 Use the Modula-2 language\n");
|
if (languages[i]->la_language == language_unknown
|
||||||
/* Restore the silly string. */
|
|| languages[i]->la_language == language_auto)
|
||||||
set_language(current_language->la_language);
|
continue;
|
||||||
return;
|
|
||||||
}
|
/* FIXME for now assume that the human-readable name is just
|
||||||
|
a capitalization of the internal name. */
|
||||||
|
printf_unfiltered ("%-16s Use the %c%s language\n",
|
||||||
|
languages[i]->la_name,
|
||||||
|
/* Capitalize first letter of language
|
||||||
|
name. */
|
||||||
|
toupper (languages[i]->la_name[0]),
|
||||||
|
languages[i]->la_name + 1);
|
||||||
|
}
|
||||||
|
/* Restore the silly string. */
|
||||||
|
set_language(current_language->la_language);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Search the list of languages for a match. */
|
/* Search the list of languages for a match. */
|
||||||
for (i = 0; i < languages_size; i++) {
|
for (i = 0; i < languages_size; i++) {
|
||||||
|
Reference in New Issue
Block a user