From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>,
GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/4] Improve identification of memory mappings
Date: Thu, 19 Mar 2015 10:39:00 -0000 [thread overview]
Message-ID: <550AA753.7060609@redhat.com> (raw)
In-Reply-To: <1426707523-6499-2-git-send-email-sergiodj@redhat.com>
Thanks for splitting. It indeed makes it easier to understand
the changes.
On 03/18/2015 07:38 PM, Sergio Durigan Junior wrote:
> This commit implements the new 'enum memory_mapping_state', which can
> be used to represent the different states of each memory mapping from
> the inferior. These states are:
>
> - MODIFIED, which means that the mapping should be dumped in
> corefiles
>
> - UNMODIFIED, which means that the mapping should not be dumped in
> corefiles (e.g., mappings that have been marked as VM_DONTDUMP), and
>
> - UNKNOWN, which means that we don't know whether the mapping should
> or should not be dumped.
>
I'm sorry to push back on this, but it sounds to me that this is mixing
up orthogonal aspects.
For example, what if a mapping is indeed modified, but the tdep code
decides it should not be dumped? With this interface, you need to
"lie" and pass down UNMODIFIED.
And then, what if a mapping is definitely not modified, but the
tdep code decides it should dumped (e.g., say we could tell that the
vdso mapping really wasn't modified, but we still want to dump
it anyhow because there's no file on the filesystem to read the
vdso contents from later at core load time). With this interface,
you need to pass down either MODIFIED or UNKNOWN.
So it sounds to me that instead, the arch/target code that is walking
the memory mappings should just not call the "dump this mapping"
callback if it decides the mapping should not be dumped.
And if we do _that_ first, then, what other changes to
gcore_create_callback would be required to make it do what
we need?
This may need further discussion, but in any case, note that the
descriptions above of what each state means ...
> +/* Enum used to inform the state of a memory mapping. This is used in
> + functions implementing find_memory_region_ftype. */
> +
> +enum memory_mapping_state
> + {
> + MEMORY_MAPPING_MODIFIED,
> + MEMORY_MAPPING_UNMODIFIED,
> + MEMORY_MAPPING_UNKNOWN_STATE,
> + };
... should be here in the code.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-03-19 10:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 19:39 [PATCH v3 0/4] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902) Sergio Durigan Junior
2015-03-18 19:39 ` [PATCH 2/4] Update gcore_create_callback to better handle different states of mappings Sergio Durigan Junior
2015-03-19 10:39 ` Pedro Alves
2015-03-19 23:08 ` Sergio Durigan Junior
2015-03-18 19:39 ` [PATCH 3/4] Implement support for checking /proc/PID/coredump_filter Sergio Durigan Junior
2015-03-19 10:41 ` Pedro Alves
2015-03-19 23:09 ` Sergio Durigan Junior
2015-03-18 19:39 ` [PATCH 1/4] Improve identification of memory mappings Sergio Durigan Junior
2015-03-19 10:39 ` Pedro Alves [this message]
2015-03-19 23:07 ` Sergio Durigan Junior
2015-03-20 19:11 ` Pedro Alves
2015-03-20 20:14 ` Sergio Durigan Junior
2015-03-18 19:44 ` [PATCH 4/4] Documentation and testcase Sergio Durigan Junior
2015-03-18 20:08 ` Eli Zaretskii
2015-03-18 20:18 ` Sergio Durigan Junior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=550AA753.7060609@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox