* Fix a goof in the profiling code
@ 2003-01-27 14:38 Daniel Jacobowitz
2003-01-27 19:36 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-01-27 14:38 UTC (permalink / raw)
To: gdb-patches
Joel pointed out to me that the profile patch had evolved to the point where
the checks in configure weren't really being used; we called monstartup()
regardless of --enable-profiling but only checked for it if the option was
given. HP/UX lacks them. Oops.
Fixed thus.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-01-27 Daniel Jacobowitz <drow@mvista.com>
* configure.in: Check that -pg works if using --enable-profiling.
Check for monstartup and _mcleanup regardless of --enable-profiling.
* maint.c: Check for monstartup and _mcleanup before using them.
* config.in: Regenerated.
* configure: Regenerated.
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.31
diff -u -p -r1.31 maint.c
--- maint.c 22 Jan 2003 23:50:35 -0000 1.31
+++ maint.c 27 Jan 2003 14:27:46 -0000
@@ -642,6 +642,9 @@ maintenance_show_cmd (char *args, int fr
/* Profiling support. */
static int maintenance_profile_p;
+
+#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP)
+
static int profiling_state;
static void
@@ -685,6 +688,13 @@ maintenance_set_profile_cmd (char *args,
_mcleanup ();
}
}
+#else
+static void
+maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c)
+{
+ warning ("Profiling support is not available on this system.");
+}
+#endif
void
_initialize_maint_cmds (void)
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.118
diff -u -p -r1.118 configure.in
--- configure.in 22 Jan 2003 23:50:35 -0000 1.118
+++ configure.in 27 Jan 2003 14:33:34 -0000
@@ -194,16 +194,22 @@ AC_ARG_ENABLE(profiling,
esac],
[enable_profiling=no])
+AC_CHECK_FUNCS(monstartup _mcleanup)
if test "$enable_profiling" = yes ; then
+ if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
+ AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
+ fi
PROFILE_CFLAGS=-pg
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PROFILE_CFLAGS"
- AC_CHECK_FUNC(monstartup, [],
- AC_MSG_ERROR(monstartup necessary to use --enable-profiling.))
+ AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
+ [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
+ ac_cv_cc_supports_pg=no)])
- AC_CHECK_FUNC(_mcleanup, [],
- AC_MSG_ERROR(_mcleanup necessary to use --enable-profiling.))
+ if test $ac_cv_cc_supports_pg = no; then
+ AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
+ fi
CFLAGS="$OLD_CFLAGS"
fi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix a goof in the profiling code
2003-01-27 14:38 Fix a goof in the profiling code Daniel Jacobowitz
@ 2003-01-27 19:36 ` Andrew Cagney
2003-01-27 20:26 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2003-01-27 19:36 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
> + warning ("Profiling support is not available on this system.");
FYI,
that should error().
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Fix a goof in the profiling code
2003-01-27 19:36 ` Andrew Cagney
@ 2003-01-27 20:26 ` Daniel Jacobowitz
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2003-01-27 20:26 UTC (permalink / raw)
To: gdb-patches
On Mon, Jan 27, 2003 at 02:36:25PM -0500, Andrew Cagney wrote:
> >+ warning ("Profiling support is not available on this system.");
>
> FYI,
>
> that should error().
I thought about this at the time and settled on warning, but my
reasoning was pretty bogus now that I think about it. OK, changed.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2003-01-27 Daniel Jacobowitz <drow@mvista.com>
* maint.c [! (HAVE_MONSTARTUP && HAVE__MCLEANUP)]
(maintenance_set_profile_cmd): Use error () instead of warning ().
Index: maint.c
===================================================================
RCS file: /cvs/src/src/gdb/maint.c,v
retrieving revision 1.32
diff -u -p -r1.32 maint.c
--- maint.c 27 Jan 2003 14:36:56 -0000 1.32
+++ maint.c 27 Jan 2003 20:25:14 -0000
@@ -692,7 +692,7 @@ maintenance_set_profile_cmd (char *args,
static void
maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c)
{
- warning ("Profiling support is not available on this system.");
+ error ("Profiling support is not available on this system.");
}
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-01-27 20:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-27 14:38 Fix a goof in the profiling code Daniel Jacobowitz
2003-01-27 19:36 ` Andrew Cagney
2003-01-27 20:26 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox