diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-11-25 21:46:52 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-11-25 21:46:52 +0000 |
commit | e8abe489a03ca09accfad3d19e85bfd53a007db6 (patch) | |
tree | 59349c54d35d21873c5a2031d0e9a4df2432ab09 /gdb | |
parent | fb14975b7036a91db9c096572fc267e3b5b1b99e (diff) | |
download | gdb-e8abe489a03ca09accfad3d19e85bfd53a007db6.zip gdb-e8abe489a03ca09accfad3d19e85bfd53a007db6.tar.gz gdb-e8abe489a03ca09accfad3d19e85bfd53a007db6.tar.bz2 |
* 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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/xcoffread.c | 33 |
2 files changed, 39 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ab3d818..aa372de 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 0cb2f3a..7ab1035 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -32,6 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/types.h> #include <fcntl.h> #include <ctype.h> +#include <string.h> #include "obstack.h" #include <sys/param.h> @@ -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) |