diff options
Diffstat (limited to 'gprof')
-rw-r--r-- | gprof/ChangeLog | 12 | ||||
-rw-r--r-- | gprof/configure.bat | 18 | ||||
-rw-r--r-- | gprof/gprof.c | 12 | ||||
-rw-r--r-- | gprof/hertz.c | 8 | ||||
-rw-r--r-- | gprof/i386.h | 3 |
5 files changed, 51 insertions, 2 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog index 52afc9b..854726e 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,15 @@ +Fri May 27 12:24:57 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + From binutils-2.4 release: + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: [new] build makefile from makefile.in (dos) + * hertz.c: allow static HERTZ (msdos needs it) + * gprof.c: allow target to select "r" or "rb" for fopen + * gprof.c: ignore __gnu_compiled symbols + * i386.h: dfine FOPEN_RB to "rb" for dos. + Tue May 17 15:30:22 1994 E. Michael Smith (ems@cygnus.com) * Makefile.in (.m.c:): Added .SUFFIXES : .m diff --git a/gprof/configure.bat b/gprof/configure.bat new file mode 100644 index 0000000..22ef37e --- /dev/null +++ b/gprof/configure.bat @@ -0,0 +1,18 @@ +@echo off
+echo Configuring gprof for go32
+rem This batch file assumes a unix-type "sed" program
+
+echo # Makefile generated by "configure.bat"> Makefile
+
+if exist config.sed del config.sed
+
+echo "/^###$/ i\ ">>config.sed
+echo "MY_MACHINE=i386\ ">>config.sed
+echo "CC=gcc ">>config.sed
+
+echo # >> config.sed
+
+sed -e "s/^\"//" -e "s/\"$//" -e "s/[ ]*$//" config.sed > config2.sed
+sed -f config2.sed Makefile.in >> Makefile
+del config.sed
+del config2.sed
diff --git a/gprof/gprof.c b/gprof/gprof.c index 683b758..c8e0995 100644 --- a/gprof/gprof.c +++ b/gprof/gprof.c @@ -31,6 +31,10 @@ static char sccsid[] = "@(#)gprof.c 5.6 (Berkeley) 6/1/90"; #include "gprof.h" +#ifndef FOPEN_RB +#define FOPEN_RB "r" +#endif + bfd *abfd; char *whoami; @@ -391,7 +395,7 @@ openpfile(filename) struct rawhdr raw; FILE *pfile; - if((pfile = fopen(filename, "r")) == NULL) { + if((pfile = fopen(filename, FOPEN_RB)) == NULL) { perror(filename); done(); } @@ -769,7 +773,11 @@ funcsymbol( symp ) * Perhaps it should be made configurable. */ - if (symprefix && symprefix != *symp->name) + if (symprefix && symprefix != *symp->name + /* Gcc may add special symbols to help gdb figure out the file + language. We want to ignore these, since sometimes they + mask the real function. (dj@ctron) */ + || !strncmp (symp->name, "__gnu_compiled", 14)) return FALSE; return TRUE; diff --git a/gprof/hertz.c b/gprof/hertz.c index 1c2927f..0d8d9d3 100644 --- a/gprof/hertz.c +++ b/gprof/hertz.c @@ -29,8 +29,15 @@ static char sccsid[] = "@(#)hertz.c 5.4 (Berkeley) 6/1/90"; */ #define HZ_WRONG 0 +#ifdef __MSDOS__ +#define HERTZ 18 +#endif + hertz() { +#ifdef HERTZ + return HERTZ; +#else struct itimerval tim; tim.it_interval.tv_sec = 0; @@ -42,4 +49,5 @@ hertz() if (tim.it_interval.tv_usec < 2) return(HZ_WRONG); return (1000000 / tim.it_interval.tv_usec); +#endif } diff --git a/gprof/i386.h b/gprof/i386.h index f248f6b..79d7b9e 100644 --- a/gprof/i386.h +++ b/gprof/i386.h @@ -33,3 +33,6 @@ #define OFFSET_OF_CODE 0 #define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT)) +#ifdef __MSDOS__ +#define FOPEN_RB "rb" +#endif |