public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902)
@ 2015-03-24 23:57 Sergio Durigan Junior
  2015-03-24 23:57 ` [PATCH 1/2] Implement support for checking /proc/PID/coredump_filter Sergio Durigan Junior
  2015-03-24 23:57 ` [PATCH 2/2] Documentation and testcase Sergio Durigan Junior
  0 siblings, 2 replies; 15+ messages in thread
From: Sergio Durigan Junior @ 2015-03-24 23:57 UTC (permalink / raw)
  To: GDB Patches; +Cc: Pedro Alves, Sergio Durigan Junior

Hello,

This is the fifth version of this patch series.  It basically includes
fixes to make GDB mimic the Linux kernel's behavior when dealing with
"file-backed mappings with anonymous pages".  As explained on:

  <https://sourceware.org/ml/gdb-patches/2015-03/msg00814.html>

in this situation, the Linux kernel dumps this "special" mapping both
when the user has requested file-backed or anonymous mappings to be
included in the corefile.  Now, GDB does the same thing.

The patch also extends the testcase in order to make sure that,
depending on the type of the corefile we are dealing with, we can or
cannot disassemble a section of the code without loading a binary.  The
approach I took for this is:

  - For corefiles that include the file-backed mappings, GDB should be
    able to disassemble.

  - For corefiles that do not include file-backed nor anonymous
    mappings, GDB should not be able to disassemble.

It was necessary to "relax" the second test because, as explained in the
message linked above, when you load a binary inside GDB its .text
segment contains anonymous pages, so if you ask for a corefile without
file-backed mappings (which, in theory, should exclude the .text
segment), GDB will still include the .text segment because this kind of
mapping is *also* considered an anonymous mapping (the Linux kernel does
the same thing here).

Other than that, the code is the same.  The documentation has been
approved already, but I am including a NEWS entry this time (I wasn't
sure if it was worth it or not, so I decided to go ahead and do it).

OK to apply?

Sergio Durigan Junior (2):
  Implement support for checking /proc/PID/coredump_filter
  Documentation and testcase

 gdb/doc/gdb.texinfo                        |  33 +++
 gdb/linux-tdep.c                           | 455 +++++++++++++++++++++++++++--
 gdb/testsuite/gdb.base/coredump-filter.c   |  61 ++++
 gdb/testsuite/gdb.base/coredump-filter.exp | 198 +++++++++++++
 4 files changed, 719 insertions(+), 28 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/coredump-filter.c
 create mode 100644 gdb/testsuite/gdb.base/coredump-filter.exp

-- 
1.9.3

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

end of thread, other threads:[~2015-04-08 17:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 23:57 [PATCH v4 0/2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902) Sergio Durigan Junior
2015-03-24 23:57 ` [PATCH 1/2] Implement support for checking /proc/PID/coredump_filter Sergio Durigan Junior
2015-03-27  9:53   ` Pedro Alves
2015-03-31 23:40     ` Sergio Durigan Junior
2015-04-08 14:08       ` Build failure following: Implement support for checking /proc/PID/coredump_filter commit Pierre Muller
2015-04-08 14:43         ` Pedro Alves
2015-04-08 15:14           ` Pedro Alves
2015-04-08 16:08             ` Sergio Durigan Junior
2015-04-08 16:28             ` Pierre Muller
2015-04-08 16:47               ` Sergio Durigan Junior
2015-04-08 17:21                 ` Pedro Alves
2015-04-08 16:27           ` Yao Qi
2015-04-08 16:47             ` Pedro Alves
2015-03-24 23:57 ` [PATCH 2/2] Documentation and testcase Sergio Durigan Junior
2015-03-27  9:53   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).