mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
Constify main_name
This patch constifies the return type of main_name. There is a comment indicating that this wasn't possible at some point in the past, but whatever the barrier was, it is gone now. Tested by rebuilding. gdb/ChangeLog 2019-07-18 Tom Tromey <tromey@adacore.com> * symtab.c (main_name): Constify return type. * symfile.c (set_initial_language): Update. * symtab.h (main_name): Constify return type.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2019-07-18 Tom Tromey <tromey@adacore.com>
|
||||||
|
|
||||||
|
* symtab.c (main_name): Constify return type.
|
||||||
|
* symfile.c (set_initial_language): Update.
|
||||||
|
* symtab.h (main_name): Constify return type.
|
||||||
|
|
||||||
2019-07-17 Tom Tromey <tom@tromey.com>
|
2019-07-17 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-winsource.c (tui_update_source_window)
|
* tui/tui-winsource.c (tui_update_source_window)
|
||||||
|
@ -1706,7 +1706,7 @@ set_initial_language (void)
|
|||||||
|
|
||||||
if (lang == language_unknown)
|
if (lang == language_unknown)
|
||||||
{
|
{
|
||||||
char *name = main_name ();
|
const char *name = main_name ();
|
||||||
struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
|
struct symbol *sym = lookup_symbol (name, NULL, VAR_DOMAIN, NULL).symbol;
|
||||||
|
|
||||||
if (sym != NULL)
|
if (sym != NULL)
|
||||||
|
@ -5741,8 +5741,10 @@ find_main_name (void)
|
|||||||
set_main_name ("main", language_unknown);
|
set_main_name ("main", language_unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
/* See symtab.h. */
|
||||||
main_name (void)
|
|
||||||
|
const char *
|
||||||
|
main_name ()
|
||||||
{
|
{
|
||||||
struct main_info *info = get_main_info ();
|
struct main_info *info = get_main_info ();
|
||||||
|
|
||||||
|
@ -2041,11 +2041,8 @@ extern std::vector<symbol_search> search_symbols (const char *,
|
|||||||
extern bool treg_matches_sym_type_name (const compiled_regex &treg,
|
extern bool treg_matches_sym_type_name (const compiled_regex &treg,
|
||||||
const struct symbol *sym);
|
const struct symbol *sym);
|
||||||
|
|
||||||
/* The name of the ``main'' function.
|
/* The name of the ``main'' function. */
|
||||||
FIXME: cagney/2001-03-20: Can't make main_name() const since some
|
extern const char *main_name ();
|
||||||
of the calling code currently assumes that the string isn't
|
|
||||||
const. */
|
|
||||||
extern /*const */ char *main_name (void);
|
|
||||||
extern enum language main_language (void);
|
extern enum language main_language (void);
|
||||||
|
|
||||||
/* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global blocks.
|
/* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global blocks.
|
||||||
|
Reference in New Issue
Block a user