From e8abe489a03ca09accfad3d19e85bfd53a007db6 Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Fri, 25 Nov 1994 21:46:52 +0000 Subject: [PATCH] * coffread.c, symfile.h (coff_getfilename): Make it static again. * xcoffread.c (coff_getfilename): Use a static copy from coffread.c, modified for accessing the static xcoff strtbl. --- gdb/ChangeLog | 6 ++++++ gdb/xcoffread.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ab3d818264..aa372de315 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Fri Nov 25 13:37:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * coffread.c, symfile.h (coff_getfilename): Make it static again. + * xcoffread.c (coff_getfilename): Use a static copy from + coffread.c, modified for accessing the static xcoff strtbl. + Fri Nov 25 00:51:05 1994 Jeff Law (law@snake.cs.utah.edu) * hppa-tdep.c (in_solib_call_trampoline): Recognize calls through diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 0cb2f3a6e2..7ab1035cd6 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -32,6 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include +#include #include "obstack.h" #include @@ -186,6 +187,9 @@ free_linetab PARAMS ((void)); static void find_linenos PARAMS ((bfd *, sec_ptr, PTR)); +static char * +coff_getfilename PARAMS ((union internal_auxent *)); + static void read_symbol PARAMS ((struct internal_syment *, int)); @@ -1762,6 +1766,35 @@ process_xcoff_symbol (cs, objfile) return sym2; } +/* Extract the file name from the aux entry of a C_FILE symbol. Return + only the last component of the name. Result is in static storage and + is only good for temporary use. */ + +static char * +coff_getfilename (aux_entry) + union internal_auxent *aux_entry; +{ + static char buffer[BUFSIZ]; + register char *temp; + char *result; + + if (aux_entry->x_file.x_n.x_zeroes == 0) + strcpy (buffer, strtbl + aux_entry->x_file.x_n.x_offset); + else + { + strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN); + buffer[FILNMLEN] = '\0'; + } + result = buffer; + + /* 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; + return (result); +} + /* Set *SYMBOL to symbol number symno in symtbl. */ static void read_symbol (symbol, symno) -- 2.34.1