From: t cheney <cdmalord@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb <gdb@sourceware.org>,
linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk,
linux-fsdevel@vger.kernel.org, gdb-patches@sourceware.org,
binutils@sourceware.org
Subject: Re: [PATCH 1/1] x86: Add process memory layout to coredump file
Date: Sun, 18 Dec 2011 10:47:00 -0000 [thread overview]
Message-ID: <CAE04G=Bj+EsLbdrUDjvt3BfNee8TH-0ud2knc75JiRFKNfCvDg@mail.gmail.com> (raw)
In-Reply-To: <20111212210328.GA29248@host2.jankratochvil.net>
Thank your suggestion.
changed files:
./binutils-2.21.1/binutils/readelf.c
./binutils-2.21.1/include/elf/common.h
diff -u ./binutils-2.21.1/binutils/readelf.c
./binutils-2.21.1/binutils/readelf.c.orig
--- ./binutils-2.21.1/binutils/readelf.c 2011-12-07
14:54:45.000000000 -0500
+++ ./binutils-2.21.1/binutils/readelf.c.orig 2011-12-07
14:53:43.000000000 -0500
@@ -196,7 +196,6 @@
static int do_notes;
static int do_archive_index;
static int is_32bit_elf;
-static int do_maps;
struct group_list
{
@@ -3072,7 +3071,6 @@
{"dyn-syms", no_argument, 0, OPTION_DYN_SYMS},
{"relocs", no_argument, 0, 'r'},
{"notes", no_argument, 0, 'n'},
- {"maps", no_argument, 0, 'm'},
{"dynamic", no_argument, 0, 'd'},
{"arch-specific", no_argument, 0, 'A'},
{"version-info", no_argument, 0, 'V'},
@@ -3112,7 +3110,6 @@
--symbols An alias for --syms\n\
--dyn-syms Display the dynamic symbol table\n\
-n --notes Display the core notes (if present)\n\
- -m --maps Display the core maps (if present)\n\
-r --relocs Display the relocations (if present)\n\
-u --unwind Display the unwind info (if present)\n\
-d --dynamic Display the dynamic section (if present)\n\
@@ -3231,7 +3228,7 @@
usage (stderr);
while ((c = getopt_long
- (argc, argv, "ADHINR:SVWacdeghi:lnp:rstuvw::x:m", options,
NULL)) != EOF)
+ (argc, argv, "ADHINR:SVWacdeghi:lnp:rstuvw::x:", options,
NULL)) != EOF)
{
switch (c)
{
@@ -3354,9 +3351,6 @@
case 'W':
do_wide++;
break;
- case 'm':
- do_maps++;
- break;
default:
/* xgettext:c-format */
error (_("Invalid option '-%c'\n"), c);
@@ -3370,7 +3364,7 @@
&& !do_segments && !do_header && !do_dump && !do_version
&& !do_histogram && !do_debugging && !do_arch && !do_notes
&& !do_section_groups && !do_archive_index
- && !do_dyn_syms && !do_maps)
+ && !do_dyn_syms)
usage (stderr);
else if (argc < 3)
{
@@ -11855,8 +11849,6 @@
return _("NT_LWPSINFO (lwpsinfo_t structure)");
case NT_WIN32PSTATUS:
return _("NT_WIN32PSTATUS (win32_pstatus structure)");
- case NT_MAPS:
- return _("NT_MAPS (maps info)");
default:
break;
}
@@ -11970,9 +11962,6 @@
{
const char * name = pnote->namesz ? pnote->namedata : "(NONE)";
const char * nt;
-
- if (do_maps && pnote->type != NT_MAPS)
- return 0;
if (pnote->namesz == 0)
/* If there is no note name, then use the default set of
@@ -12000,13 +11989,6 @@
nt = get_note_type (pnote->type);
printf (" %s\t\t0x%08lx\t%s\n", name, pnote->descsz, nt);
- if (do_maps && pnote->type == NT_MAPS)
- {
- pnote->descdata[pnote->descsz] = 0;
- printf("Maps is following:\n");
- printf("%s\n",pnote->descdata);
- }
-
return 1;
}
@@ -12093,6 +12075,7 @@
}
res &= process_note (& inote);
+
if (temp != NULL)
{
free (temp);
@@ -12150,7 +12133,7 @@
process_notes (FILE * file)
{
/* If we have not been asked to display the notes then do nothing. */
- if (! do_notes && !do_maps)
+ if (! do_notes)
return 1;
if (elf_header.e_type != ET_CORE)
diff -u ./binutils-2.21.1/include/elf/common.h
./binutils-2.21.1/include/elf/common.h.orig
--- ./binutils-2.21.1/include/elf/common.h 2011-12-07
14:56:02.000000000 -0500
+++ ./binutils-2.21.1/include/elf/common.h.orig 2011-12-07
14:55:45.000000000 -0500
@@ -518,7 +518,6 @@
#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */
#define NT_TASKSTRUCT 4 /* Contains copy of task struct */
#define NT_AUXV 6 /* Contains copy of
Elfxx_auxv_t */
-#define NT_MAPS 7 /* Contains copy of maps*/
#define NT_PRXFPREG 0x46e62b7f /* Contains a user_xfpregs_struct; */
/* note name must be "LINUX". */
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
On 12/13/11, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> On Sun, 11 Dec 2011 15:10:00 +0100, t cheney wrote:
>> This patch just add memory layout(same as /proc/pid/maps) to
>> coredump file. The layout is appended to corenote segment with
>> flag NT_MAPS=7.
>
> FYI this has been solved by ABRT - Automated Bug-Reporting Tool
> https://fedorahosted.org/abrt/
> (it is distro-neutral despite its homepage)
>
> Core file is there a subdirectory where the core file is just one of the
> many
> associated files:
> /var/spool/abrt/ccpp-*:
> abrt_version analyzer architecture cmdline component coredump count
> dso_list environ executable hostname kernel maps os_release package
> pid pwd reason time uid username uuid var_log_messages
>
> More info files are being continually added, such as /proc/PID/fd{,info}/
> mapping at the crash dump time etc. You would need to add many more core
> file
> notes to make the core files useful for later analysis.
>
>
> Regards,
> Jan
>
next prev parent reply other threads:[~2011-12-18 10:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAE04G=Bu4WnU9SYU9u3-ap6OrBEjWONK8TA8bYBy5OSCCzzDqg@mail.gmail.com>
2011-12-13 12:37 ` Fwd: " t cheney
[not found] ` <m2y5uknqjk.fsf@firstfloor.org>
[not found] ` <CAE04G=Bq+tyPnM+SVHUm+AQH4nLOy-KH7foRVNFs6GNdzpiX_Q@mail.gmail.com>
[not found] ` <CAE04G=A7WWG4WDoTfcBVMsxNB2xndVTq4s6DPdsyDEca4Up=SQ@mail.gmail.com>
2011-12-13 12:52 ` t cheney
[not found] ` <CAE04G=D_OzrDRUOj-iVPJY5sNTLMfUKAeikks8TWMYOWvh6HeA@mail.gmail.com>
[not found] ` <20111212210328.GA29248@host2.jankratochvil.net>
2011-12-18 10:47 ` t cheney [this message]
[not found] ` <20111214211652.GO2203@ZenIV.linux.org.uk>
2011-12-18 13:53 ` t cheney
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='CAE04G=Bj+EsLbdrUDjvt3BfNee8TH-0ud2knc75JiRFKNfCvDg@mail.gmail.com' \
--to=cdmalord@gmail.com \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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