From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3283 invoked by alias); 25 Apr 2011 07:42:02 -0000 Received: (qmail 3267 invoked by uid 22791); 25 Apr 2011 07:42:00 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 07:41:43 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3P7fgOc027686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 25 Apr 2011 03:41:43 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p3P7feqY004935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 25 Apr 2011 03:41:42 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p3P7fek8005962 for ; Mon, 25 Apr 2011 09:41:40 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p3P7fd2d005957 for gdb-patches@sourceware.org; Mon, 25 Apr 2011 09:41:39 +0200 Date: Mon, 25 Apr 2011 07:42:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch] gdb_gcore man/help/install [+doc] Message-ID: <20110425074138.GA5408@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00436.txt.bz2 Hi, gcore does not have man page, does not have "-h" help option https://bugzilla.redhat.com/show_bug.cgi?id=697482 - by Steve Tyler The ".1.z" rule seems bogus to me, I have found these entries for it: Wed Nov 13 19:51:11 1991 Steve Chamberlain (sac at cygnus.com) * Makefile.in, xconfig/delta88 made it install a sysV manual page; gdb.z into the right place. Tue Oct 5 15:26:04 1993 Jim Kingdon (kingdon@lioth.cygnus.com) * config/m88k/{delta88.mh,delta88v4.mh}: Remove M_INSTALL and M_UNINSTALL; it tries to install a non-existent file gdb.z. I would prefer to just remove it. The only /usr/bin/pack I have is from allegro which even has a different commandline syntax. Thanks, Jan gdb/ 2011-04-25 Jan Kratochvil * Makefile.in (INSTALL_SCRIPT): New. (gdb.z): Rename to ... (.1.z): ... here and generalize it. (install-only): Install also gdb_gcore.sh and gdb_gcore.1. (uninstall): Uninstall also gcore and gcore.1. * gdb_gcore.1: New file. * gdb_gcore.sh: Support also -h and --help. Document multiple PIDs. --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -59,6 +59,7 @@ LN_S = @LN_S@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ DESTDIR = @@ -991,10 +992,10 @@ check//%: force info install-info clean-info dvi pdf install-pdf html install-html: force @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do -gdb.z:gdb.1 - nroff -man $(srcdir)/gdb.1 | col -b > gdb.t - pack gdb.t ; rm -f gdb.t - mv gdb.t.z gdb.z +.1.z: + nroff -man $< | col -b > $@.t + pack $@.t ; rm -f $@.t + mv $@.t.z $@ # Traditionally "install" depends on "all". But it may be useful # not to; for example, if the user has made some trivial change to a @@ -1019,6 +1020,20 @@ install-only: $(CONFIG_INSTALL) $(DESTDIR)$(man1dir) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 \ $(DESTDIR)$(man1dir)/$$transformed_name.1 + transformed_name=`t='$(program_transform_name)'; \ + echo gcore | sed -e "$$t"` ; \ + if test "x$$transformed_name" = x; then \ + transformed_name=gcore ; \ + else \ + true ; \ + fi ; \ + $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \ + $(INSTALL_SCRIPT) $(srcdir)/gdb_gcore.sh \ + $(DESTDIR)$(bindir)/$$transformed_name ; \ + $(SHELL) $(srcdir)/../mkinstalldirs \ + $(DESTDIR)$(man1dir) ; \ + $(INSTALL_DATA) $(srcdir)/gdb_gcore.1 \ + $(DESTDIR)$(man1dir)/$$transformed_name.1 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do .PHONY: install-tui install-tui: @@ -1050,6 +1065,15 @@ uninstall: force $(CONFIG_UNINSTALL) fi ; \ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ $(DESTDIR)$(man1dir)/$$transformed_name.1 + transformed_name=`t='$(program_transform_name)'; \ + echo gcore | sed -e $$t` ; \ + if test "x$$transformed_name" = x; then \ + transformed_name=gcore ; \ + else \ + true ; \ + fi ; \ + rm -f $(DESTDIR)$(bindir)/$$transformed_name \ + $(DESTDIR)$(man1dir)/$$transformed_name.1 @$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do .PHONY: uninstall-tui uninstall-tui: --- /dev/null +++ b/gdb/gdb_gcore.1 @@ -0,0 +1,45 @@ +.\" +.\" gcore manual page. +.\" Copyright (c) 2011 Red Hat, Inc. +.\" +.\" This program is free software; you can redistribute it and/or modify +.\" it under the terms of the GNU General Public License as published by +.\" the Free Software Foundation; either version 2, or (at your option) +.\" any later version. +.\" +.\" This program is distributed in the hope that it will be useful, +.\" but WITHOUT ANY WARRANTY; without even the implied warranty of +.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +.\" GNU General Public License for more details. +.\" +.\" You should have received a copy of the GNU General Public License +.\" along with this program; see the file COPYING. If not, write to +.\" the Free Software Foundation, 59 Temple Place - Suite 330, +.\" Boston, MA 02111-1307, USA. +.\" +.TH GCORE 1 "Apr 25 2011" "Red Hat Linux" "Linux Programmer's Manual" + +.SH NAME +gcore \- generate a core file of a running program + +.SH SYNOPSIS +.B gcore +[-o \fIfilename\fR] \fIPID1\fR [\fIPID2\fR...] + +.SH DESCRIPTION +.PP +\f3gcore\f1 starts up \fBgdb\fR, attaches to the given \fIPID\fR and invokes the +gcore command dumping the cores into files core.\fIPID1\fR, core.\fIPID2\fR +etc. The programs being dumped remain running unaffected, except for being +stopped for a short time during the dump. + +.SH OPTIONS +.TP +\fB\-o\fR \fIfilename\fR +Alternative core files base name from the default "core". + +.SH SEE ALSO +gdb(1) + +.SH AUTHORS +Jan Kratochvil --- a/gdb/gdb_gcore.sh +++ b/gdb/gdb_gcore.sh @@ -22,9 +22,9 @@ # It starts up gdb, attaches to the given PID and invokes the gcore command. # -if [ "$#" -eq "0" ] +if [ "$#" -eq "0" -o "$1" = "-h" -o "$1" = "--help" ] then - echo "usage: gcore [-o filename] pid" + echo "usage: gcore [-o filename] pid1 [pid2...]" exit 2 fi