Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] patch to add 'maint profile-gdb' command
@ 2001-09-10  0:30 Jason Molenda
  2001-09-10  8:48 ` Andrew Cagney
  0 siblings, 1 reply; 64+ messages in thread
From: Jason Molenda @ 2001-09-10  0:30 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This is a refresh of Tom Tromey's gdb profiling patch, originally here:
	http://sources.redhat.com/ml/gdb-patches/2000-q1/msg00022.html

Instead of profiling all of gdb, Tom's patch lets you profile a
specific command (or commands).  You enable profiling with the
'maint profile-gdb on' before the command(s) of interest, and
'maint profile-gdb off' (or exit) when you're finished.

configure and config.in both need to be regenerated after applying
this patch.  Your build must be compiled with --enable-profiling
for this feature to be enabled.

My only comments on this patch are (1) the documentation entry
could note that your gmon.out file will be overwritten each time
gdb is started, even if you don't do a profile-gdb on command[1], and
(2) the configure.in check for $enable_profiling could be embedded
in the AC_ARG_ENABLE() autoconf call.  It doesn't make any practical
difference, but it looks like tradition in gdb's configure.in is
to include this code inside the AC_ARG_ENABLE call.

 [1]  A bit of profiling happens before it can be turned
      off in captured_main().  This initial profiling will overwrite
      away any existing gmon.out.  At least it does with the gprof
      on Linux and FreeBSD systems.

No testsuite regressions are added with this patch.

This patch does not require approval for the 5.1 branch - it is
not something end users have cause to enable.

This patch does add a couple of ifdefs in main.c, aint.c to guard
the code, but this is necessary.  Obviously you can't compile in
profiling all the time (performance, portability), and you can't
make calls to the profiling system calls if you aren't compiling
-pg.

Jason
From jason-swarelist@molenda.com Mon Sep 10 00:36:00 2001
From: Jason Molenda <jason-swarelist@molenda.com>
To: gdb-patches@sources.redhat.com
Subject: Typeo in NEWS
Date: Mon, 10 Sep 2001 00:36:00 -0000
Message-id: <20010910003611.A22499@shell17.ba.best.com>
X-SW-Source: 2001-09/msg00126.html
Content-length: 249

The NEWS file claims that gdb's code has been converted to "ANS/ISO C".
It should either be "ANSI/ISO C", or more correctly, just "ISO C".  

I won't argue strenuously for "ISO" over "ANSI/ISO", but the patch
I'm including implements the latter.

J
From eliz@is.elta.co.il Mon Sep 10 00:50:00 2001
From: Eli Zaretskii <eliz@is.elta.co.il>
To: Jason Molenda <jason-swarelist@molenda.com>
Cc: gdb-patches@sources.redhat.com, Tom Tromey <tromey@cygnus.com>
Subject: Re: [RFA] patch to add 'maint profile-gdb' command
Date: Mon, 10 Sep 2001 00:50:00 -0000
Message-id: <Pine.SUN.3.91.1010910094003.18194H-100000@is>
References: <20010910003022.A21681@shell17.ba.best.com>
X-SW-Source: 2001-09/msg00127.html
Content-length: 1698

On Mon, 10 Sep 2001, Jason Molenda wrote:

> This is a refresh of Tom Tromey's gdb profiling patch, originally here:
> 	http://sources.redhat.com/ml/gdb-patches/2000-q1/msg00022.html

Thanks!  I think it's a very useful feature, but I have a few minor 
comments.

> My only comments on this patch are (1) the documentation entry
> could note that your gmon.out file will be overwritten each time
> gdb is started, even if you don't do a profile-gdb on command[1], and
> (2) the configure.in check for $enable_profiling could be embedded
> in the AC_ARG_ENABLE() autoconf call.  It doesn't make any practical
> difference, but it looks like tradition in gdb's configure.in is
> to include this code inside the AC_ARG_ENABLE call.
> 
>  [1]  A bit of profiling happens before it can be turned
>       off in captured_main().  This initial profiling will overwrite
>       away any existing gmon.out.  At least it does with the gprof
>       on Linux and FreeBSD systems.

Isn't it better to use monstartup instead of moncontrol and -pg?  It 
looks like using monstartup could solve several problems:

  - you don't overwrite gmon.out unless you actually profile
  - you can link without -pg
  - you can make this option available by default, since it is invisible 
    unless you actually profile (I dislike features that require a 
    rebuild to become available)

We will have to add Autoconf tests to see if monstartup is available, but 
I think using moncontrol if --enable-profiling is given is not safe 
enough anyway.

In addition, I think the commands this patch adds should be documented in 
gdb.texinfo as well, since all commands one can type at GDB's prompt 
should be described there.


^ permalink raw reply	[flat|nested] 64+ messages in thread
* [PATCH] Fix hppa_linux_sigtramp_frame_unwind_cache
@ 2008-09-13 23:58 John David Anglin
  2008-09-14  2:44 ` Randolph Chung
  0 siblings, 1 reply; 64+ messages in thread
From: John David Anglin @ 2008-09-13 23:58 UTC (permalink / raw)
  To: gdb-patches; +Cc: randolph

The main fix in this patch is to remove the pad increment of scptr.  As
far as I know, there is no pad field in the sigcontext struct between the
general registers and the floating point registers.

I also recorded the PSW and SAR registers.  It might be a mistake to record
the PSW value, but I believe the SAR register definitely needs to be recorded.

Somewhat tested on hppa-linux but the gdb testsuite crashes 2.6.19.22.

Ok?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2008-09-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Record
	HPPA_IPSW_REGNUM and HPPA_SAR_REGNUM values.  Remove pad increment.

Index: hppa-linux-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v
retrieving revision 1.31
diff -u -3 -p -r1.31 hppa-linux-tdep.c
--- hppa-linux-tdep.c	21 Aug 2008 13:19:18 -0000	1.31
+++ hppa-linux-tdep.c	13 Sep 2008 22:51:35 -0000
@@ -227,7 +229,8 @@ hppa_linux_sigtramp_frame_unwind_cache (
   /* Skip sc_flags.  */
   scptr += 4;
 
-  /* GR[0] is the psw, we don't restore that.  */
+  /* GR[0] is the psw.  */
+  info->saved_regs[HPPA_IPSW_REGNUM].addr = scptr;
   scptr += 4;
 
   /* General registers.  */
@@ -237,9 +240,6 @@ hppa_linux_sigtramp_frame_unwind_cache (
       scptr += 4;
     }
 
-  /* Pad.  */
-  scptr += 4;
-
   /* FP regs; FP0-3 are not restored.  */
   scptr += (8 * 4);
 
@@ -262,6 +262,9 @@ hppa_linux_sigtramp_frame_unwind_cache (
   info->saved_regs[HPPA_PCOQ_TAIL_REGNUM].addr = scptr;
   scptr += 4;
 
+  info->saved_regs[HPPA_SAR_REGNUM].addr = scptr;
+  scptr += 4;
+
   info->base = get_frame_register_unsigned (this_frame, HPPA_SP_REGNUM);
 
   return info;


^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2008-09-15  2:24 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-10  0:30 [RFA] patch to add 'maint profile-gdb' command 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
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
     [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
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
2008-09-13 23:58 [PATCH] Fix hppa_linux_sigtramp_frame_unwind_cache John David Anglin
2008-09-14  2:44 ` Randolph Chung
2008-09-14  3:47   ` John David Anglin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox