From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15436 invoked by alias); 14 Mar 2015 09:40:02 -0000 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 Received: (qmail 15427 invoked by uid 89); 14 Mar 2015 09:40:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Mar 2015 09:40:00 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NL7009003UMGV00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Sat, 14 Mar 2015 11:39:56 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NL7009EH46JGL20@a-mtaout20.012.net.il>; Sat, 14 Mar 2015 11:39:56 +0200 (IST) Date: Sat, 14 Mar 2015 09:40:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH v2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902) In-reply-to: <87r3stnbdw.fsf@redhat.com> To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org, jan.kratochvil@redhat.com, palves@redhat.com, oleg@redhat.com Reply-to: Eli Zaretskii Message-id: <83a8zf3ok3.fsf@gnu.org> References: <878ufc9kau.fsf@redhat.com> <87r3stnbdw.fsf@redhat.com> X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00416.txt.bz2 > From: Sergio Durigan Junior > Cc: Jan Kratochvil , Pedro Alves , Oleg Nesterov > Date: Thu, 12 Mar 2015 17:39:39 -0400 > > +On @sc{gnu}/Linux, this command can take into account the value of the > +file @file{/proc/@var{pid}/coredump_filter} when generating the core > +dump (@pxref{set use-coredump-filter}). You never explain what @var{pid} is, until you get to the example. I think we should tell that earlier. > +To make use of this feature, you have to write in the > +@file{/proc/@var{pid}/coredump_filter} file a value, in hexadecimal, > +which is a bit mask representing the memory mapping types. If a bit > +is set in the bit mask, then the memory mappings of the corresponding > +types will be dumped; otherwise, they will be ignored. The bits in > +this bit mask have the following meanings: > + > +@table @code > +@item bit 0 > +Dump anonymous private mappings. > +@item bit 1 > +Dump anonymous shared mappings. > +@item bit 2 > +Dump file-backed private mappings. > +@item bit 3 > +Dump file-backed shared mappings. > +@item bit 4 > +(since Linux 2.6.24) > +Dump ELF headers. (@value{GDBN} does not take this bit into account) > +@item bit 5 > +(since Linux 2.6.28) > +Dump private huge pages. > +@item bit 6 > +(since Linux 2.6.28) > +Dump shared huge pages. > +@end table > + > +For example, supposing that the @code{pid} of the program being > +debugging is @code{1234}, if you wanted to dump everything except the > +anonymous private and the file-backed shared mappings, you would do: > + > +@smallexample > +$ echo 0x76 > /proc/1234/coredump_filter > +@end smallexample > + > +For more documentation about how to use the @file{coredump_filter} > +file, see the manpage of @code{proc(5)}. I don't think we should repeat all that information here, we should just refer to the man page you cite, possibly also telling what section of that page to look in. Thanks.