Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kamil Rytarowski <n54@gmx.com>
To: Pedro Alves <palves@redhat.com>, John Baldwin <jhb@freebsd.org>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 31/40] target_ops/C++: Base FreeBSD target
Date: Tue, 17 Apr 2018 18:50:00 -0000	[thread overview]
Message-ID: <ca765960-848e-47e3-681d-e5e4a06c71f7@gmx.com> (raw)
In-Reply-To: <44d9588c-e23e-5ef5-ef62-fdd594dd4c7f@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 3802 bytes --]

On 17.04.2018 20:13, Pedro Alves wrote:
> Hi Kamil!
> 
> Will you be able to smoke test the branch on your favorite
> port?  That'd be super.  :-)
> 

I can try to test it on NetBSD/amd64.

> On 04/17/2018 06:30 PM, Kamil Rytarowski wrote:
> 
>> Common BSD target should be changed in future to common BSD/Linux target
>> like in LLDB. There is a shared Remote Process Plugin used by Linux and
>> NetBSD.
> 
> I think that is confusing or oversimplifying things.  Also, it's
> a bit orthogonal to the present effort.  :-)  The "shared" Remote
> Process Plugin is just the equivalent of "target remote" in gdb.
> 

My comment was rather orthogonal to the process plugin model. I wanted
to state that FreeBSD and NetBSD diverged, while NetBSD was trying to
follow FreeBSD / Linux API with a clean room design.

Cloning 1:1: other BSD would require breakage in existing software as
the APIs were already incompatible. For example PT_LWPINFO has a
different meaning on FreeBSD (get thread info with trap details) and
NetBSD (iterate over threads in tracee).

This means that we are today a distinct target. It's an open question
about OpenBSD, they could follow NetBSD with marginal differences...
once we could convince them to sync up with proper support in debuggers.

> See:
> 
>  https://sourceware.org/gdb/wiki/Common
>  https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity
> 
> What we're missing is that gdbserver was never ported over to the
> BSDs.  At least, upstream.  Just like in lldb not all ports
> have been converted to use the remote process plugin.
> 
> Clearly there needs to be a shared interface the different target
> backends such as BSD and Linux implement to interact with the
> core of the debugger or the server.  In gdb and gdbserver that is
> their corresponding target_ops definitions (they're similar, but
> not the same).  So even when "going always remote", the target
> backend implementations can well share code.
> 
> If you're considering porting gdbserver to some platform that
> gdb already supports debugging natively, I strongly suggest
> making gdbserver reuse the native target code in gdb instead of
> duplicating the code.  A few years back someone was working
> on doing that for a Hurd gdbserver port, but unfortunately
> the work was never completed.  I was positively surprised how
> little change the gdb code was requiring for gdbserver
> adaptation though.
> 
> If done right (by making gdb and gdbserver use the same native
> backend target_ops-like interface), there's nothing preventing using
> the same backend code in-process in both gdb and gdbserver if we'd like,
> instead of always forcing use of gdbserver behind the scenes.  There
> are advantages to supporting native-without-forcing-gdbserver
> debugging too.  It's all open in the air at this point.
> 

There was a port of gdbserver to NetBSD, perhaps so old that it's no
longer relevant today (code from 2010).

http://gnats.netbsd.org/43332 gdbserver for powerpc

Right now, I'm busy with kernel work improving correctness of
forking-like code in the context of debuggers, it will be followed by
signals and threads. It's mostly a one-man show as of today... so it's a
process taking time. I'm reporting the monthly progress on blog.netbsd.org.

>> Enforcing a layer of common BSD code is counterproductive nowadays.
> 
> Note that nothing is being "enforced" and that there's no actual
> "common BSD layer" in the sense that everything sits on top of some
> common BSD layer.  There are simply a few pieces of shared functionality.
> If some BSD port doesn't want to use the shared bits, it's very easy
> not to use them.
> 

It will be revisited in future.

