aboutsummaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-03-09 12:48:56 +0000
committerPedro Alves <palves@redhat.com>2011-03-09 12:48:56 +0000
commit9f37bbcca8004e1ac5be674446c51b50b36dc94e (patch)
tree02a5d9a92d9719944c943c4f7160cc3a6d42fc5a /gdb/coffread.c
parentf8de3c55e995e88e61316d7025e4d83927497e18 (diff)
downloadgdb-9f37bbcca8004e1ac5be674446c51b50b36dc94e.zip
gdb-9f37bbcca8004e1ac5be674446c51b50b36dc94e.tar.gz
gdb-9f37bbcca8004e1ac5be674446c51b50b36dc94e.tar.bz2
* 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'.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r--gdb/coffread.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 85a5553..8ec87c1 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -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);
}