From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43093 invoked by alias); 11 Jul 2018 16:40:07 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 43064 invoked by uid 89); 11 Jul 2018 16:40:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=talk X-HELO: mail2.protonmail.ch Received: from mail2.protonmail.ch (HELO mail2.protonmail.ch) (185.70.40.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Jul 2018 16:40:04 +0000 Date: Wed, 11 Jul 2018 16:40:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail; t=1531327200; bh=y8jSXwBobGXQLGhNs2E4liUfqzh3+TBiCMD8k7PG8cY=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=M4BgOBKaOj085IIQ2LmlO6AMio6kcR0eTsuoMd/ssdOfXvWYxAQF4ACR478lhSDlv LupbPUALPm5prq6Wy7a1AX1XS4KspzKlHNZX86L5BoUo6mp+hWsqL5YcE1Q8D4u8Ba o0m1TkYwdgq9zrF8JIx23vh578WbQ44seZnTTFYo= To: John Baldwin From: Simon Ser Cc: "gdb-patches@sourceware.org" Reply-To: Simon Ser Subject: Re: [PATCH] Generate NT_PROCSTAT_{AUXV,VMMAP} in FreeBSD coredumps Message-ID: In-Reply-To: <95fcaebb-d260-bff6-ac4b-5e052c3787bb@FreeBSD.org> References: <95fcaebb-d260-bff6-ac4b-5e052c3787bb@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-07/txt/msg00316.txt.bz2 On July 11, 2018 5:16 PM, John Baldwin wrote: > You can't use a sysctl like this in a tdep.c file. fbsd-tdep.c runs on > any OS, (so for example you could be running gdb with a FreeBSD binary > on Linux or OS X against a debug server (gdbserver or lldb-server or some > such) running on a remote FreeBSD host (or VM) and use 'gcore' on the > debugging host to generate a local core file. Ah, that's what I feared when choosing this approach. > Native code that would only run on a FreeBSD host would live in fbsd-nat.= c, > and when I have thought about handling other procstat notes in FreeBSD co= res > I've mostly thought about adding some kind of hook that fbsd-tdep.c would > invoke to write extra core notes and setting that hook only for native > targets in fbsd-nat.c for the native gdbarchs. > > Your previous patch for AUXV still works because the target_foo function > you called previously will talk to either the debug server or the > native target to fetch the AUXV data, so I think your previous patch > for NT_PROCSTAT_AUXV is a better approach for that note. Hmm, I need those other notes too. Would it be possible to add some FreeBSD-specific TARGET_OBJECT_* constants? If not, could you explain how one would add this hook? Thanks, Simon