Original patch by Tom Tromey <tromey@cygnus.com> and

Jason Molenda <jmolenda@apple.com>.
	* Makefile.in (PROFILE_CFLAGS): Substitute from configure.
	(INTERNAL_LDFLAGS): Don't include PROFILE_CFLAGS.
	* NEWS: Mention profiling.
	* configure.in (--enable-gdbtk): Fix typo.
	(--enable-profiling): New.  Set PROFILE_CFLAGS.
	* maint.c (maintenance_set_profile_cmd): Remove NOTYET.
	Fill in function.
	(profiling_state): New variable.
	(mcleanup_wrapper): New function.
	(_initialize_maint): Remove NOTYET, fix call to
	add_setshow_boolean_cmd for "maint set profile".
	* configure: Regenerated.
This commit is contained in:
Daniel Jacobowitz 2003-01-22 23:50:35 +00:00
parent e7ba9c6584
commit d28f9cdffd
6 changed files with 728 additions and 518 deletions

View file

@ -1,3 +1,20 @@
2003-01-22 Daniel Jacobowitz <drow@mvista.com>
Original patch by Tom Tromey <tromey@cygnus.com> and
Jason Molenda <jmolenda@apple.com>.
* Makefile.in (PROFILE_CFLAGS): Substitute from configure.
(INTERNAL_LDFLAGS): Don't include PROFILE_CFLAGS.
* NEWS: Mention profiling.
* configure.in (--enable-gdbtk): Fix typo.
(--enable-profiling): New. Set PROFILE_CFLAGS.
* maint.c (maintenance_set_profile_cmd): Remove NOTYET.
Fill in function.
(profiling_state): New variable.
(mcleanup_wrapper): New function.
(_initialize_maint): Remove NOTYET, fix call to
add_setshow_boolean_cmd for "maint set profile".
* configure: Regenerated.
2003-01-21 Martin M. Hunt <hunt@redhat.com>
* Makefile.in (install-gdbtk): Install PNG images too.

View file

@ -322,7 +322,8 @@ GDB_CFLAGS = -I. -I$(srcdir) -I$(srcdir)/config -DLOCALEDIR="\"$(prefix)/share/l
# M{H,T}_CFLAGS, if defined, have host- and target-dependent CFLAGS
# from the config directory.
GLOBAL_CFLAGS = $(MT_CFLAGS) $(MH_CFLAGS)
#PROFILE_CFLAGS = -pg
PROFILE_CFLAGS = @PROFILE_CFLAGS@
# CFLAGS is specifically reserved for setting from the command line
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
@ -349,7 +350,8 @@ LDFLAGS = @LDFLAGS@
# Profiling options need to go here to work.
# I think it's perfectly reasonable for a user to set -pg in CFLAGS
# and have it work; that's why CFLAGS is here.
INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(PROFILE_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS)
# PROFILE_CFLAGS is _not_ included, however, because we use monstartup.
INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CFLAGS) $(MH_LDFLAGS) $(LDFLAGS) $(CONFIG_LDFLAGS)
# If your system is missing alloca(), or, more likely, it's there but
# it doesn't work, then refer to libiberty.

View file

@ -3,6 +3,14 @@
*** Changes since GDB 5.3:
* Profiling support
A new command, "maint set profile on/off", has been added. This command can
be used to enable or disable profiling while running GDB, to profile a
session or a set of commands. In addition there is a new configure switch,
"--enable-profiling", which will cause GDB to be compiled with profiling
data, for more informative profiling results.
* Default MI syntax changed to "mi2".
The default MI (machine interface) syntax, enabled by the command line

1123
gdb/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -164,7 +164,7 @@ fi
# Enable gdbtk.
AC_ARG_ENABLE(gdbtk,
[ --enable-gtk enable gdbtk graphical user interface (GUI)],
[ --enable-gdbtk enable gdbtk graphical user interface (GUI)],
[case $enableval in
yes | no)
;;
@ -183,6 +183,31 @@ case $host_os in
enable_gdbtk=no ;;
esac
# Profiling support.
AC_ARG_ENABLE(profiling,
[ --enable-profiling enable profiling of GDB],
[case $enableval in
yes | no)
;;
*)
AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
esac],
[enable_profiling=no])
if test "$enable_profiling" = yes ; then
PROFILE_CFLAGS=-pg
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PROFILE_CFLAGS"
AC_CHECK_FUNC(monstartup, [],
AC_MSG_ERROR(monstartup necessary to use --enable-profiling.))
AC_CHECK_FUNC(_mcleanup, [],
AC_MSG_ERROR(_mcleanup necessary to use --enable-profiling.))
CFLAGS="$OLD_CFLAGS"
fi
# --------------------- #
# Checks for programs. #
# --------------------- #
@ -1164,6 +1189,7 @@ AC_SUBST(IGNORE_SIM)
AC_SUBST(IGNORE_SIM_OBS)
AC_SUBST(ENABLE_CFLAGS)
AC_SUBST(PROFILE_CFLAGS)
AC_SUBST(CONFIG_OBS)
AC_SUBST(CONFIG_LIB_OBS)

View file

@ -1,5 +1,5 @@
/* Support for GDB maintenance commands.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
@ -639,18 +639,52 @@ maintenance_show_cmd (char *args, int from_tty)
cmd_show_list (maintenance_show_cmdlist, from_tty, "");
}
#ifdef NOTYET
/* Profiling support. */
static int maintenance_profile_p;
static int profiling_state;
static void
mcleanup_wrapper (void)
{
extern void _mcleanup (void);
if (profiling_state)
_mcleanup ();
}
static void
maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *c)
{
maintenance_profile_p = 0;
warning ("\"maintenance set profile\" command not supported.\n");
if (maintenance_profile_p == profiling_state)
return;
profiling_state = maintenance_profile_p;
if (maintenance_profile_p)
{
static int profiling_initialized;
extern void monstartup (unsigned long, unsigned long);
extern char _etext;
extern int main();
if (!profiling_initialized)
{
atexit (mcleanup_wrapper);
profiling_initialized = 1;
}
/* "main" is now always the first function in the text segment, so use
its address for monstartup. */
monstartup ((unsigned long) &main, (unsigned long) &_etext);
}
else
{
extern void _mcleanup (void);
_mcleanup ();
}
}
#endif
void
_initialize_maint_cmds (void)
@ -807,16 +841,12 @@ passes without a response from the target, an error occurs.", &setlist),
&showlist);
#ifdef NOTYET
/* FIXME: cagney/2002-06-15: A patch implementing profiling is
pending, this just sets up the framework. */
tmpcmd = add_setshow_boolean_cmd ("profile", class_maintenance,
var_boolean, &maintenance_profile_p, "\
Set internal profiling.\n\
When enabled GDB is profiled.", "\
Show internal profiling.\n",
maintenance_set_profile_cmd, NULL,
&maintenance_set_cmdlist,
&maintenance_show_cmdlist);
#endif
add_setshow_boolean_cmd ("profile", class_maintenance,
&maintenance_profile_p,
"Set internal profiling.\n"
"When enabled GDB is profiled.",
"Show internal profiling.\n",
maintenance_set_profile_cmd, NULL,
&maintenance_set_cmdlist,
&maintenance_show_cmdlist);
}