mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 09:14:14 +08:00
* cli/cli-cmds.c (shell_escape): Use lbasename.
* coffread.c (coff_start_symtab): Constify parameter. (complete_symtab): Constify `name' parameter. (coff_symtab_read): Constify `filestring' local. (coff_getfilename): Constify return and `result' local. Use lbasename. * fbsd-nat.c (fbsd_make_corefile_notes): Use lbasename. * linux-fork.c (info_checkpoints_command): Use lbasename. * linux-nat.c (linux_nat_make_corefile_notes): Use lbasename. * minsyms.c (lookup_minimal_symbol): Use lbasename. * nto-tdep.c (nto_find_and_open_solib): Use lbasename. * procfs.c (procfs_make_note_section): Use lbasename. * tui/tui-io.c (printable_part): Constity return and parameter. Use lbasename. (print_filename): Constify parameters, and local `s'. (tui_rl_display_match_list): Constify local `temp'.
This commit is contained in:
@ -178,7 +178,7 @@ static int init_lineno (bfd *, long, int);
|
||||
|
||||
static char *getsymname (struct internal_syment *);
|
||||
|
||||
static char *coff_getfilename (union internal_auxent *);
|
||||
static const char *coff_getfilename (union internal_auxent *);
|
||||
|
||||
static void free_stringtab (void);
|
||||
|
||||
@ -366,7 +366,7 @@ coff_alloc_type (int index)
|
||||
it indicates the start of data for one original source file. */
|
||||
|
||||
static void
|
||||
coff_start_symtab (char *name)
|
||||
coff_start_symtab (const char *name)
|
||||
{
|
||||
start_symtab (
|
||||
/* We fill in the filename later. start_symtab puts this pointer
|
||||
@ -388,7 +388,7 @@ coff_start_symtab (char *name)
|
||||
text. */
|
||||
|
||||
static void
|
||||
complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
|
||||
complete_symtab (const char *name, CORE_ADDR start_addr, unsigned int size)
|
||||
{
|
||||
if (last_source_file != NULL)
|
||||
xfree (last_source_file);
|
||||
@ -713,7 +713,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
|
||||
int in_source_file = 0;
|
||||
int next_file_symnum = -1;
|
||||
/* Name of the current file. */
|
||||
char *filestring = "";
|
||||
const char *filestring = "";
|
||||
int depth = 0;
|
||||
int fcn_first_line = 0;
|
||||
CORE_ADDR fcn_first_line_addr = 0;
|
||||
@ -1308,12 +1308,12 @@ getsymname (struct internal_syment *symbol_entry)
|
||||
Return only the last component of the name. Result is in static
|
||||
storage and is only good for temporary use. */
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
coff_getfilename (union internal_auxent *aux_entry)
|
||||
{
|
||||
static char buffer[BUFSIZ];
|
||||
char *temp;
|
||||
char *result;
|
||||
const char *result;
|
||||
|
||||
if (aux_entry->x_file.x_n.x_zeroes == 0)
|
||||
{
|
||||
@ -1331,8 +1331,7 @@ coff_getfilename (union internal_auxent *aux_entry)
|
||||
/* FIXME: We should not be throwing away the information about what
|
||||
directory. It should go into dirname of the symtab, or some such
|
||||
place. */
|
||||
if ((temp = strrchr (result, '/')) != NULL)
|
||||
result = temp + 1;
|
||||
result = lbasename (result);
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user