Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jason-swarelist@molenda.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb-patches@sources.redhat.com, tromey@cygnus.com
Subject: Re: [RFA] patch to add 'maint profile-gdb' command
Date: Wed, 12 Sep 2001 07:42:00 -0000	[thread overview]
Message-ID: <20010912074141.A17732@shell17.ba.best.com> (raw)
In-Reply-To: <7263-Wed12Sep2001155646+0300-eliz@is.elta.co.il>

On Wed, Sep 12, 2001 at 03:56:46PM +0300, Eli Zaretskii wrote:

> No, I mean that a program _compiled_ with -pg, but linked _without_ -pg
> will not start profiling until it calls monstartup.  

Ah, OK.  I knew we were talking about different things somehow.

Don't you think we're going to get real portability headaches this
way? In some cases the mcount et al functions are provided by the
compiler, in some they might be in libc, in some they might be in
a profiling version of libc or in a separate gmon library altogether.

I think the gprof designers on all the systems out there would assume
that if you're compiling with -pg, you're linking with -pg.  Doing
it differently could easily mess up their assumptions.

All of this with monstartup() is only to avoid overwriting the
gmon.out file whenever you start a profiling gdb.  I don't think
it's worth the trouble.  A programmer who is compiling with
--enable-profiling is presumably clever enough to understand that
gmon.out must be moved aside if they don't want it overwritten.
Or he'll learn after the first time he has it overwritten.

If we were to add these monstartup() calls, we'd also have the
portability problems that I mentioned earlier.  Not all systems
that provide profiling and moncontrol() provide the monstartup()
call.  So we'd need an autoconf test to detect that, and we'd define
LD_FLAGS and a C preprocessor macros depending on the results of
that test.  And the documentation for all of this would be confusing.
"Your gmon.out file will be overwritten each time you execute gdb,
unless your system provides the monstartup() system call."




> I really don't see much point to
> > bothering wiith a check for moncontrol.  I suppose it means a gdb
> > developer who tries to enable profiling without the necessary
> > moncontrol() function will find out about his folly at configure-time
> > instead of link-time, but that's the only benefit I can see.
> 
> I think this benefit should not be disposed off too easily.  

OK, I'll add a check for moncontrol and repost the patch in the next day
or so.

J


  reply	other threads:[~2001-09-12  7:42 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-10  0:30 Jason Molenda
2001-09-10  8:48 ` Andrew Cagney
2001-09-10  8:58   ` Eli Zaretskii
2001-09-10  9:04     ` Andrew Cagney
2001-09-10 11:52   ` Jason Molenda
2001-09-10 13:43     ` Eli Zaretskii
2001-09-10 13:59       ` Jason Molenda
2001-09-11  0:38         ` Eli Zaretskii
     [not found]           ` <no.id>
1999-06-15 20:10             ` Missing routines: gdb/top.c John David Anglin
2001-09-11  1:37             ` [RFA] patch to add 'maint profile-gdb' command Jason Molenda
2001-09-11  1:57               ` Eli Zaretskii
2001-09-12  0:00             ` Jason Molenda
2001-09-12  6:00               ` Eli Zaretskii
2001-09-12  7:42                 ` Jason Molenda [this message]
2001-09-12  9:06                   ` Eli Zaretskii
2001-09-12 11:58                     ` Tom Tromey
2001-09-12 13:16                       ` Jason Molenda
2008-08-06 19:24             ` [patch] Don't set DT_HP_DEBUG_PRIVATE in solib-pa64.c John David Anglin
2008-08-06 19:49               ` Mark Kettenis
2008-08-06 20:09                 ` John David Anglin
2008-08-06 23:10                 ` John David Anglin
2008-08-07 21:39               ` [patch] Only force private mapping of shared libraries in solib-som.c on HP-UX 10 and earlier John David Anglin
2008-08-08 10:48                 ` Joel Brobecker
2008-08-08 15:34                   ` John David Anglin
2008-08-09 14:37                     ` Joel Brobecker
2008-08-09 18:59                       ` John David Anglin
2008-08-08 19:30             ` ttrace: Protocal error John David Anglin
2008-08-08 20:16               ` John David Anglin
2008-08-09 14:52                 ` Pedro Alves
2008-08-09 15:34                   ` John David Anglin
2008-08-09 18:49                   ` John David Anglin
2008-08-09 22:45                     ` Pedro Alves
2008-08-09 22:46                   ` Pedro Alves
2008-08-09 22:51                     ` Pedro Alves
2008-08-09 23:19                       ` John David Anglin
2008-08-09 22:48                   ` Pedro Alves
2008-08-09 14:53                 ` Joel Brobecker
2008-08-09 23:40             ` John David Anglin
2008-08-10  0:46             ` [4/7] Adjust the ttrace target (HP-UX) to always register the John David Anglin
2008-09-15  2:08             ` [PATCH] Fix dwarf register column to gdb register mapping John David Anglin
2008-09-15  2:24             ` [PATCH] Fix hppa_linux_sigtramp_frame_unwind_cache John David Anglin
2001-09-12 11:28     ` [RFA] patch to add 'maint profile-gdb' command Andrew Cagney
2001-09-12 11:43     ` Andrew Cagney
2001-09-16 17:45       ` [RFA] Version 2 of " Jason Molenda
2001-09-17 22:39         ` Andrew Cagney
2001-09-18 17:52           ` Fernando Nasser
2001-09-18 17:56             ` Andrew Cagney
2001-09-19  7:11               ` Fernando Nasser
2001-09-19  7:28                 ` Eli Zaretskii
2001-09-19  9:29                   ` Fernando Nasser
2001-09-19 11:30                     ` Eli Zaretskii
2001-09-19 11:41                     ` Andrew Cagney
2001-09-19 11:53                     ` Kevin Buettner
     [not found]         ` <200109170536.HAA21988@is.elta.co.il>
2001-09-17 15:08           ` Michael Snyder
2001-09-17 22:43           ` Andrew Cagney
2001-09-17 23:59             ` Eli Zaretskii
2001-09-24 13:33               ` Jason Molenda
2001-09-24 14:41                 ` Andrew Cagney
2001-09-24 14:58                   ` Eli Zaretskii
2001-09-24 15:13                     ` Andrew Cagney
2001-09-24 14:53                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010912074141.A17732@shell17.ba.best.com \
    --to=jason-swarelist@molenda.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=tromey@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox