This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] patch to add 'maint profile-gdb' command
On Mon, Sep 10, 2001 at 11:40:38PM +0300, Eli Zaretskii wrote:
> > I'd disagree. First, these functions are not very portable. Our
> > very own RH 6.2 box that is sourceware.cygnus.com does not have
> > moncontrol() or monstart(), and -pg doesn't seem to be usable at
> > all. My RH 7.1 box at home works fine. MacOS X's FreeBSD works
> > fine.
>
> We could autoconfiscate this, couldn't we?
We could detect whether moncontrol() exists or not, but there aren't
any macros specifically related to profiling in automake/autoconf.
I suppose we could have a test that would try to include a call to
moncontrol() and see if it causes a link-time error when not paired
with a -pg. I don't see the point -- without compiling the program
with -pg, running moncontrol() is pointless. You're going to have
an ifdef in main.c either way - either to check ENABLE_PROFILING
or check HAVE_MONCONTROL - and profiling is not going to work unless
you're specifically compiling gdb with profiling in mind.
> > I just re-read the man page, it doesn't matter where it's disabled. The
> > gmon.out file is going to be overwritten each time gdb is run no matter
> > what.
>
> Not if we use monstartup: the file is not touched unless monstartup is
> called.
monstartup provides some information, but not everything that full
profiling gets you. I think we should stick with linking -pg and
using moncontrol().
Jason