This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902)

Thanks for the review, Eli.

On Saturday, March 14 2015, Eli Zaretskii wrote:

>> 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.

My very first personal version of the patch did not have this table
here, and was just mentioning the man page, as you proposed.  However,
because man pages are not the official GNU documentation format, I
decided to include a "bit" more info here.

Either, I don't have a strong preference.  I will mention the man page.

I am not sending a fixed version of the patch in this message because I
am still working on Pedro's comments.  When I reply to his e-mail, the
attached patch will include your suggestions as well.


GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]