This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902)
- From: Pedro Alves <palves at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, Oleg Nesterov <oleg at redhat dot com>
- Date: Wed, 18 Mar 2015 19:10:23 +0000
- Subject: Re: [PATCH v2] Improve corefile generation by using /proc/PID/coredump_filter (PR corefile/16902)
- Authentication-results: sourceware.org; auth=none
- References: <878ufc9kau dot fsf at redhat dot com> <87r3stnbdw dot fsf at redhat dot com> <55033BD3 dot 8060800 at redhat dot com> <871tko8pom dot fsf at redhat dot com>
On 03/16/2015 11:53 PM, Sergio Durigan Junior wrote:
> To summarize: I decided to change this part of the code, and make GDB
> actually ignore (i.e., return 0) mappings marked as UNMODIFIED. After
> all, as explained above, this is what Linux does.
I can't tell whether we'll still need the UNKNOWN state after that,
but offhand, if a mapping isn't supposed to be dumped, why not
just skip calling the callback (gcore_create_callback)?
>
>>
>>> +
>>> +foreach item $all_corefiles {
>>> + foreach name [list [lindex $item 3] [lindex $item 4]] {
>>> + set test "print/x $name"
>>> + gdb_test_multiple $test $test {
>>> + -re " = \($hex\)\r\n$gdb_prompt $" {
>>> + set addr($name) $expect_out(1,string)
>>
>> I'm probably being dense, but I can't see where is addr
>> ever used?
>
> 'addr' is an associative array that maps variable names to addresses.
> This is needed because sometimes (depending on which pags we
> dump/ignore), the stack is not dumped and GDB would not be able to find
> the variable names; therefore, this dependency is removed here.
Ah, it's used in do_load_and_test_core. Somehow missed that the first
time.
> I will not send the full patch again because I intend to split it into
> minor, more logical patches. I should be able to send it later
> today/tomorrow.
Thanks,
Pedro Alves