From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id BFC973898505 for ; Wed, 8 May 2024 13:18:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BFC973898505 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BFC973898505 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715174326; cv=none; b=tNm7oCB8un7PYNl5BagVKU22gFtap286AE/T3fBgKwyMBOVutVjS0K+10MRkZTA56h7wiWvRcg59LSyKfzuDbI6cwr6P55mgCzmHWAM8As3j0XHrKLIGJg/JWiCkWwgrdSRsFw94vShBQEilqnxTeYO+ocXnTpFdC9MMSe3t5VU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715174326; c=relaxed/simple; bh=nHDlDpE8ggRB7ntNZ12faUQHUT7lcc5zf7i91LPGIes=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=cKscVnjcoUOoEW+qZ/pRIEubhtU3Eyct8NSmpnzbEAixFWfwc8niKDDgUe3AQ41rGUMdo9ifNjXkGGw4Xn/oyyBfkWtFGGb8EgTrQ+bnRuWAxXnCrNWeFE6FZtO8alNrWhd5c0JSpw+IyaVLgrJt2DXnKLJTexaVEUoHa5ht6sA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715174324; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QS3beKYJFX+aN8K/bAqPJhFixEv83n/t07xg5zzaxyk=; b=UJ4eMgEcxw9yUEHTX4YqNvVJ6Fli+aO/GtOKsXFVFG3f9Fc1m4VI+Yf+M8DFiwe4TqQyVp kUtWJMXg0uhfY3H8wtNbTUlo3R6SAQzlpJG+ttRE99OMBqEGwcf3YYVEZJ7HeyMAwQU+Ws az8e97jxqBVC+dcPyASEBQxdHN0nP1E= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-KCuL78ekNvWjLMF7t5pXjQ-1; Wed, 08 May 2024 09:18:43 -0400 X-MC-Unique: KCuL78ekNvWjLMF7t5pXjQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-416ac21981dso4571625e9.1 for ; Wed, 08 May 2024 06:18:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715174321; x=1715779121; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QS3beKYJFX+aN8K/bAqPJhFixEv83n/t07xg5zzaxyk=; b=WZvSZhEaXkrlKDYpQEivPY0Tb/y+tuQsIampwWaKLIvr9Pr/ttiHp5O40z8JuwvulH GmVJJf1fg6dTiApIW3YC+tYzbQQlNfLDwSSCNTv8QoH9Vb33Yb0acqL8scyLjmzZKVbO ZCeCpnc6LZfazLMHZ/qTgSTppT17qUKXH7tiSfsxv+99Jsv8MM+RLLp2WJTQkXCHc/7a YES0KB1P7PXwmghKX15qTvZH7XbtE1WjT5mKkKfezWKdGLrL4bSvwYFKUBUrID+QNaZD 23csioaXPDpZGoMjeKBWfyBp5qJCZHxPkmoZ71VNpKHbvj6VOjBJQrPzXv5RYI4Ecn+u xOfQ== X-Forwarded-Encrypted: i=1; AJvYcCW0ji9LTDiVqm4R//3tt9G17O9axncQTLWp2UZpEUP0Jzy4kfnTIW3xpyWiw5K0LUAmEXIYs0MGZtpbU2zRzYgmlBXEkOamNCgwiA== X-Gm-Message-State: AOJu0Yy8jh42nIhXvGjk73H5rDnKFYUpYDdxv7U5O2tzWVgq9dQnGZvk D4vXC34GB497G+W0QLdrhd2sin5hirWjuFvV0NskJnD7EUxZKALMBmp7noQhoH+k06Im85ck8CR 8hq9EVIaqC9unnrq73411g2Be9rT9u3ig+I9S9I61d5SVvSYKjtJs1wJPL50= X-Received: by 2002:a05:600c:3b93:b0:41c:73d:63b3 with SMTP id 5b1f17b1804b1-41f71aca9b9mr25013945e9.3.1715174320932; Wed, 08 May 2024 06:18:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRvKVtneE7OGMHLFyJ8d/L9I7RwqMKlEsyAaw3bB7Ce8V/jkQcQx9NrRsBKHoAl5Wu3ZDInQ== X-Received: by 2002:a05:600c:3b93:b0:41c:73d:63b3 with SMTP id 5b1f17b1804b1-41f71aca9b9mr25013715e9.3.1715174320481; Wed, 08 May 2024 06:18:40 -0700 (PDT) Received: from localhost ([31.111.84.240]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41f88208815sm22854435e9.43.2024.05.08.06.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 06:18:40 -0700 (PDT) From: Andrew Burgess To: "Willgerodt, Felix" , Luis Machado , "gdb-patches@sourceware.org" Cc: John Baldwin Subject: RE: [PATCHv5 05/11] gdbserver/x86: move no-xml code earlier in x86_linux_read_description In-Reply-To: References: <6e7440d3bb04135432f9f18e0630ee1bca23e4d6.1714143669.git.aburgess@redhat.com> <9e95c677-b640-43af-903b-b01a48d5ac67@arm.com> <87h6f9tyop.fsf@redhat.com> Date: Wed, 08 May 2024 14:18:38 +0100 Message-ID: <875xvotpap.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: "Willgerodt, Felix" writes: >> -----Original Message----- >> From: Andrew Burgess >> Sent: Dienstag, 7. Mai 2024 17:44 >> To: Luis Machado ; Willgerodt, Felix >> ; gdb-patches@sourceware.org >> Cc: John Baldwin >> Subject: Re: [PATCHv5 05/11] gdbserver/x86: move no-xml code earlier in >> x86_linux_read_description >> >> Luis Machado writes: >> >> > On 4/29/24 15:34, Willgerodt, Felix wrote: >> >>> -----Original Message----- >> >>> From: Andrew Burgess >> >>> Sent: Freitag, 26. April 2024 17:02 >> >>> To: gdb-patches@sourceware.org >> >>> Cc: Andrew Burgess ; Willgerodt, Felix >> >>> ; John Baldwin >> >>> Subject: [PATCHv5 05/11] gdbserver/x86: move no-xml code earlier in >> >>> x86_linux_read_description >> >>> >> >>> This commit is part of a series that aims to share more of the x86 >> >>> target description reading/generation code between GDB and gdbserver. >> >>> >> >>> There are a huge number of similarities between the code in >> >>> gdbserver's x86_linux_read_description function and GDB's >> >>> x86_linux_nat_target::read_description function, and it is this >> >>> similarity that I plan, in a later commit, to share between GDB and >> >>> gdbserver. >> >>> >> >>> However, one thing that is different in x86_linux_read_description is >> >>> the code inside the '!use_xml' block. This is the code that handles >> >>> the case where gdbserver is not allowed to send an XML target >> >>> description back to GDB. In this case gdbserver uses some predefined, >> >>> fixed, target descriptions. >> >>> >> >>> First, it's worth noting that I suspect this code is not tested any >> >>> more. I couldn't find anything in the testsuite that tries to disable >> >>> XML target description support. And the idea of having a single >> >>> "fixed" target description really doesn't work well when we think >> >>> about all the various x86 extensions that exist. Part of me would >> >>> like to rip out the no-xml support in gdbserver (at least for x86), >> >>> and if a GDB connects that doesn't support XML target descriptions, >> >>> gdbserver can just give an error and drop the connection. GDB has >> >>> supported XML target descriptions for 16 years now, I think it would >> >>> be reasonable for our shipped gdbserver to drop support for the old >> >>> way of doing things. >> >> >> >> Interesting. I for one would +1 this. Slightly related: >> >> I wonder if anyone really builds GDB without libexpat anymore and >> >> if we couldn't even think of making it mandatory. (Which doesn't >> >> mean dropping the ball on supporting stubs without XML.) >> > >> > I'd support making xml descriptions mandatory for some targets. AArch64 and >> > 32-bit Arm both rely heavily on xml description for feature discovery. >> >> I might be wrong, but I don't think Felix was even suggesting we need to >> go that far. > > You are correct. > >> I think the suggestion was just that GDB itself should >> require libexpat, which would mean we have the potential to read XML >> target descriptions. >> >> This wouldn't mean that targets would be required to send XML target >> descriptions. >> >> My comment was specifically that x86 gdbserver should drop its no XML >> support, and if a user tries to connect with a no XML GDB then gdbserver >> would reject the connection. >> >> Moving to make libexpat a requirement would help in this case as a user >> would no longer be able to build a GDB which couldn't connect to an x86 >> gdbserver. >> >> > Off the top of my head, I think very old probes and the Linux Kernel's kgdb don't >> > support xml. I'm not sure how often kgdb gets used though, but falling back to a >> > default description should work for AArch64 and 32-bit Arm. >> >> I don't believe building GDB with libexpat support breaks the ability to >> connect to a target which doesn't support XML descriptions (if it does >> then that's a bug), so hopefully nobody else would be >> inconvenienced... except for those folk who are building GDB without >> libexpat support. > > One immediate concern in my mind would be testability for no-xml stubs > (without having looked at the current testing situation). Anyway, this is not > really a topic for this series, just an interesting side discussion. This don't think there would be a problem. Or, if there is, then that would be a legitimate bug that needs fixing. Right now I would not expect a user to have to build a no-xml GDB in order to talk to a no-xml target. I'd expect the user to fire up there standard XML supporting GDB, connect to the target, and have GDB "just work". If there are architectures supported by gdbserver that don't support sending back an XML description (I haven't checked) then they should work just as they do today, even if GDB supports reading XML. Thanks, Andrew