From: John Baldwin <jhb@FreeBSD.org>
To: Simon Ser <contact@emersion.fr>, gdb-patches@sourceware.org
Subject: Re: [PATCH v4] Generate NT_PROCSTAT_{AUXV,VMMAP,PS_STRINGS} in FreeBSD coredumps
Date: Thu, 23 Aug 2018 16:16:00 -0000 [thread overview]
Message-ID: <2cdbddb0-7f21-77e0-adae-c88ced81fd76@FreeBSD.org> (raw)
In-Reply-To: <ib_TVW3fonqPSdh5gAZOPNh1ENxyuGpJ0Sr8sa77CSryEWuzV3XqkjpFnBmMC80uaXHN4xw6PxlK_7JvzAp3sFZQuCujTe0BC4nE1736W00=@emersion.fr>
On 8/23/18 3:02 PM, Simon Ser wrote:
> gcore generates NT_AUXV and NT_FILE notes for Linux targets. On
> FreeBSD auxv is stored in a NT_PROCSTAT_AUXV section, file mappings
> are stored in a NT_PROCSTAT_VMMAP and both are prefixed with the
> struct size.
>
> 2018-08-23 Simon Ser <contact@emersion.fr>
> * target.h (enum target_object): add FreeBSD-specific
> TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS
> * fbsd-nat.c (fbsd_nat_target::xfer_partial): add support for
> TARGET_OBJECT_FREEBSD_VMMAP and TARGET_OBJECT_FREEBSD_PS_STRINGS
> * fbsd-tdep.c (fbsd_make_corefile_notes): write NT_PROCSTAT_AUXV,
> NT_PROCSTAT_VMMAP and NT_PROCSTAT_PS_STRINGS notes
> ---
> +
> + memcpy (buf, &struct_size, sizeof (struct_size));
> + if (sysctl (mib, 4, buf + sizeof (struct_size), &buflen, NULL, 0) != 0)
One nit here: buflen is too large on input. You should do
'buflen -= sizeof(struct size)' before calling sysctl().
Agreed that auxv sysctl issues belong to a separate patch.
--
John Baldwin
next prev parent reply other threads:[~2018-08-23 16:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 12:35 [PATCH] Generate NT_PROCSTAT_{AUXV,VMMAP} " Simon Ser
2018-07-11 16:16 ` John Baldwin
2018-07-11 16:40 ` Simon Ser
2018-07-16 13:39 ` [PATCH v2] Generate NT_PROCSTAT_{AUXV,VMMAP,PS_STRINGS} " Simon Ser
2018-07-24 7:53 ` Simon Ser
2018-08-01 16:33 ` Simon Ser
2018-08-01 18:16 ` John Baldwin
2018-08-21 14:45 ` [PATCH v3] " Simon Ser
2018-08-23 10:40 ` John Baldwin
2018-08-23 14:02 ` [PATCH v4] " Simon Ser
2018-08-23 16:16 ` John Baldwin [this message]
2018-08-23 17:11 ` [PATCH v5] " Simon Ser
2018-09-02 20:02 ` Simon Ser
2018-09-06 22:12 ` John Baldwin
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=2cdbddb0-7f21-77e0-adae-c88ced81fd76@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=contact@emersion.fr \
--cc=gdb-patches@sourceware.org \
/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