Re: [RFA] Version 2 of patch to add 'maint profile-gdb' command

Jason Molenda
2001-09-24T13:33:00Z

Sorry for the delay following up, I was sidetracked by some other
things for a few days.

On Tue, Sep 18, 2001 at 09:51:16AM +0300, Eli Zaretskii wrote:

> > from emacs 20.7:
> >
> > > /* Gerd Moellmann <gerd@acm.org> 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. */
> [...]
> > I get the feeling that this is work in progress.
>
> This file is almost 2 years old. Since then, this code was proven to
> run unmodified on quite a few platforms.

I'm a little hesitant to use this emacs code... besides having an
#ifdef FreeBSD around it, it uses the address of a certain function
for the beginning of the text section -- hardcoded. So unless
someone can guess which one of gdb's functions is going to end up
at the beginning of .text, I don't see how that'd work.

It looks like emacs (in 20.7) is guarding all of these calls to
monstartup() and moncontrol() with #ifdef PROFILING.

I don't follow emacs development at all, so it's possible the
development sources are significantly different.

> Anyway, I don't want to continue arguing about this.

I appreciate the time you're taking with this. Okay, I would have
been happier if someone had just said "Approved!" and it had gone
in immediately :-), but it'll be a better patch by the time it does
get committed.

> As long as you
> know that the problems Jason raised can be solved with simple and
> quite portable code, all the rest is your judgement call.

I'm willing to believe that there are portable ways to do everything
we're talking about, but _I_ don't know them, and the emacs 20.7 code
doesn't show any examples of this...

I'll be updating the profiling patch and sending it again soon.

Jason