From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Eli Zaretskii , jason-swarelist@molenda.com Cc: gdb-patches@sources.redhat.com, tromey@cygnus.com Subject: Re: [RFA] Version 2 of patch to add 'maint profile-gdb' command Date: Mon, 17 Sep 2001 22:43:00 -0000 Message-id: <3BA6DEE6.1020700@cygnus.com> References: <20010910003022.A21681@shell17.ba.best.com> <3B9CE0C6.5060700@cygnus.com> <20010910115244.A25119@shell17.ba.best.com> <3B9FACDA.6070407@cygnus.com> <20010916174433.A3258@shell17.ba.best.com> <200109170536.HAA21988@is.elta.co.il> X-SW-Source: 2001-09/msg00216.html > > Emacs uses monstartup and manages to solve both of these problems. > See the file src/emacs.c (search for "etext") for the details. from emacs 20.7: > /* Gerd Moellmann says this makes profiling work on > FreeBSD. It might work on some other systems too. > Give it a try and tell me if it works on your system. */ > #ifdef __FreeBSD__ > #ifdef PROFILING > if (initialized) > { > extern void _mcleanup (); > extern char etext; > extern Lisp_Object Fredraw_frame (); > atexit (_mcleanup); > /* This uses Fredraw_frame because that function > comes first in the Emacs executable. > It might be better to use something that gives > the start of the text segment, but start_of_text > is not defined on all systems now. */ > monstartup (Fredraw_frame, &etext); > } > else > moncontrol (0); > #endif > #endif I get the feeling that this is work in progress. I'd, for the moment, suggest using Jason's mechanism - it isn't perfect but it works. Someone can later make it more fancy. Andrew