> Thanks,
> Pedro Alves
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 850 bytes --]

  reply	other threads:[~2018-04-17 18:50 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-14 19:09 [PATCH 00/40] C++ify target_ops, toward multi-target Pedro Alves
2018-04-14 19:10 ` [PATCH 02/40] make-target-delegates: line break between return type and function name Pedro Alves
2018-04-14 19:10 ` [PATCH 09/40] target_ops/C++: bfd-target Pedro Alves
2018-04-14 19:10 ` [PATCH 17/40] target_ops/C++: macOS/Darwin target Pedro Alves
2018-04-14 19:10 ` [PATCH 23/40] target_ops/C++: IA-64 GNU/Linux Pedro Alves
2018-04-14 19:10 ` [PATCH 19/40] target_ops/C++: AIX target Pedro Alves
2018-04-14 19:10 ` [PATCH 07/40] target_ops/C++: ravenscar-thread Pedro Alves
2018-04-14 19:10 ` [PATCH 27/40] target_ops/C++: SPARC GNU/Linux Pedro Alves
2018-04-14 19:10 ` [PATCH 39/40] linux_nat_target: More low methods Pedro Alves
2018-04-18  0:40   ` John Baldwin
2018-04-14 19:10 ` [PATCH 37/40] target_ops/C++: The Hurd Pedro Alves
2018-04-14 19:10 ` [PATCH 03/40] target_ops/C++: exec target Pedro Alves
2018-04-14 19:10 ` [PATCH 08/40] target_ops/C++: bsd-uthread Pedro Alves
2018-04-14 19:10 ` [PATCH 20/40] target_ops/C++: ARM GNU/Linux Pedro Alves
2018-04-14 19:10 ` [PATCH 40/40] target factories, target open and multiple instances of targets Pedro Alves
2018-04-14 19:10 ` [PATCH 34/40] target_ops/C++: bsd_kvm_add_target, BSD libkvm target Pedro Alves
2018-04-14 19:10 ` [PATCH 29/40] target_ops/C++: Tile-Gx GNU/Linux Pedro Alves
2018-04-14 19:10 ` [PATCH 38/40] target_ops: Use bool throughout Pedro Alves
2018-04-14 19:10 ` [PATCH 32/40] target_ops/C++: Generic i386/AMD64 BSD targets Pedro Alves
2018-04-14 19:15 ` [PATCH 14/40] target_ops/C++: PPC/PPC64 GNU/Linux Pedro Alves
2018-04-14 19:15 ` [PATCH 22/40] target_ops/C++: HP-PA GNU/Linux Pedro Alves
2018-04-14 19:15 ` [PATCH 12/40] target_ops/C++: target remote-sim Pedro Alves
2018-04-14 19:18 ` [PATCH 04/40] target_ops/C++: core target Pedro Alves
2018-04-14 19:18 ` [PATCH 24/40] target_ops/C++: m32r GNU/Linux Pedro Alves
2018-04-14 19:18 ` [PATCH 36/40] target_ops/C++: go32/DJGPP Pedro Alves
2018-04-14 19:18 ` [PATCH 25/40] target_ops/C++: m68k GNU/Linux Pedro Alves
2018-04-14 19:19 ` [PATCH 35/40] target_ops/C++: NTO/QNX, nto-procfs.c Pedro Alves
2018-04-14 19:19 ` [PATCH 16/40] target_ops/C++: Windows targets Pedro Alves
2018-04-14 19:19 ` [PATCH 05/40] target_ops/C++: ctf/tfile targets Pedro Alves
2018-04-14 19:19 ` [PATCH 31/40] target_ops/C++: Base FreeBSD target Pedro Alves
2018-04-17 16:12   ` John Baldwin
2018-04-17 17:07     ` Pedro Alves
2018-04-17 17:28       ` Kamil Rytarowski
2018-04-17 18:13         ` Pedro Alves
2018-04-17 18:50           ` Kamil Rytarowski [this message]
2018-04-18  0:40       ` John Baldwin
2018-04-18  1:51         ` Kamil Rytarowski
2018-04-18 11:23           ` Pedro Alves
     [not found]         ` <0b900391-f06d-278c-cbed-b89b207bd12e@redhat.com>
2018-04-18 14:20           ` Pedro Alves
2018-04-18 20:55             ` John Baldwin
2018-04-14 19:19 ` [PATCH 26/40] target_ops/C++: s390 GNU/Linux Pedro Alves
2018-04-14 19:19 ` [PATCH 30/40] target_ops/C++: Xtensa GNU/Linux Pedro Alves
2018-04-14 19:19 ` [PATCH 15/40] target_ops/C++: Solaris/procfs Pedro Alves
2018-04-14 19:20 ` [PATCH 06/40] target_ops/C++: spu-multiarch Pedro Alves
2018-04-14 19:20 ` [PATCH 33/40] target_ops/C++: The rest of the BSD targets Pedro Alves
2018-04-14 19:20 ` [PATCH 10/40] target_ops/C++: record targets Pedro Alves
2018-04-14 19:20 ` [PATCH 11/40] target_ops/C++: remote/extended-remote targets Pedro Alves
2018-04-14 19:28 ` [PATCH 28/40] target_ops/C++: SPU/Linux Pedro Alves
2018-05-04 17:09   ` Ulrich Weigand
2018-05-04 17:15     ` Pedro Alves
2018-05-04 17:22       ` Ulrich Weigand
2018-05-04 17:27         ` Pedro Alves
2018-04-14 19:28 ` [PATCH 21/40] target_ops/C++: Aarch64 GNU/Linux Pedro Alves
2018-04-14 19:29 ` [PATCH 13/40] target_ops/C++: GNU/Linux + x86/AMD64 Pedro Alves
2018-04-14 19:30 ` [PATCH 18/40] target_ops/C++: linux_trad_target, MIPS and Alpha GNU/Linux Pedro Alves
2018-04-16 15:15 ` [RESEND][PATCH 01/40] Convert struct target_ops to C++ Pedro Alves
2018-05-03  0:06   ` Pedro Alves
2018-10-27 21:58     ` 8.2 regression for invalid -data-directory [Re: [RESEND][PATCH 01/40] Convert struct target_ops to C++] Jan Kratochvil
2018-10-30 20:24       ` Tom Tromey
2019-02-14 15:30     ` [RESEND][PATCH 01/40] Convert struct target_ops to C++ Thomas Schwinge
2018-04-27 15:47 ` [PATCH 00/40] C++ify target_ops, toward multi-target Tom Tromey
2018-05-02 22:55   ` Pedro Alves
2018-04-29 15:22 ` Simon Marchi
2018-05-02 22:51   ` Pedro Alves

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=ca765960-848e-47e3-681d-e5e4a06c71f7@gmx.com \
    --to=n54@gmx.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@freebsd.org \
    --cc=palves@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