mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
* configure.in: Add check for _etext.
* maint.c (maintenance_set_profile_cmd): Use etext if _etext isn't available. * config.in, configure: regenerated.
This commit is contained in:
parent
8f05cde5d3
commit
b0b1c2c0eb
@ -1,3 +1,10 @@
|
||||
2003-02-14 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* configure.in: Add check for _etext.
|
||||
* maint.c (maintenance_set_profile_cmd): Use etext if _etext isn't
|
||||
available.
|
||||
* config.in, configure: regenerated.
|
||||
|
||||
2003-02-14 Daniel Jacobowitz <drow@mvista.com>
|
||||
|
||||
* dwarf2read.c (dwarf2_get_pc_bounds): Offset addresses by base.
|
||||
|
@ -431,6 +431,9 @@
|
||||
/* Define to BFD's default target vector. */
|
||||
#undef DEFAULT_BFD_VEC
|
||||
|
||||
/* Define to 1 if your system has the _etext variable. */
|
||||
#undef HAVE__ETEXT
|
||||
|
||||
/* Define to 1 to avoid a clash between <widec.h> and <wchar.h> on
|
||||
Solaris 2.[78] when using GCC. */
|
||||
#undef _MSE_INT_H
|
||||
|
812
gdb/configure
vendored
812
gdb/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -204,6 +204,16 @@ AC_ARG_ENABLE(profiling,
|
||||
[enable_profiling=no])
|
||||
|
||||
AC_CHECK_FUNCS(monstartup _mcleanup)
|
||||
AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
|
||||
[AC_TRY_LINK(
|
||||
[#include <stdlib.h>
|
||||
extern char _etext;
|
||||
],
|
||||
[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
|
||||
if test $ac_cv_var__etext = yes; then
|
||||
AC_DEFINE(HAVE__ETEXT, 1,
|
||||
[Define to 1 if your system has the _etext variable. ])
|
||||
fi
|
||||
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)
|
||||
|
11
gdb/maint.c
11
gdb/maint.c
@ -645,6 +645,14 @@ static int maintenance_profile_p;
|
||||
|
||||
#if defined (HAVE_MONSTARTUP) && defined (HAVE__MCLEANUP)
|
||||
|
||||
#ifdef HAVE__ETEXT
|
||||
extern char _etext;
|
||||
#define TEXTEND &_etext
|
||||
#else
|
||||
extern char etext;
|
||||
#define TEXTEND &etext
|
||||
#endif
|
||||
|
||||
static int profiling_state;
|
||||
|
||||
static void
|
||||
@ -669,7 +677,6 @@ maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *
|
||||
static int profiling_initialized;
|
||||
|
||||
extern void monstartup (unsigned long, unsigned long);
|
||||
extern char _etext;
|
||||
extern int main();
|
||||
|
||||
if (!profiling_initialized)
|
||||
@ -680,7 +687,7 @@ maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *
|
||||
|
||||
/* "main" is now always the first function in the text segment, so use
|
||||
its address for monstartup. */
|
||||
monstartup ((unsigned long) &main, (unsigned long) &_etext);
|
||||
monstartup ((unsigned long) &main, (unsigned long) TEXTEND);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user